/* ============================================================
   AL-HABIB REAL ESTATE — JOB DESCRIPTION PAGE CSS (Arabic / RTL)
   Figma node 1103:26044 — careers detail / job description.
   Two columns: main content (left) + sticky TOC nav (right).
   BEM prefix: mah-jd-*
   ============================================================ */

/* ── Design tokens (from Figma variable defs) ── */
:root {
  --jd-navy:          #103c55; /* breadcrumb bar */
  --jd-title:         #0c3144; /* job title */
  --jd-body:          #16506e; /* paragraph / requirement text */
  --jd-gold:          #7f6f33; /* section title label */
  --jd-label:         #1f688f; /* requirement category label */
  --jd-muted:         #606060; /* tag text */
  --jd-bg:            #f8fafc; /* page background */
  --jd-tag-bg:        #f1f5f9; /* pill background */
  --jd-border:        #dcdcdc; /* row dividers */
  --jd-form-bg:       #e1ecf1; /* application form panel */
  --jd-input-bg:      #b4d2e1; /* input background */
  --jd-submit-bg:     #374955; /* submit button */
  --jd-toc-active:    #16506e;
  --jd-toc-inactive:  #606060;
  --jd-white:         #ffffff;
  --jd-px:            96px;
  --jd-gap:           64px;
  --jd-nav-w:         400px;
  --jd-content-w:     671px;
  --jd-radius:        16px;
  --jd-radius-sm:     8px;
  --jd-transition:    0.25s ease;
  --jd-heading-font:  '29LT Zarid', 'Greta Arabic', system-ui, sans-serif;
  --jd-body-font:     'Work Sans', system-ui, sans-serif;
}

/* ── Page wrapper ── */
.job-description-page {
  background: var(--jd-bg);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.mah-jd-breadcrumbs {
  background-color: var(--jd-navy);
  padding: 12px var(--jd-px);
  direction: rtl;
}

.mah-jd-breadcrumbs__inner {
  display: flex;
  align-items: center;
  gap: 0;
}

.mah-jd-breadcrumbs__current {
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  color: #86b8d1;
  padding: 16px 8px;
  white-space: nowrap;
}

.mah-jd-breadcrumbs__sep {
  color: #86b8d1;
  opacity: 0.6;
  flex-shrink: 0;
}

.mah-jd-breadcrumbs__link {
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  color: #b4d2e1;
  text-decoration: none;
  padding: 16px 8px;
  opacity: 0.85;
  white-space: nowrap;
  transition: opacity var(--jd-transition);
}

.mah-jd-breadcrumbs__link:hover {
  opacity: 1;
  color: #b4d2e1;
}

/* ============================================================
   BODY / MAIN LAYOUT
   ============================================================ */
.mah-jd-body {
  background: var(--jd-bg);
  padding-bottom: 48px;
}

.mah-jd-main {
  display: flex;
  flex-direction: row;
  gap: var(--jd-gap);
  padding: 0 var(--jd-px);
  align-items: flex-start;
  justify-content: flex-end;
  direction: rtl;
}

/* TOC nav — first in DOM → appears on RIGHT in RTL */
.mah-jd-nav {
  width: var(--jd-nav-w);
  flex-shrink: 0;
  padding-top: 128px;
  padding-bottom: 32px;
}

.mah-jd-nav__inner {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

.mah-jd-nav__item {
  width: 100%;
  border-bottom: 1px solid var(--jd-border);
  padding: 24px 0;
  font-family: var(--jd-heading-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--jd-toc-inactive);
  text-align: right;
  direction: rtl;
  background: none;
  border-right: none;
  border-left: none;
  border-top: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--jd-transition), color var(--jd-transition);
  text-decoration: none;
  display: block;
}

.mah-jd-nav__item:hover {
  opacity: 0.8;
}

.mah-jd-nav__item.is-active {
  color: var(--jd-toc-active);
  opacity: 1;
}

/* Main content — second in DOM → appears on LEFT in RTL */
.mah-jd-content {
  flex: 1;
  min-width: 0;
  max-width: var(--jd-content-w);
  padding-top: 80px;
}

.mah-jd-section {
  width: 100%;
  scroll-margin-top: 96px; /* clear the fixed 80px site header on anchor jumps */
}

/* ============================================================
   JOB HEADER (title + tags)
   ============================================================ */
.mah-jd-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 24px 0 24px;
}

