/* ============================================================
   Mobdion Platform — small custom layer
   Only for things Tailwind utilities can't express cleanly.
   ============================================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Tajawal", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Horizontal scroll tracks (sliders): hide scrollbar, keep scroll */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* FAQ accordion open/close (grid-rows trick, no JS height math) */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}
.faq-panel > div {
  overflow: hidden;
}

/* "+" rotates to "×" when open — the default for a single-plus-icon
   accordion (curriculum/module lists on the program-detail pages). */
.faq-plus {
  transition: transform 0.25s ease;
}
.faq-item.is-open .faq-plus {
  transform: rotate(45deg);
}

/* Homepage FAQ only (Figma 167:540): white card → olive fill when open, and
   a dedicated minus.svg swapped in instead of rotating the plus icon. Scoped
   to .faq-accent so it doesn't leak into the plain rotate-only accordions. */
.faq-item.faq-accent {
  background-color: #fff;
  border-color: #e2ebeb;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}
.faq-item.faq-accent.is-open {
  background-color: #dce7a3;
  border-color: #e8dfd5;
}
.faq-item.faq-accent .faq-plus {
  transform: none;
}
.faq-item.faq-accent .faq-minus,
.faq-item.faq-accent.is-open .faq-plus {
  display: none;
}
.faq-item.faq-accent.is-open .faq-minus {
  display: block;
}

/* Mobile drawer transition */
.drawer {
  transition: transform 0.3s ease;
}

/* About page — Leadership list menu (hover + active row) */
.lead-row {
  transition: background-color 0.2s ease;
}
.lead-row:hover {
  background-color: #f1f5d8;
}
.lead-row.is-active {
  background-color: #e5e9e9;
}

/* Desktop header dropdowns */
[data-dropdown-menu] {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
/* Figma 167:7769 — full-bleed rows split by hairlines inside a 24px-radius
   panel (the panel itself carries rounded-[24px] + shadow-menu). */
.dropdown-item {
  display: block;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f3f5;
  color: #334155;
  font-family: "Tajawal", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.dropdown-item:last-child {
  border-bottom: 0;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
  background-color: #f1f5d8;
  color: #4d5a16;
  outline: none;
}
/* active row in a dropdown (the current language, or the current program page) */
.dropdown-item[aria-current="true"],
.dropdown-item[aria-current="page"] {
  background-color: #f1f5d8;
  color: #4d5a16;
  font-weight: 700;
}
[data-dropdown].is-open [data-dropdown-menu] {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-caret {
  transition: transform 0.2s ease;
}
[data-dropdown].is-open .dropdown-caret {
  transform: rotate(180deg);
}

/* Homepage program tabs (Figma 167:249): outline pill → solid olive when active */
.tab-pill {
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-weight: 500;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.tab-pill:hover {
  border-color: #a4b93a;
}
.tab-pill[aria-selected="true"] {
  background-color: #a4b93a;
  border-color: #a4b93a;
  color: #fff;
  font-weight: 700;
}
/* the cards carry `flex`, which out-ranks [hidden] */
[data-tab-item][hidden] {
  display: none;
}

/* Multi-select filter rows (checkbox + label inside a dropdown panel) */
.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: #374151;
  font-family: "Tajawal", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}
.filter-option:hover,
.filter-option:focus-within {
  background-color: #f1f5d8;
}
.filter-check {
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: #7a8c24;
  cursor: pointer;
}
.filter-option:has(.filter-check:checked) {
  color: #4d5a16;
  font-weight: 700;
}

/* Dual-handle price range. Two stacked <input type="range">: the tracks are
   hidden and replaced by .range-track/.range-fill, only the thumbs stay
   interactive so both handles can be grabbed on the same line. */
.range-dual {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
}
.range-track,
.range-fill {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  pointer-events: none;
}
.range-track {
  inset-inline: 0;
  background: #e0e5e4;
}
.range-fill {
  background: #a4b93a;
}
.range-dual input[type="range"] {
  position: absolute;
  inset-inline: 0;
  width: 100%;
  margin: 0;
  height: 18px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.range-dual input[type="range"]:focus-visible {
  outline: none;
}
.range-dual input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #7a8c24;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.range-dual input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #7a8c24;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.range-dual input[type="range"]::-moz-range-track {
  background: none;
}
.range-dual input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(164, 185, 58, 0.35);
}
.range-dual input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(164, 185, 58, 0.35);
}

/* Header site-search results */
.search-result {
  display: block;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: start;
  transition: background-color 0.2s ease;
}
.search-result:hover,
.search-result:focus-visible {
  background-color: #f1f5d8;
  outline: none;
}

/* Native selects: grey while the placeholder option is still chosen. */
.form-select:has(option[value=""]:checked) {
  color: #9ca3af;
}
.form-select option {
  color: #1a1a1a;
}

/* ---- intl-tel-input, restyled to match the Figma phone field ----
   The library owns the markup, so these override its defaults rather than
   re-implementing it. The field itself keeps its border; iti sits inside. */
.phone-field .iti {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.phone-field .iti__flag-container {
  padding: 3px;
}
/* the selected flag reads as the design's rounded chip */
.phone-field .iti--separate-dial-code .iti__selected-flag {
  height: 100%;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #f8f8f7;
}
.phone-field .iti--separate-dial-code .iti__selected-dial-code {
  font-family: "Tajawal", system-ui, sans-serif;
  font-size: 14px;
  line-height: 17px;
  color: #111827;
  direction: ltr;
}
.phone-field .iti__arrow {
  margin: 0;
  border-top-color: #9ca3af;
}
.phone-field .iti__arrow--up {
  border-bottom-color: #9ca3af;
}
.phone-field .iti input {
  height: 100%;
}
/* dropdown panel — anchored to the field, opening below it (or above when the
   viewport is tight, via iti's own --dropup modifier). */
.phone-field .iti__country-list {
  /* physical, not logical: the selector chip sits at the field's right edge in
     this RTL layout, so the panel hangs from the right and grows leftwards. */
  right: 0;
  left: auto;
  width: max-content;
  min-width: 320px;
  max-width: min(440px, 88vw);
  white-space: normal;
  margin-top: 6px;
}
.phone-field .iti__country-list--dropup {
  margin-top: 0;
  margin-bottom: 6px;
}
.iti__country-list {
  max-height: 280px;
  padding: 4px;
  border: 1px solid #e0e5e4;
  border-radius: 12px;
  box-shadow: 0px 4px 24px rgba(27, 31, 30, 0.12);
  font-family: "Tajawal", system-ui, sans-serif;
  text-align: start;
}

/* search row pinned to the top of the list */
.iti__search-row {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 4px 8px;
  background: #fff;
  list-style: none;
}
.iti__search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  font-family: "Tajawal", system-ui, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f8f8f7;
}
.iti__search-input::placeholder {
  color: #9ca3af;
}
.iti__search-input:focus {
  border-color: #a4b93a;
  background: #fff;
}
.iti__search-empty {
  padding: 12px 10px;
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  list-style: none;
}
.iti__country {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
}
.iti__country.iti__highlight,
.iti__country:hover {
  background-color: #f1f5d8;
}
.iti__dial-code {
  color: #6b7280;
  direction: ltr;
}
.iti__divider {
  margin: 4px 0;
  border-bottom-color: #e0e5e4;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .faq-panel,
  .faq-item,
  .tab-pill,
  .drawer,
  .lead-row,
  .dropdown-menu,
  .dropdown-caret,
  .dropdown-item,
  .filter-option,
  .search-result {
    transition: none;
  }
}
