/* faq.css: FAQ (plan.md). A calm page that answers doubts in seconds: a still real photo framed across the column
   (two contractors reading their plans before a job) with a paper panel over its foot (the headline, the search, the
   topics); the questions by topic, each topic's name beside its questions; a framed navy close with the picker.
   Tokens only. */

/* ---------- hero: the photo framed under the header, cropped from its top so both faces and the plans in their
   hands read whole; the panel rises over the photo's foot, below the plans ---------- */
.fq-hero { position: relative; padding-top: calc(var(--header-top) + var(--header-h) + 16px); }
.fq-hero__frame { position: relative; overflow: hidden; isolation: isolate; height: clamp(250px, 26vw, 380px); border-radius: var(--radius-l); background: var(--c-brand); box-shadow: var(--shadow-m); }
.fq-hero__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 0%; }
.fq-hero__panel { position: relative; z-index: 2; box-sizing: border-box; width: min(100% - 48px, 1060px); margin: -40px auto 0; padding: clamp(26px, 2.8vw, 38px) clamp(22px, 4vw, 52px) clamp(22px, 2.2vw, 30px); display: grid; justify-items: center; gap: 14px; text-align: center; border-radius: var(--radius-l); background: var(--c-paper); border: 1px solid color-mix(in srgb, var(--c-line) 14%, transparent); box-shadow: var(--shadow-l); }
.fq-hero__h1 { font-size: clamp(2.1rem, 1.3rem + 2.4vw, 3.5rem); }
.fq-hero__lead { max-width: 40em; text-wrap: balance; }
/* the main button: the header holds it, so the panel shows its own only where the header's hides (400 px and less,
   row 121) */
.fq-hero__go { display: none; }

/* the search: one wide field, its glass at the left, its clear button at the right */
.fq-search { position: relative; width: 100%; max-width: 660px; margin-top: 6px; }
.fq-search__input { box-sizing: border-box; width: 100%; height: 60px; margin: 0; padding: 0 58px 0 56px; border-radius: var(--radius-pill); border: 1.5px solid color-mix(in srgb, var(--c-line) 34%, transparent); background: var(--c-paper-alt); color: var(--c-ink); font: 500 1.0625rem/1 var(--font-ui); -webkit-appearance: none; appearance: none; transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-med) var(--ease-out); }
.fq-search__input::placeholder { color: var(--c-ink-soft); opacity: 1; }
.fq-search__input::-webkit-search-cancel-button, .fq-search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.fq-search__input:hover { border-color: color-mix(in srgb, var(--c-line) 60%, transparent); }
.fq-search__input:focus { border-color: var(--c-ink); background: var(--c-paper); box-shadow: 0 10px 30px -14px rgba(8, 24, 49, 0.35); }
.fq-search__glyph { position: absolute; left: 21px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--c-ink); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.fq-search__clear { position: absolute; right: 11px; top: 50%; width: 38px; height: 38px; transform: translateY(-50%); display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--c-gray); color: var(--c-ink); cursor: pointer; transition: background-color var(--dur-fast); }
.fq-search__clear:hover { background: color-mix(in srgb, var(--c-line) 22%, var(--c-paper)); }
.fq-search__clear[hidden] { display: none; }
.fq-search__clear svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* the topics: pills with their counts; the one shown is navy with a gold count */
.fq-topics { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 2px; }
.fq-topic { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin: 0; padding: 0 7px 0 18px; border-radius: var(--radius-pill); border: 1px solid color-mix(in srgb, var(--c-line) 28%, transparent); background: var(--c-paper); color: var(--c-ink); font: var(--w-ui) var(--fs-ui)/1 var(--font-ui); cursor: pointer; transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.fq-topic:hover { border-color: var(--c-ink); }
.fq-topic__n { box-sizing: border-box; min-width: 30px; height: 30px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--c-gray); color: var(--c-ink); font: 650 var(--fs-micro)/1 var(--font-ui); font-variant-numeric: tabular-nums; transition: background-color var(--dur-fast), color var(--dur-fast); }
.fq-topic[aria-pressed="true"] { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand); }
.fq-topic[aria-pressed="true"] .fq-topic__n { background: var(--c-accent); color: var(--c-brand); }
.fq-topic[data-none]:not([aria-pressed="true"]) { color: var(--c-ink-soft); }
.fq-topic[data-none] .fq-topic__n { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-line) 30%, transparent); }

/* ---------- the questions: each topic's name beside its questions on wide screens, staying in view while they
   scroll ---------- */
