/* ============================================================
   13-faqs.css — FAQ accordion
   Module: <section id="faqs">
   ============================================================ */

#faqs { background: var(--c-bg); }

/* Optional count display */
.faq-count {
  text-align: center;
  font-size: 0.82rem;
  color: var(--c-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: var(--s-4);
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.faq-item {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Hover state on closed items — subtle bg shift */
.faq-item:not(.is-open):hover {
  background: var(--c-card);
  border-color: var(--c-blue-light);
}
.faq-item.is-open {
  border-color: var(--c-blue);
  box-shadow: var(--shadow-sm);
}

/* ---- Question button ----
   Inline-friendly layout: the question text (including any inline tokens
   like <span data-year-token="CURRENT_YEAR">2027</span>) flows as natural
   text wrapped to width. The chevron is absolutely positioned in the
   right padding so it doesn't disrupt the text flow.

   This used to be `display: flex` with `justify-content: space-between`,
   which made flex equally distribute whitespace between EVERY child node —
   so a question with an inline span ended up with huge gaps between the
   words ("You're booked till      2027      . Is it really worth waiting?").
   The `display: block` + absolute chevron layout keeps the question
   reading like normal sentence text regardless of how many inline spans
   or year tokens are in it.
   ---- */
.faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: var(--s-4);
  padding-right: calc(var(--s-4) + 32px); /* room for the chevron on the right */
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--c-ink);
  cursor: pointer;
  transition: color 0.15s ease;
  border-radius: var(--radius);
  position: relative;
}
.faq-q .faq-chevron {
  position: absolute;
  top: 50%;
  right: var(--s-4);
  transform: translateY(-50%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Override the existing chevron transform when the FAQ is open — the
   parent rule below handles open-state, but absolute positioning means
   we need to re-apply translateY together with the rotate. */
.faq-item.is-open .faq-q .faq-chevron {
  transform: translateY(-50%) rotate(180deg);
}
.faq-q:focus-visible {
  outline: 3px solid var(--c-blue);
  outline-offset: -2px;
}
.faq-item.is-open .faq-q {
  color: var(--c-blue);
}

/* ---- Animated chevron (replaces + / − swap) ---- */
/* The chevron SVG is injected by faqs.js and rotates 180° when open.
   Rotation is like flipping a lid open — intuitive directional cue. */
.faq-chevron {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--c-blue);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
}
.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .faq-chevron { transition: none; }
}

/* ---- Answer panel — smooth height transition ---- */
/* max-height trick: we animate from 0 to a large ceiling value.
   The actual content height determines when it stops growing — just
   like a spring-loaded lid. Smoother than the instant snap of display:none. */
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 var(--s-4);
  color: var(--c-muted);
}
.faq-item.is-open .faq-a {
  /* Generous ceiling — tall enough for any realistic answer */
  max-height: 600px;
  padding-bottom: var(--s-4);
}
.faq-a p { margin: 0; line-height: 1.7; }
.faq-a p + p { margin-top: var(--s-2); }

@media (prefers-reduced-motion: reduce) {
  .faq-a { transition: none; }
}
