/* FAQ page. Builds on site.css; the page is generated by tools/build_faq.py from content/faq.html.
   A two-level accordion of native <details> (keyboard and screen readers for free): one category open at a
   time, and inside it one question at a time (the `name` attribute, assets/faq.js as fallback). */

.faq-hero { position: relative; padding: calc(var(--nav-h) + clamp(48px, 8vw, 96px)) 0 clamp(28px, 4vw, 48px); overflow: clip; }
.faq-hero .hero-bg { opacity: .85; }
.faq-hero .wrap { position: relative; }
.faq-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 760; letter-spacing: -0.035em; margin: 14px 0 16px; max-width: 18ch; text-wrap: balance; }

.faq-list { display: grid; gap: 14px; max-width: 900px; padding-bottom: var(--sec-y); }
.faq-cat { border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: calc(var(--nav-h) + 16px); }
.faq-cat > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.faq-cat > summary::-webkit-details-marker { display: none; }
.faq-cat > summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 20px; }
.faq-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--green-ink); background: var(--green-soft); }
.faq-ic svg.ic { width: 22px; height: 22px; }
.faq-cat-name { flex: 1; min-width: 0; font-size: 1.2rem; font-weight: 720; letter-spacing: -0.01em; color: var(--text); }
.faq-count { font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.faq-chevron { color: var(--muted); transition: transform .2s ease; }
.faq-cat[open] > summary .faq-chevron { transform: rotate(180deg); }
.faq-cat > summary:hover .faq-cat-name { color: var(--green-ink); }

/* Questions are one level below the categories, and look it: a tinted, indented panel instead of white rows,
   smaller type, a round plus on the left instead of a chevron on the right; the open question lifts off the
   panel as a white card holding its answer. */
.faq-qs { display: grid; gap: 4px; padding: 10px 18px 16px 70px; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.faq-q { border-radius: 14px; border: 1px solid transparent; scroll-margin-top: calc(var(--nav-h) + 16px);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.faq-q > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; }
.faq-q > summary::-webkit-details-marker { display: none; }
.faq-q > summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.faq-q > summary:hover { background: color-mix(in srgb, var(--surface) 65%, transparent); }
.faq-q h3 { flex: 1; min-width: 0; font-size: 0.98rem; font-weight: 600; color: var(--text); text-wrap: pretty; }
.faq-plus { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); color: var(--muted); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.faq-plus svg.ic { width: 14px; height: 14px; stroke-width: 2.2; }
.faq-plus-v { transform-origin: 12px 12px; transition: transform .2s ease; }
.faq-q > summary:hover .faq-plus { border-color: var(--green); color: var(--green-ink); }
.faq-q[open] { background: var(--surface); border-color: var(--border); box-shadow: 0 6px 18px -12px color-mix(in srgb, var(--text) 35%, transparent); }
.faq-q[open] > summary:hover { background: none; }
.faq-q[open] h3 { color: var(--green-ink); }
.faq-q[open] .faq-plus { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.faq-q[open] .faq-plus-v { transform: scaleY(0); }
.faq-a { padding: 0 20px 18px 52px; color: var(--muted); font-size: 0.98rem; line-height: 1.65; }
.faq-a p + p, .faq-a ul, .faq-a ol { margin-top: 10px; }
.faq-a ul, .faq-a ol { padding-left: 1.3em; }
.faq-a b, .faq-a strong { color: var(--text); }
.faq-a code { font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }

/* Opening slides the content down where the browser can animate to height:auto; elsewhere it simply opens. */
@supports (interpolate-size: allow-keywords) {
  .faq-page { interpolate-size: allow-keywords; }
  .faq-cat::details-content, .faq-q::details-content { block-size: 0; overflow: clip;
    transition: block-size .28s ease, content-visibility .28s allow-discrete; }
  .faq-cat[open]::details-content, .faq-q[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-cat::details-content, .faq-q::details-content { transition: none; }
}

@media (max-width: 640px) {
  .faq-cat > summary { gap: 12px; padding: 16px; }
  .faq-ic { width: 38px; height: 38px; }
  .faq-count { display: none; }
  .faq-qs { padding: 8px 10px 12px; }
  .faq-q > summary { padding: 11px 10px; }
  .faq-a { padding: 0 14px 16px 48px; }
}

/* Troubleshooting is not a FAQ category: a problem with the app wants steps, not a short answer — so the page sends
   it to the handbook page instead of hiding it among the questions (Jonas, 12.10.2026). The box is the handbook
   sidebar's Troubleshooting row (.hb-trouble), not a paragraph of its own (Jonas, 19.10.2026). */
.faq-trouble { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--wait) 40%, var(--border)); background: color-mix(in srgb, var(--wait) 9%, var(--surface));
  color: var(--text); font-size: 0.9rem; line-height: 1.3; }
.faq-trouble:hover { text-decoration: none; border-color: var(--wait); }
.faq-trouble .ic { flex: 0 0 auto; width: 20px; height: 20px; color: color-mix(in srgb, var(--wait) 70%, var(--text)); }
.faq-trouble span { display: grid; color: var(--muted); }
.faq-trouble b { color: var(--text); font-weight: 650; }

/* The list and, beside it, the way out for problems: the column to the right of the accordions was empty,
   and a box there stays in view while someone scrolls through the questions (Jonas, 12.10.2026). On a narrow
   screen it goes back above the list. */
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.faq-layout .faq-list { max-width: none; }
.faq-side { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 1000px) {
  .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .faq-side { position: static; order: -1; }
  .faq-trouble { width: fit-content; }
}
