/* ============================================================
   FAQ page — sticky TOC + accordion + search filter
   ============================================================ */


/* ============================================================
   Search box — inside light intro
   ============================================================ */

.faq-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 560px;
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0 8px 0 18px;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.faq-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 4px 16px rgba(10, 10, 11, 0.06);
}

.faq-search__icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-search__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 14px 12px;
  font-size: var(--fs-14);
  color: var(--ink);
  min-width: 0;
}

.faq-search__input::placeholder { color: var(--text-faint); }

.faq-search__clear {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease);
}

.faq-search__clear:hover {
  background: var(--ink);
  color: var(--white);
}

.faq-search__clear svg { width: 12px; height: 12px; }


/* ============================================================
   Layout — sticky TOC + content (2-col → 1-col mobile)
   ============================================================ */

.faq-layout {
  background: var(--white);
  padding: 32px 0 64px;
}

@media (max-width: 767.98px) {
  .faq-layout { padding: 24px 0 48px; }
}

.faq-layout__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 1023.98px) {
  .faq-layout__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}


/* ============================================================
   Sticky TOC sidebar
   ============================================================ */

.faq-toc {
  position: sticky;
  top: calc(var(--header-h, 64px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1023.98px) {
  .faq-toc {
    position: static;
    /* Horizontal scroll TOC on mobile */
  }
}

.faq-toc__head {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.faq-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (max-width: 1023.98px) {
  .faq-toc__list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .faq-toc__list::-webkit-scrollbar { display: none; }
}


.faq-toc__link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border-radius: var(--r-2);
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.3;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  scroll-snap-align: start;
}

.faq-toc__link:hover {
  background: var(--paper);
  color: var(--ink);
}

.faq-toc__link.is-active {
  background: var(--ink);
  color: var(--white);
}

@media (max-width: 1023.98px) {
  .faq-toc__link {
    flex-shrink: 0;
    grid-template-columns: auto 1fr auto;
    white-space: nowrap;
  }
}

.faq-toc__num {
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: inherit;
  opacity: 0.55;
}

.faq-toc__link.is-active .faq-toc__num { opacity: 1; }

.faq-toc__label {
  font-weight: 600;
  color: inherit;
}

.faq-toc__count {
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--r-pill);
  color: inherit;
  min-width: 24px;
  text-align: center;
}

.faq-toc__link.is-active .faq-toc__count {
  background: var(--red);
  color: var(--white);
}


/* TOC footer — fallback contact link */
.faq-toc__foot {
  padding: 18px 14px;
  background: var(--paper);
  border-radius: var(--r-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-toc__foot-label {
  font-size: var(--fs-12);
  color: var(--text-muted);
}

.faq-toc__foot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  align-self: flex-start;
  border-bottom: 1px solid var(--ink-3);
  padding-bottom: 1px;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.faq-toc__foot-link:hover {
  color: var(--red);
  border-color: var(--red);
}

.faq-toc__foot-link svg {
  width: 12px;
  height: 12px;
  transition: transform var(--dur) var(--ease);
}

.faq-toc__foot-link:hover svg { transform: translateX(2px); }

@media (max-width: 1023.98px) {
  .faq-toc__foot { display: none; }
}


/* ============================================================
   Content — accordion groups
   ============================================================ */

.faq-content {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .faq-content { gap: 40px; }
}


/* Group section */
.faq-group {
  scroll-margin-top: calc(var(--header-h, 64px) + 16px);
}

.faq-group.is-hidden { display: none; }

.faq-group__head {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.faq-group__num {
  font-family: 'Inter', sans-serif;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.faq-group__title {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}

.faq-group__lede {
  grid-column: 2;
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 575.98px) {
  .faq-group__head { grid-template-columns: 1fr; gap: 6px; }
  .faq-group__lede { grid-column: 1; }
  .faq-group__num { opacity: 0.5; font-size: 22px; }
}


/* List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* Item — accordion */
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.faq-item.is-hidden { display: none; }

.faq-item:hover {
  border-color: var(--ink-3);
}

.faq-item.is-open {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}

.faq-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease);
}

.faq-item__head:hover { background: var(--paper-2); }

.faq-item.is-open .faq-item__head { background: var(--paper); }

.faq-item__q {
  flex: 1;
  font-size: var(--fs-15, 0.9375rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.faq-item.is-open .faq-item__q { color: var(--red); }


.faq-item__toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-radius: 50%;
  color: var(--ink);
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur) var(--ease);
}

.faq-item__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur) var(--ease);
}

.faq-item.is-open .faq-item__toggle {
  background: var(--red);
  color: var(--white);
}

.faq-item.is-open .faq-item__toggle svg {
  transform: rotate(45deg);
}


/* Body — collapsed/expanded via grid trick */
.faq-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease);
}

.faq-item.is-open .faq-item__body {
  grid-template-rows: 1fr;
}

.faq-item__inner {
  overflow: hidden;
  min-height: 0;
}

.faq-item__inner > * {
  padding: 0 22px 20px;
  font-size: var(--fs-14);
  line-height: 1.7;
  color: var(--ink-2, #1C1D21);
  margin: 0;
}

.faq-item__inner a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease);
}

.faq-item__inner a:hover { color: var(--red); }


/* ============================================================
   Empty state — when search yields nothing
   ============================================================ */

.faq-empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--paper);
  border-radius: var(--r-4, 14px);
}

.faq-empty__icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.faq-empty__icon svg { width: 100%; height: 100%; }

.faq-empty__title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.faq-empty__desc {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin-bottom: 18px;
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .faq-item.is-open .faq-item__toggle svg { transform: none; }
  .faq-item__body { transition: none; }
  .faq-toc__foot-link:hover svg { transform: none; }
}