.mah-jd-head__inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0 24px 0;
}

.mah-jd-head__title {
  width: 100%;
  margin: 0;
  font-family: var(--jd-heading-font);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -1px;
  color: var(--jd-title);
  text-align: right;
  direction: rtl;
}

.mah-jd-tags {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mah-jd-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  background: var(--jd-tag-bg);
  border-radius: 9999px;
  font-family: var(--jd-body-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--jd-muted);
  white-space: nowrap;
  line-height: normal;
}

/* ============================================================
   SECTION TITLE BAR (gold label)
   ============================================================ */
.mah-jd-section-title {
  background: var(--jd-bg);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
}

.mah-jd-section-title--spaced {
  padding-top: 48px;
}

.mah-jd-section-title__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--jd-gold);
  text-align: right;
  direction: rtl;
}

.mah-jd-section-title__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  color: var(--jd-gold);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--jd-transition);
}

.mah-jd-section-title__link:hover {
  opacity: 0.75;
  color: var(--jd-gold);
  text-decoration: none;
}

.mah-jd-section-title__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  order: 1;               /* arrow after the text */
  transform: scaleX(-1);  /* RTL: point toward the reading direction */
}

/* ============================================================
   JOB DESCRIPTION TEXT
   ============================================================ */
.mah-jd-desc {
  padding: 0 24px 24px 24px;
}

.mah-jd-desc__inner {
  padding: 0 0 24px 0;
}

.mah-jd-desc p {
  margin: 0 0 12px 0;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jd-body);
  text-align: right;
  direction: rtl;
}

.mah-jd-desc p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   REQUIREMENT / BENEFIT ROWS
   ============================================================ */
.mah-jd-req {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 24px;
  border-bottom: 2px solid var(--jd-border);
  direction: rtl;
}

.mah-jd-req--last {
  border-bottom: none;
}

.mah-jd-req__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 0 0 24px;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jd-body);
  text-align: right;
  direction: rtl;
}

.mah-jd-req__label {
  width: 120px;
  flex-shrink: 0;
  margin: 0;
  padding: 0 0 24px 24px;
  font-family: var(--jd-body-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--jd-label);
  text-align: right;
  direction: rtl;
}

/* ============================================================
   APPLICATION FORM
   ============================================================ */
.mah-jd-form {
  width: 612px;
  max-width: 100%;
  background: var(--jd-form-bg);
  border-radius: var(--jd-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  direction: rtl;
}

.mah-jd-form__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--jd-title);
}

.mah-jd-form__title {
  margin: 0;
  font-family: var(--jd-heading-font);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -1px;
  direction: rtl;
}

.mah-jd-form__subtitle {
  margin: 0;
  font-family: var(--jd-heading-font);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
  direction: rtl;
}

.mah-jd-form__group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mah-jd-field {
  position: relative;
  width: 100%;
  min-height: 56px;
  background: var(--jd-input-bg);
  border: 1px solid var(--jd-input-bg);
  border-radius: var(--jd-radius-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  transition: border-color var(--jd-transition);
}

.mah-jd-field:focus-within {
  border-color: #8fb9cf;
}

.mah-jd-field__input,
.mah-jd-field__file-label {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jd-body);
  text-align: right;
  direction: rtl;
}

.mah-jd-field__input::placeholder {
  color: var(--jd-body);
  opacity: 0.85;
}

.mah-jd-field__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mah-jd-field__file-label {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mah-jd-field__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--jd-body);
  pointer-events: none;
}

/* ── International phone (intl-tel-input) ── */
.mah-jd-field--phone {
  padding: 0;
}

.mah-jd-field--phone .iti {
  display: block;
  width: 100%;
  --iti-hover-color: transparent; /* kill the plugin's flag-only hover */
}

.mah-jd-phone {
  width: 100%;
  height: 54px;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--jd-body-font);
  font-size: 16px;
  color: var(--jd-body);
  padding: 16px;
  direction: ltr;
  text-align: right; /* digits sit beside the right-hand flag group in RTL */
}

.mah-jd-field--phone .iti__selected-country,
.mah-jd-field--phone .iti__selected-country-primary {
  direction: ltr;
}

