/* FAQ — answer engine (AEO) · ARIX 2026 theme
   Accordion is native <details>; no JavaScript anywhere in this module. */

.ax-faq { background: var(--surface-white); padding: 88px 0; }
.ax-faq__inner { max-width: 880px; margin: 0 auto; padding: 0 24px; }

.ax-faq__heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  font-weight: var(--fw-light);
  color: var(--color-text);
  margin: 0 0 20px;
}
.ax-faq__intro {
  font-size: var(--fs-body-l); line-height: var(--lh-body-l);
  color: var(--color-text-2);
  margin: 0 0 40px;
}

/* jump nav */
.ax-faq__nav { margin: 0 0 48px; padding: 26px 28px; background: var(--surface-sunken); border-radius: 4px; }
.ax-faq__nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  /* row gap opens up the three wrapped lines; column gap separates categories */
  gap: 16px 38px;
}
.ax-faq__nav a {
  display: inline-block;
  font-size: var(--fs-body-s); line-height: 1.75;
  font-weight: var(--fw-medium);
  color: var(--color-accent-teal); text-decoration: none;
}
.ax-faq__nav a:hover { text-decoration: underline; }

/* section heading */
.ax-faq__section {
  font-family: var(--font-heading);
  font-size: var(--fs-h4); line-height: var(--lh-h4);
  font-weight: var(--fw-semibold);
  letter-spacing: .01em;
  color: var(--color-text);
  margin: 56px 0 8px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline);
}
.ax-faq__section:first-child { margin-top: 0; }

/* item */
.ax-faq__item { border-bottom: 1px solid var(--border-hairline); }
.ax-faq__q-text {
  font-family: var(--font-heading);
  font-size: var(--fs-h5); line-height: var(--lh-h5);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  margin: 0;
}

/* expanded variant */
.ax-faq__item--open { padding: 28px 0; }
.ax-faq__item--open .ax-faq__q-text { margin-bottom: 12px; }

/* accordion variant */
.ax-faq__item[open] { padding-bottom: 8px; }
.ax-faq__q {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 24px 0; cursor: pointer; list-style: none;
}
.ax-faq__q::-webkit-details-marker { display: none; }
.ax-faq__q:hover .ax-faq__q-text { color: var(--color-accent-teal); }
.ax-faq__q:focus-visible { outline: 2px solid var(--color-accent-teal); outline-offset: 4px; }

.ax-faq__chev {
  flex: 0 0 auto; width: 12px; height: 12px; margin-top: 7px;
  border-right: 2px solid var(--color-text-3);
  border-bottom: 2px solid var(--color-text-3);
  transform: rotate(45deg); transition: transform .2s ease;
}
.ax-faq__item[open] .ax-faq__chev { transform: rotate(-135deg); }

/* ---- accordion open/close animation ----
   Modern browsers animate ::details-content in BOTH directions once `auto` is
   interpolatable. Older ones ignore that selector entirely, so they get a
   one-way reveal via @supports instead — no JavaScript in either path, and the
   answer text stays in the raw HTML regardless. */
@media (prefers-reduced-motion: no-preference) {
  :root { interpolate-size: allow-keywords; }

  .ax-faq__item::details-content {
    block-size: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      block-size .34s cubic-bezier(.22,.61,.36,1),
      opacity .26s ease,
      content-visibility .34s allow-discrete;
  }
  .ax-faq__item[open]::details-content {
    block-size: auto;
    opacity: 1;
  }

  @supports not selector(::details-content) {
    .ax-faq__item[open] .ax-faq__a { animation: ax-faq-reveal .3s cubic-bezier(.22,.61,.36,1); }
    @keyframes ax-faq-reveal {
      from { opacity: 0; transform: translateY(-6px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* answer body */
.ax-faq__a {
  font-size: var(--fs-body-m); line-height: var(--lh-body-m);
  color: var(--color-text-2);
  padding-bottom: 24px;
}
.ax-faq__a p { margin: 0 0 12px; }
.ax-faq__a p:last-child { margin-bottom: 0; }
.ax-faq__a ul, .ax-faq__a ol { margin: 0 0 12px; padding-left: 22px; }
.ax-faq__a li { margin: 0 0 4px; }
.ax-faq__a a { color: var(--color-accent-teal); }
.ax-faq__a strong { color: var(--color-text); font-weight: var(--fw-semibold); }

.ax-faq__more { margin: 40px 0 0; }
.ax-faq__more a {
  font-size: var(--fs-body-m); font-weight: var(--fw-medium);
  color: var(--color-accent-teal); text-decoration: none;
}
.ax-faq__more a:hover { text-decoration: underline; }

/* deep-linked question should not hide under the fixed header */
.ax-faq__item, .ax-faq__section { scroll-margin-top: 104px; }

/* Smooth scrolling for the jump-nav and for deep links. Scoped to the document
   because anchor navigation is a document-level behaviour; it only loads on
   pages that actually use this module. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (max-width: 768px) {
  .ax-faq { padding: 56px 0; }
  .ax-faq__heading { font-size: 34px; }
  .ax-faq__q { padding: 20px 0; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ax-faq__chev { transition: none; }
  .ax-faq__item::details-content { transition: none; }
}
