/* ============================================================
   Manar 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;
}

/* FAQ "+" toggles to "×" when open */
.faq-plus {
  transition: transform 0.25s ease;
}
.faq-item.is-open .faq-plus {
  transform: rotate(45deg);
}

/* 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: #eef3f2;
}
.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;
}
.dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #374151;
  font-family: "Cairo", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
  background-color: #f0f7f4;
  color: #1b5e37;
  outline: none;
}
[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);
}

/* 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: #677c7d;
  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: #f0f7f4;
}
.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,
  .drawer,
  .faq-plus,
  .lead-row,
  .dropdown-menu,
  .dropdown-caret,
  .dropdown-item {
    transition: none;
  }
}