.mah-jd-field--phone .iti__selected-country {
  background: transparent;
  border-radius: 0 var(--jd-radius-sm) var(--jd-radius-sm) 0; /* RTL: group on the right */
  transition: background 0.2s ease;
}

.mah-jd-field--phone .iti__selected-country:hover,
.mah-jd-field--phone .iti__selected-country[aria-expanded="true"] {
  background: rgba(12, 49, 68, 0.06);
}

.mah-jd-field--phone .iti__selected-dial-code {
  color: var(--jd-body);
  font-family: var(--jd-body-font);
}

.mah-jd-field--phone .iti--inline-dropdown .iti__dropdown-content {
  left: auto;
  right: 0;
  min-width: 280px;
}

.mah-jd-field--phone .iti__search-input {
  font-family: inherit;
  color: var(--jd-body);
}

.mah-jd-field--phone .iti__country.iti__highlight {
  background: var(--jd-input-bg);
}

/* ── Actions ── */
.mah-jd-form__actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
  width: 100%;
  direction: rtl;
}

.mah-jd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: var(--jd-radius-sm);
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  border: none;
  transition: opacity var(--jd-transition), background var(--jd-transition);
}

.mah-jd-btn--submit {
  width: 200px;
  flex-shrink: 0;
  padding: 16px 24px;
  background: var(--jd-submit-bg);
  color: var(--jd-white);
  box-shadow: 0 1px 2px rgba(35, 47, 55, 0.05);
  order: 2; /* submit always last (at the end) */
}

.mah-jd-btn--submit:hover {
  opacity: 0.9;
}

.mah-jd-btn--reset {
  padding: 16px 16px 16px 24px;
  background: transparent;
  color: #282828;
  order: 1; /* reset first, before submit */
}

.mah-jd-btn--reset:hover {
  opacity: 0.7;
}

.mah-jd-btn--reset svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   SIMILAR JOBS (reuse horizontal card pattern)
   ============================================================ */
.mah-jd-card {
  display: flex;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 2px solid var(--jd-border);
  direction: rtl;
  text-decoration: none;
  transition: background var(--jd-transition);
}

.mah-jd-card--last {
  border-bottom: none;
}

.mah-jd-card:hover {
  background: rgba(16, 60, 85, 0.03);
}

.mah-jd-card__details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 0 24px 24px;
}

.mah-jd-card__title-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mah-jd-card__title {
  width: 100%;
  margin: 0;
  font-family: var(--jd-heading-font);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -1px;
  color: var(--jd-title);
  text-align: right;
  direction: rtl;
}

.mah-jd-card__desc {
  width: 100%;
  margin: 0;
  font-family: var(--jd-body-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jd-body);
  text-align: right;
  direction: rtl;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  :root {
    --jd-px: 64px;
    --jd-gap: 48px;
    --jd-nav-w: 320px;
  }
}

@media (max-width: 1024px) {
  :root {
    --jd-px: 40px;
    --jd-gap: 32px;
    --jd-nav-w: 260px;
  }
  .mah-jd-head__title,
  .mah-jd-card__title,
  .mah-jd-form__title {
    font-size: 28px;
  }
  .mah-jd-form__subtitle {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  :root { --jd-px: 24px; }
  .mah-jd-main {
    flex-direction: column;
    gap: 24px;
  }
  .mah-jd-section-title {
    flex-wrap: wrap;
  }
  .mah-jd-section-title__link {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
  .mah-jd-nav {
    width: 100%;
    padding-top: 32px;
    padding-bottom: 0;
    order: 2;
  }
  .mah-jd-nav__inner {
    position: static;
  }
  .mah-jd-content {
    width: 100%;
    max-width: 100%;
    padding-top: 24px;
    order: 1;
  }
  .mah-jd-form {
    width: 100%;
  }
  .mah-jd-form__actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  :root { --jd-px: 16px; }
  .mah-jd-head,
  .mah-jd-desc,
  .mah-jd-req,
  .mah-jd-card,
  .mah-jd-section-title {
    padding-left: 16px;
    padding-right: 16px;
  }
  .mah-jd-head__title,
  .mah-jd-card__title,
  .mah-jd-form__title {
    font-size: 24px;
  }
  .mah-jd-btn--submit {
    width: 100%;
  }
}
