/* AV - Common questions (concept section 13-faq). Paper or paper, sunk.
   Heading left (sticky below the theme's fixed nav from 1024px), a native details accordion right.
   The indicator is a plus that turns into a minus when open (the native details element carries the state).
   Height animates only where ::details-content and interpolate-size exist; elsewhere it is instant.
   Tokens (--ink, --line, --forest, --t-ui and so on) come from va-kit.css through the section's data-surface. */

.va.va-faq .va-faq__grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
@media (min-width: 1024px) {
  .va.va-faq .va-faq__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  /* --nav-h is the fixed nav's real bottom edge, measured by va-core.js; 56px below it, as in the concept. */
  .va.va-faq .va-faq__head { grid-column: 1 / span 4; position: sticky; top: calc(var(--nav-h) + 56px); }
  .va.va-faq .va-faq__list { grid-column: 6 / span 7; }
}
/* The heading is sized by its own column too, so a long capitalised word ("Common", which Chrome never
   hyphenates) stays whole at large text sizes. The word is about 4.02em wide; 23cqi keeps it inside the
   column with room to spare, and default text never needs more than about 19.6cqi, so this only binds
   when a visitor enlarges text. In @supports, so without container units (Safari 15) the heading keeps
   the kit's size instead of failing to body size. */
.va.va-faq .va-faq__head { container-type: inline-size; }
.va.va-faq .va-faq__head .va-h2 { max-width: 8ch; }
@supports (width: 1cqi) { .va.va-faq .va-faq__head .va-h2 { font-size: min(var(--fs-display-l), 23cqi); } }

.va.va-faq .va-faq__list { border-top: 1px solid var(--line); }
.va.va-faq .va-faq__item { border-bottom: 1px solid var(--line); }

/* The 12px side padding gives the focus ring room off the number; the matching negative margin keeps
   the row's content where it was. */
.va.va-faq .va-faq__q {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px; align-items: center; column-gap: 16px;
  padding: 28px 12px; margin-inline: -12px; border-radius: 6px;
}
.va.va-faq .va-faq__q::-webkit-details-marker { display: none; }
.va.va-faq .va-faq__q::marker { content: ""; }
.va.va-faq .va-faq__n { align-self: start; padding-top: 0.42em; color: var(--ink-3); transition: color var(--t-ui) var(--ease-out); }
.va.va-faq .va-faq__t { color: var(--ink); margin: 0; text-wrap: balance; }

/* Closed: an outlined ring with a forest plus, 'there is more'.
   Open: the ring fills forest and the plus, now paper, becomes a minus: its upright bar turns flat onto
   the other. Reduced motion and ?static=1 swap it at once (va-kit.css cuts transitions there). */
.va.va-faq .va-faq__ind {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--forest) 30%, transparent);
  transition: box-shadow var(--t-micro) var(--ease-out), background-color var(--t-ui) var(--ease-out);
}
.va.va-faq .va-faq__ind i { position: relative; display: block; width: 14px; height: 14px; color: var(--forest); transition: color var(--t-ui) var(--ease-out); }
.va.va-faq .va-faq__ind i::before, .va.va-faq .va-faq__ind i::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 1px; background: currentColor;
}
.va.va-faq .va-faq__ind i::after { transform: rotate(90deg); transition: transform var(--t-ui) var(--ease-out); }
.va.va-faq .va-faq__item[open] .va-faq__ind { background: var(--forest); box-shadow: inset 0 0 0 1.5px var(--forest); }
.va.va-faq .va-faq__item[open] .va-faq__ind i { color: var(--paper); }
.va.va-faq .va-faq__item[open] .va-faq__ind i::after { transform: rotate(0deg); }
/* Hover only where there is a pointer that hovers, so a tap on a phone does not leave a hover ring behind. */
@media (hover: hover) {
  .va.va-faq .va-faq__q:hover .va-faq__ind { box-shadow: inset 0 0 0 1.5px var(--forest); }
  .va.va-faq .va-faq__item[open] .va-faq__q:hover .va-faq__ind { background: var(--forest-deep); box-shadow: inset 0 0 0 1.5px var(--forest-deep); }
}
/* The open item's number turns forest too, so the state reads from both ends of the row. */
.va.va-faq .va-faq__item[open] .va-faq__n { color: var(--forest); }

.va.va-faq .va-faq__a { padding: 0 56px 32px 60px; }
.va.va-faq .va-faq__a p { font-size: 1.125rem; line-height: 1.5; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; white-space: pre-line; }

/* Phones: a narrower number column; every summary stays at least 64px tall (44px is the minimum target). */
@media (max-width: 767px) {
  .va.va-faq .va-faq__q { grid-template-columns: 30px minmax(0, 1fr) 40px; column-gap: 12px; padding-block: 22px; min-height: 64px; }
  .va.va-faq .va-faq__a { padding: 0 0 26px 42px; }
  .va.va-faq .va-faq__a p { font-size: 1.0625rem; }
}

@supports (interpolate-size: allow-keywords) and selector(::details-content) {
  .va.va-faq .va-faq__list { interpolate-size: allow-keywords; }
  .va.va-faq .va-faq__item::details-content {
    block-size: 0; overflow: clip;
    transition: block-size var(--t-ui) var(--ease-out), content-visibility var(--t-ui) allow-discrete;
  }
  .va.va-faq .va-faq__item[open]::details-content { block-size: auto; }
  .va.va-faq .va-faq__a { opacity: 0; transition: opacity var(--t-ui) var(--ease-out); }
  .va.va-faq .va-faq__item[open] .va-faq__a { opacity: 1; }
}
/* Reduced motion and ?static=1: the answer opens at once (va-kit.css already stops transitions on
   ordinary elements in static mode, but ::details-content is a pseudo-element it does not reach). */
@media (prefers-reduced-motion: reduce) {
  .va.va-faq .va-faq__item::details-content { transition: none !important; }
}
html.va-static .va.va-faq .va-faq__item::details-content { transition: none !important; }

/* Windows high contrast: draw the indicator in system colours so the state still shows. */
@media (forced-colors: active) {
  .va.va-faq .va-faq__ind { forced-color-adjust: none; box-shadow: none; border: 2px solid CanvasText; background: Canvas; }
  .va.va-faq .va-faq__ind i { color: CanvasText; }
  .va.va-faq .va-faq__item[open] .va-faq__ind { background: CanvasText; box-shadow: none; }
  .va.va-faq .va-faq__item[open] .va-faq__ind i { color: Canvas; }
  .va.va-faq .va-faq__q:hover .va-faq__ind, .va.va-faq .va-faq__item[open] .va-faq__q:hover .va-faq__ind { box-shadow: none; }
}
