/* The site's FAQ accordion, shared by every page with questions (a list marked data-acc).
   Markup: <details><summary>Question<span class="acc-i"></span></summary><div class="acc"><div class="acc-in">answer</div></div></details>
   Without assets/faq.js the native <details> opens and closes as usual. The script adds .acc-live and drives .is-open, so the
   answer's height eases open (grid rows 0fr to 1fr, the one layout property animated on the site) and its text fades and rises
   in just after. Reduced motion: no .acc-live and no transitions, so it toggles at once. */
[data-acc]{ --acc-ease:cubic-bezier(.22,1,.36,1); }
.acc{ display:grid; grid-template-rows:1fr; }
.acc-in{ min-height:0; overflow:hidden; }

/* the question: a touch quieter while closed, full strength when hovered, focused or open; dimmer while pressed */
[data-acc] summary{ opacity:.78; transition:opacity .2s ease; }
[data-acc] details[open] > summary, [data-acc] summary:hover, [data-acc] summary:focus-visible{ opacity:1; }
[data-acc].acc-live details[open]:not(.is-open) > summary:not(:hover):not(:focus-visible){ opacity:.78; }
[data-acc] details > summary:active{ opacity:.55; }

/* the plus turns into a minus: the icon makes a half turn while its upright stroke lies down */
.acc-i{ transition:transform .45s var(--acc-ease); }
[data-acc].acc-live details.is-open .acc-i{ transform:rotate(180deg); }
[data-acc].acc-live details:not(.is-open) .acc-i::after{ transform:rotate(90deg); }
[data-acc].acc-live details.is-open .acc-i::after{ transform:rotate(0deg); }

/* the answer: height eases open over 380ms; its text fades in and rises 6px, starting 80ms later. On close it fades out quickly */
[data-acc].acc-live .acc{ grid-template-rows:0fr; transition:grid-template-rows .38s var(--acc-ease); }
[data-acc].acc-live details.is-open .acc{ grid-template-rows:1fr; }
[data-acc].acc-live .acc-in > *{ opacity:0; transform:translateY(6px); transition:opacity .16s ease, transform .2s ease; }
[data-acc].acc-live details.is-open .acc-in > *{ opacity:1; transform:none; transition:opacity .3s ease .08s, transform .38s var(--acc-ease) .08s; }

@media (prefers-reduced-motion:reduce){
  [data-acc] summary, [data-acc] .acc-i, [data-acc] .acc-i::before, [data-acc] .acc-i::after{ transition:none !important; }
}
