/* FAQ (src\pages\faq.mjs): the header card (the words, the search and the topics on graphite, the owner's photo at its
   right), every question by topic, the close. Only the tokens of design\system.css. */

/* ---------- header: an inset graphite card, its words at the left on the measuring grid, the still photo at the right
   fading into the graphite ---------- */
.faq-hero { padding: var(--inset) var(--inset) 0; }
.faq-hero__card { position: relative; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); min-height: clamp(480px, 40vw, 580px); border-radius: var(--radius-l); overflow: hidden; background: var(--c-graphite); color: var(--c-on-ink); }
.faq-hero__words { position: relative; z-index: 2; display: grid; align-content: center; padding: clamp(2.25rem, 1.2rem + 4vw, 4.75rem); padding-right: clamp(1.5rem, 3vw, 3rem);
  background-image: linear-gradient(var(--c-ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--c-ink-line) 1px, transparent 1px); background-size: 56px 56px; }
.faq-hero__title { margin: 0; font-size: var(--fs-h1); color: var(--c-on-ink); text-wrap: balance; }
.faq-hero__line { margin: 0.8rem 0 0; color: var(--c-on-ink-soft); font-size: 1.125rem; }
.faq-search { position: relative; max-width: 31rem; margin-top: 1.7rem; }
.faq-search svg { position: absolute; left: 1.05rem; top: 50%; color: var(--c-brand); transform: translateY(-50%); pointer-events: none; }
.faq-search input { width: 100%; height: 58px; padding: 0 1.1rem 0 3.1rem; border-radius: var(--radius-m); border: 1px solid var(--c-glass-line); background: color-mix(in srgb, var(--c-paper) 8%, transparent); color: var(--c-on-ink); font: 400 1.0625rem/1 var(--font-ui); box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.faq-search input::placeholder { color: var(--c-on-ink-soft); opacity: 1; }
.faq-search input:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; border-color: transparent; }
.faq-count { display: inline-block; margin-top: 0.7rem; color: var(--c-brand-on-ink); font: 500 0.875rem/1.3 var(--font-mono); text-underline-offset: 4px; }
.faq-count[hidden] { display: none; }
.faq-topics { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 34rem; margin: 1.15rem 0 0; padding: 0; list-style: none; }
.faq-topics a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--c-glass-line); color: var(--c-on-ink); font: 500 0.9375rem/1 var(--font-ui); text-decoration: none; transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.faq-topics a:hover { border-color: var(--c-brand); color: var(--c-brand); }
.faq-topics a:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; }
.faq-hero__media { position: relative; min-height: 320px; overflow: hidden; }
.faq-hero__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 36% 30%; }
.faq-hero__media::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--c-graphite) 0%, transparent 22%); pointer-events: none; }

/* ---------- every question, by topic: each topic's name at the left, its questions at the right ---------- */
.faq-all { padding-block: clamp(1rem, 2vw, 2rem) var(--section-y); }
.faq-topic { padding-block: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); scroll-margin-top: calc(var(--inset) + 64px + 1rem); }
.faq-topic + .faq-topic { border-top: 1px solid var(--c-line); }
.faq-topic[hidden], .faq-all details.qa[hidden], .faq-none[hidden] { display: none; }
.faq-topic .faq__head { position: sticky; top: calc(var(--inset) + 64px + 1.5rem); }
.faq-topic .sec-title { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.1rem); }
.faq-none { margin: 2rem 0 0; padding: 1.25rem 1.5rem; border-radius: var(--radius-m); background: var(--c-paper-alt); font-size: 1.0625rem; }
.faq-all .qa p a, .faq-none a { color: var(--c-brand-text); font-weight: 600; text-underline-offset: 3px; }

/* ---------- close: the reply in glass over the floor at the photo's lower right, clear of the three faces ---------- */
.faq-close .close-band__clip { object-position: 40% 40%; }
.scene.faq-close__reply { right: 1.25rem; bottom: 1.25rem; width: min(330px, calc(100% - 2.5rem)); }

@media (max-width: 899px) {
  .faq-hero__card { grid-template-columns: 1fr; }
  .faq-hero__media { min-height: 0; aspect-ratio: 4 / 3; }
  .faq-hero__media::before { background: linear-gradient(180deg, var(--c-graphite) 0%, transparent 20%); }
  .faq-topic .faq__head { position: static; }
}
@media (max-width: 759px) {
  .faq-hero__words { padding: 2rem 1.35rem 1.75rem; }
  .faq-search input { height: 54px; }
  .faq-hero__photo { object-position: 42% 30%; }
  /* a square photo: the three faces stand in its upper half, the reply over the floor and the tool bag under them */
  .faq-close .close-band__media { aspect-ratio: 1 / 1; }
  .faq-close .close-band__clip { object-position: 75% 50%; }
  .scene.faq-close__reply { right: 0.9rem; bottom: 0.9rem; width: min(300px, calc(100% - 1.8rem)); }
}
