/* FAQ explorer and topic pages (site-ginger). Built by site-ginger-build/build-faq.mjs.
   Hub: ten photographic topic tiles over one panel of whole answers, plus sitewide search.
   Topic pages: numbered question index with in-topic filter. Only selectors the generated
   markup actually uses live here. */

.faq-explorer { --sg-photo-h: 150px; padding-top: calc(var(--header-h) + 30px); padding-bottom: 24px; font-size: 16px; }
body:has(.faq-explorer) .site-header,
body:has(.faq-intro) .site-header { background: var(--cream); color: var(--ink); border-bottom-color: var(--line); }
body:has(.faq-explorer) .site-header :focus-visible,
body:has(.faq-intro) .site-header :focus-visible { outline-color: var(--ink); }
.faq-explorer h1, .faq-explorer h2, .faq-explorer p { margin: 0; }
.faq-explorer button, .faq-explorer input { font: inherit; color: inherit; }
.faq-explorer button, .faq-explorer summary { cursor: pointer; }
.faq-explorer button { border: 0; }

/* Intro row: statement left, search right. */
.faq-explorer .sg-intro { display: grid; grid-template-columns: 1fr 290px; gap: 28px; align-items: end; margin-bottom: 27px; }
.faq-explorer .sg-eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); margin-bottom: 10px; }
.faq-explorer h1 { font: 200 clamp(27px, 3.4vw, 38px)/1.17 var(--font-display); letter-spacing: .035em; text-transform: uppercase; margin-bottom: 12px; }
.faq-explorer .sg-lead { font-size: 15px; color: var(--ink-soft); font-weight: 300; max-width: 56ch; }
.faq-explorer .sg-search-hint { font-size: 12px; color: var(--ink-soft); display: block; margin-bottom: 9px; }
.faq-explorer .sg-search-input { position: relative; }
.faq-explorer input[type="search"] { width: 100%; padding: 12px 20px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 16px; }
.faq-explorer input::placeholder { color: var(--ink-soft); opacity: 1; }
.faq-explorer .sg-search-input:has(.sg-clear:not([hidden])) input { padding-right: 76px; }
.faq-explorer .sg-clear { position: absolute; right: 10px; top: 5px; bottom: 5px; min-width: 54px; background: transparent; border-radius: 999px; font-size: 13px; }
.faq-explorer .sg-clear:hover { background: var(--putty); }