.fq-list { padding-top: clamp(40px, 3.4vw, 52px); }
.fq-group:not([hidden]) { display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: 14px 64px; align-items: start; }
.fq-group + .fq-group { margin-top: clamp(48px, 5vw, 72px); }
.fq-group__title { position: sticky; top: calc(var(--header-top) + var(--header-h) + 28px); padding-top: 22px; font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.015em; font-weight: var(--w-head); }
.faq__q mark { padding: 0 2px; border-radius: 4px; background: var(--c-accent-tint); color: inherit; box-shadow: inset 0 -2px 0 var(--c-accent); }
.faq__a a { color: var(--c-ink); font-weight: var(--w-strong); text-underline-offset: 3px; }
.fq-empty:not([hidden]) { display: grid; justify-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 48px 28px; text-align: center; border-radius: var(--radius-l); background: var(--c-paper-alt); border: 1px solid color-mix(in srgb, var(--c-line) 12%, transparent); }
.fq-empty__title { font: var(--w-head) var(--fs-h3)/var(--lh-snug) var(--font-display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.fq-empty__line { color: var(--c-ink-soft); }
.fq-empty__act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 24px; margin-top: 8px; }
.fq-empty__act .btn[hidden] { display: none; }

/* ---------- close: a framed navy panel holding its own picture in a window at its left, a customer picking up his
   order at a busy local counter (the footage loops; its stop icon in the window's corner); the words, the way to
   Contact and the picker in its paper box beside it (step 12's rework, rows 119, 120) ---------- */
.fq-close { padding-top: 0; }
.fq-close__panel { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.9fr); gap: clamp(32px, 3.6vw, 52px); align-items: stretch; padding: 16px clamp(28px, 3.8vw, 56px) 16px 16px; border-radius: var(--radius-l); color: var(--c-on-brand); box-shadow: var(--shadow-l); background:
    radial-gradient(420px 300px at 82% 78%, color-mix(in srgb, var(--c-accent) 11%, transparent), transparent 72%),
    radial-gradient(620px 420px at 100% 0%, var(--c-navy-raise), transparent 72%), var(--c-brand); }
/* the window wide enough to hold the whole handover, from the colleague's face to the customer's beanie (row 132);
   its stop icon on the shelves at its top left, clear of every head (row 134) */
.fq-close__window { --pos: 68% 42%; position: relative; overflow: hidden; isolation: isolate; min-height: 440px; border-radius: calc(var(--radius-l) - 8px); background: var(--c-slate); }
.fq-close__window > .stop { top: 14px; left: 14px; right: auto; bottom: auto; }
.fq-close__side { display: grid; align-content: center; gap: 22px; padding-block: 12px; }
.fq-close__words { display: grid; justify-items: start; gap: 12px; }
.fq-close__words .h2 { font-size: clamp(1.9rem, 1.2rem + 1.5vw, 2.4rem); }
.fq-close__panel .section__line { color: var(--c-on-brand-soft); }
.fq-close__ask { margin-top: 4px; }
.fq-close__picker { width: 100%; }

@media (max-width: 1300px) {
  /* the window across the panel's top, the whole handover in it; the words and the picker side by side under it */
  .fq-close__panel { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 14px; }
  .fq-close__window { min-height: 0; aspect-ratio: 2 / 1; --pos: 60% 40%; }
  .fq-close__side { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: center; gap: 24px 40px; padding: 30px clamp(8px, 3vw, 28px) 16px; }
}
@media (max-width: 900px) {
  .fq-close__window { aspect-ratio: 16 / 9; }
  .fq-close__side { grid-template-columns: minmax(0, 1fr); }
  .fq-close__picker { max-width: 560px; }
}

@media (max-width: 900px) {
  .fq-group:not([hidden]) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .fq-group__title { position: static; padding-top: 0; }
}

@media (max-width: 600px) {
  /* on a phone the whole picture, both of them head to foot, and the panel across the column over its foot */
  .fq-hero { padding-top: calc(var(--header-top) + var(--header-h) + 10px); }
  .fq-hero__frame { height: 236px; }
  .fq-hero__img { object-position: 60% 0%; }
  .fq-hero__panel { width: calc(100% - 20px); margin-top: -28px; gap: 12px; }
  .fq-search__input { height: 54px; padding: 0 52px 0 48px; font-size: 1rem; }
  .fq-search__glyph { left: 17px; width: 20px; height: 20px; }
  .fq-search__clear { right: 8px; }
  /* the topics in one row that slides sideways under the thumb, out to the panel's edges, so the list starts right
     under them (row 122) */
  .fq-topics { flex-wrap: nowrap; justify-content: flex-start; gap: 6px; box-sizing: border-box; width: calc(100% + 44px); margin: -2px -22px; padding: 4px 22px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 22px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--c-ink) 16px, var(--c-ink) calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, transparent 0, var(--c-ink) 16px, var(--c-ink) calc(100% - 26px), transparent); }
  .fq-topics::-webkit-scrollbar { display: none; }
  .fq-topic { flex: none; scroll-snap-align: start; min-height: 42px; padding: 0 6px 0 14px; gap: 7px; }
  .fq-topic__n { min-width: 28px; height: 28px; }
  .fq-list { padding-top: 32px; }
  .fq-close__panel { padding: 10px; }
  .fq-close__window { aspect-ratio: 4 / 3; --pos: 66% 38%; }
  .fq-close__side { padding: 24px 8px 10px; }
  .fq-group__title, .fq-search { scroll-margin-top: calc(var(--header-top) + var(--header-h) + 12px); }
  .faq__a { padding-right: 8px; }
}

@media (max-width: 400px) {
  .fq-hero__go { display: inline-flex; justify-content: center; width: 100%; box-sizing: border-box; }
}
