/* ------------------------------------------------------------------ */
/* FAQ                                                                  */
/*                                                                      */
/* A sticky category list beside an accordion. The hero comes from      */
/* style.css untouched.                                                 */
/* Logical properties throughout, so Arabic mirrors on its own.         */
/* ------------------------------------------------------------------ */

.faq-section {
  padding: clamp(34px, 3.4vw, 62px) 0 var(--section-gap);
}

.faq-layout {
  display: grid;
  grid-template-columns: clamp(240px, 24vw, 330px) minmax(0, 1fr);
  gap: clamp(14px, 1.5vw, 26px);
  align-items: start;
}

/* ---- categories -------------------------------------------------------- */

.faq-categories {
  position: sticky;
  /* Clears the header, which is pinned to the top of the viewport. */
  top: calc(var(--header-h) + 16px);
  padding: clamp(14px, 1.4vw, 24px);
  border: 1px solid #E7E9F1;
  border-radius: 16px;
  background: var(--white);
}

.faq-categories h2 {
  margin: 0 0 clamp(10px, 1vw, 16px);
  font-size: clamp(16px, 1.3vw, 23px);
  font-weight: 700;
  color: var(--navy);
}

.faq-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-cat {
  display: flex;
  align-items: center;
  gap: clamp(9px, .85vw, 14px);
  width: 100%;
  padding: clamp(9px, .85vw, 14px) clamp(10px, .95vw, 16px);
  border: 0;
  /* The active row is marked with a bar on its leading edge; the others
     carry a transparent one so nothing shifts when the marker appears. */
  border-inline-start: 3px solid transparent;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: clamp(11px, .88vw, 15px);
  color: var(--text-soft);
  text-align: start;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.faq-cat:hover {
  background: #F5F7FB;
  color: var(--navy);
}

.faq-cat.is-active {
  border-inline-start-color: #1a906e;
  background: #EEF7F3;
  font-weight: 600;
  color: #1a906e;
}

.faq-cat i {
  flex-shrink: 0;
  font-size: 1.05em;
}

.faq-cat span {
  flex: 1 1 auto;
  min-width: 0;
}

.faq-cat__count {
  flex-shrink: 0;
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #EEF0F6;
  font-size: clamp(10px, .78vw, 13px);
  font-style: normal;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
}

.faq-cat.is-active .faq-cat__count {
  background: #1a906e;
  color: var(--white);
}

/* ---- the accordion ------------------------------------------------------ */

.faq-panel {
  padding: clamp(6px, .6vw, 12px) clamp(14px, 1.5vw, 28px);
  border: 1px solid #E7E9F1;
  border-radius: 16px;
  background: var(--white);
}

.faq-item + .faq-item {
  border-block-start: 1px solid #EDEFF5;
}

.faq-item[hidden] {
  display: none;
}

/* A heading wrapping a button: the button carries the click and the state,
   the heading keeps the questions in the document outline. */
.faq-item__q {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.faq-item__q button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.2vw, 22px);
  width: 100%;
  padding: clamp(14px, 1.4vw, 24px) 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: clamp(14px, 1.15vw, 20px);
  color: var(--navy);
  text-align: start;
  cursor: pointer;
}

.faq-item__q button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}

/* The plus/minus is drawn rather than set in an icon font, so the closed
   and open states cannot disagree if the font is slow or blocked. */
.faq-item__mark {
  position: relative;
  flex-shrink: 0;
  width: clamp(20px, 1.6vw, 26px);
  height: clamp(20px, 1.6vw, 26px);
  border: 1.5px solid #1a906e;
  border-radius: 50%;
}

.faq-item__mark::before,
.faq-item__mark::after {
  content: "";
  position: absolute;
  inset-inline: 25%;
  inset-block: calc(50% - 0.75px);
  background: #1a906e;
  transition: transform .2s;
}

/* The upright stroke is the one that disappears when the item opens. */
.faq-item__mark::after {
  transform: rotate(90deg);
}

.faq-item.is-open .faq-item__mark::after {
  transform: rotate(90deg) scaleX(0);
}

.faq-item__a {
  padding-bottom: clamp(14px, 1.4vw, 24px);
}

.faq-item__a[hidden] {
  display: none;
}

.faq-item__a p {
  margin: 0;
  max-width: 78ch;
  font-size: clamp(11px, .9vw, 15px);
  line-height: 1.75;
  color: var(--text-soft);
}

.faq-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 1.6vw, 30px);
  margin-top: clamp(12px, 1.2vw, 20px);
}

.faq-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: clamp(11px, .85vw, 14px);
  font-weight: 500;
  color: #1a906e;
  text-decoration: none;
}

.faq-action:hover {
  color: #1a906e;
  text-decoration: underline;
}

.faq-empty {
  margin: clamp(20px, 2vw, 34px) 0;
  font-size: var(--fs-sub);
  color: var(--text-soft);
  text-align: center;
}

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 991.98px) {
  .faq-layout {
    grid-template-columns: 1fr;
  }

  /* Pinned under a pinned header leaves almost no room on a short screen,
     so the list scrolls away with the page instead. */
  .faq-categories {
    position: static;
  }

  .faq-cats {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .faq-cat {
    width: auto;
    border-inline-start: 0;
    border: 1px solid #E7E9F1;
    border-radius: 999px;
  }

  .faq-cat.is-active {
    border-color: #1a906e;
  }
}