/* Ten topic tiles: every topic gets a photograph, none repeats the home hero. */
.faq-explorer .sg-entries { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.faq-explorer .sg-entry { display: block; position: relative; min-width: 0; text-decoration: none; }
.faq-explorer .sg-image { display: block; height: var(--sg-photo-h); overflow: hidden; position: relative; }
.faq-explorer .sg-image img { height: 100%; width: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.faq-explorer .sg-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 18%, #14121040 45%, #141210d9 100%); }
.faq-explorer .sg-entry:hover img { transform: scale(1.025); }
.faq-explorer .sg-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 12px; color: var(--white); display: grid; gap: 3px; }
.faq-explorer .sg-caption strong { font: 300 15px/1.25 var(--font-display); letter-spacing: .06em; text-transform: uppercase; display: block; }
.faq-explorer .sg-count { font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.faq-explorer .sg-entry[aria-current="true"]::after { content: ""; height: 2px; background: var(--copper); position: absolute; bottom: -6px; left: 0; right: 0; }

/* Panel: one topic's whole question list, answers open in place. */
.faq-explorer .sg-panel { min-width: 0; max-width: 960px; }
.faq-explorer .sg-panel h2 { font: 300 clamp(20px, 2vw, 24px)/1.3 var(--font-display); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 7px; }
.faq-explorer .sg-panel h2:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.faq-explorer .sg-context { font-size: 14px; font-weight: 300; color: var(--ink-soft); margin-bottom: 17px; }
.faq-explorer .sg-questions { counter-reset: sg-question; }
.faq-explorer .sg-question { border-top: 1px solid var(--line); counter-increment: sg-question; }
.faq-explorer .sg-question summary { display: grid; grid-template-columns: 20px minmax(0, 1fr) 15px; gap: 12px; align-items: baseline; list-style: none; padding: 15px 0; font-size: 16px; line-height: 1.45; }
.faq-explorer .sg-question summary::-webkit-details-marker { display: none; }
.faq-explorer .sg-question summary::before { content: counter(sg-question, decimal-leading-zero); font-size: 12px; color: var(--copper); }
.faq-explorer .sg-question summary::after { content: "+"; font-size: 21px; text-align: right; font-weight: 300; }
.faq-explorer .sg-question[open] summary::after { content: "−"; }
.faq-explorer .sg-question summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.faq-explorer .sg-result-head { display: grid; gap: 4px; min-width: 0; }
.faq-explorer .sg-result-topic { font-size: 12px; color: var(--copper); text-transform: uppercase; letter-spacing: .07em; }
.faq-explorer .sg-answer { padding: 0 22px 19px 32px; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.faq-explorer .sg-answer p { margin: 0 0 12px; max-width: 70ch; }
.faq-explorer .sg-answer .answer-lead { color: var(--ink); font-size: 16px; font-weight: 400; }
.faq-explorer .sg-answer .answer-detail { font-size: 15px; }
.faq-explorer .sg-answer .answer-verify { border-left: 2px solid var(--copper); display: grid; font-size: 13px; gap: 4px; margin: 14px 0 0; padding-left: 12px; }
.faq-explorer .sg-answer .answer-verify strong { color: var(--copper); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.faq-explorer .sg-answer .answer-verify a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: .22em; }
.faq-explorer .sg-answer-link { margin: 4px 0 0; }
.faq-explorer .sg-answer-link .text-link { gap: .35em; padding-bottom: 0; }
.faq-explorer .sg-all { display: inline-flex; justify-content: center; align-items: center; gap: .5em; padding: 10px 21px; min-height: 42px; border: 1px solid var(--ink); border-radius: 999px; font-size: 12px; text-transform: uppercase; letter-spacing: .065em; text-decoration: none; margin-top: 16px; }
.faq-explorer .sg-all:hover { background: var(--ink); color: var(--cream); }
.faq-explorer .sg-search-results { margin-inline: 0; }

/* Notices, scope note, closing help row. */
.faq-explorer .sg-notice, .faq-explorer .sg-noscript { font-size: 15px; color: var(--ink-soft); margin: 0 0 24px; }
.faq-explorer .scope-note { margin-top: 32px; }
.faq-explorer .sg-help { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.faq-explorer .sg-help h2 { font-size: 20px; font-weight: 300; text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.faq-explorer .sg-help p { font-size: 15px; font-weight: 400; margin: 0; max-width: 60ch; }

/* Topic pages: carry the same typography through the reading layout. */
/* First-paint guard: the HTML ships every answer open for readers without JavaScript; with
   JavaScript (html[data-js] is set inline before paint) bodies stay hidden until answers.js
   has applied the collapsed index state and added .is-ready, so nothing snaps shut on load. */
html[data-js] .faq-topic-page .answer-block:not(.is-ready) [data-answer] > .answer-body { display: none; }
html[data-js] .faq-topic-page .answer-block:not(.is-ready) [data-answer] summary::after { content: "+"; }
.faq-topic-page .faq-intro h1 { text-transform: uppercase; font-weight: 200; letter-spacing: .035em; font-size: clamp(27px, 3.4vw, 38px); }
.faq-topic-page .faq-sidebar { padding: 0 22px 0 0; background: transparent; border-right: 1px solid var(--line); }
.faq-topic-page .faq-sidebar nav a { border-bottom: 0; font-size: 14px; font-weight: 300; }
.faq-topic-page .faq-sidebar nav a[aria-current] { font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }
.faq-topic-page .faq-reading .answer-filter input { border-radius: var(--pill); padding-inline: 18px; }
.faq-topic-page .faq-topic-switcher > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-topic-page .faq-topic-switcher > summary::-webkit-details-marker { display: none; }
.faq-topic-page .faq-topic-switcher > summary::after { content: "+"; font-size: 20px; font-weight: 300; line-height: 1; }
.faq-topic-page .faq-topic-switcher[open] > summary::after { content: "−"; }

@media (max-width: 1100px) {
  .faq-explorer .sg-entries { gap: 10px; }
  .faq-explorer .sg-image { height: 130px; }
  .faq-explorer .sg-caption strong { font-size: 13px; }
}
@media (max-width: 900px) {
  .faq-explorer .sg-intro { grid-template-columns: 1fr 250px; gap: 20px; }
  .faq-explorer .sg-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .faq-explorer .sg-image { height: 132px; }
  .faq-explorer .sg-image::after { background: linear-gradient(90deg, #141210a6, #14121015); }
  .faq-explorer .sg-caption { top: 0; align-content: center; padding: 12px 14px; }
  .faq-explorer .sg-caption strong { font-size: 15px; }
}
@media (max-width: 700px) {
  .faq-explorer .sg-intro { grid-template-columns: 1fr; }
  .faq-explorer .sg-entries { margin-bottom: 26px; }
  .faq-explorer .sg-image { height: 96px; }
  .faq-explorer .sg-answer { padding-left: 29px; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-explorer .sg-image img { transition: none; }
}
