/* ───────────────────────────────────────────────────────────────
   /faq — the searchable answer index.
   Loaded ONLY on /faq. Extends pl.css (.faq-item/.faq-q/.faq-a live there).
   ─────────────────────────────────────────────────────────────── */

/* ── Search band (sticks under the nav) ───────────────────────── */
.faq-search-band {
  position: sticky; top: var(--faq-stick, 92px); z-index: 40;
  /* Opaque, not translucent: 218 rows scroll under this band and a see-through
     background made the section headings look clipped. */
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px -18px rgba(5,5,5,0.30);
  padding: 20px 0 16px;
}
.faq-search {
  position: relative; display: flex; align-items: center;
  max-width: 860px; margin: 0 auto;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.faq-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(240,96,31,0.12);
}
.faq-search-ic {
  width: 20px; height: 20px; flex-shrink: 0;
  margin-left: 22px; color: var(--grey-text);
}
.faq-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: 0;
  font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--ink);
  padding: 18px 14px; letter-spacing: -0.01em;
}
.faq-search input::placeholder { color: var(--grey-text); opacity: .78; }
.faq-search input::-webkit-search-cancel-button { display: none; }
.faq-kbd {
  flex-shrink: 0; margin-right: 18px; padding: 3px 9px;
  font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--grey-text);
  border: 1px solid var(--border); border-radius: 6px; background: var(--off-white);
}
.faq-search:focus-within .faq-kbd { display: none; }
.faq-clear {
  flex-shrink: 0; margin-right: 14px; padding: 6px; border: 0; background: transparent;
  color: var(--grey-text); cursor: pointer; border-radius: 50%; line-height: 0;
}
.faq-clear svg { width: 18px; height: 18px; }
.faq-clear:hover { color: var(--ink); background: var(--off-white); }

/* ── Topic chips ──────────────────────────────────────────────── */
.faq-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 1000px; margin: 16px auto 0;
}
.faq-chip {
  border: 1px solid var(--border); background: var(--paper); cursor: pointer;
  border-radius: var(--radius-pill); padding: 8px 15px;
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--grey-text);
  letter-spacing: -0.01em; white-space: nowrap;
  /* these are the page's primary control on touch, so hold the 44px target */
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.faq-chip span { opacity: .55; font-variant-numeric: tabular-nums; margin-left: 3px; }
.faq-chip:hover { color: var(--ink); border-color: var(--grey-text); }
.faq-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.faq-chip.is-on span { opacity: .6; }
.faq-chip[hidden] { display: none; }

.faq-count {
  text-align: center; margin: 14px 0 0;
  font-size: 13px; color: var(--grey-text); letter-spacing: -0.01em;
}
.faq-count b { color: var(--ink); font-weight: 600; }

/* ── Groups ───────────────────────────────────────────────────── */
.faq-body { padding-top: 64px; }
.faq-group { margin-bottom: 72px; scroll-margin-top: 240px; }
.faq-group[hidden] { display: none; }
.faq-group-head {
  max-width: 880px; margin: 0 auto 24px; position: relative;
  padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.faq-group-head h2 {
  font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.03em;
  color: var(--ink); margin: 0 0 6px;
}
.faq-group-head p { font-size: 15px; color: var(--grey-text); margin: 0; max-width: 640px; }
.faq-group-n {
  position: absolute; right: 0; top: 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--grey-text); font-variant-numeric: tabular-nums;
}

/* ── Items ────────────────────────────────────────────────────── */
.faq-body .faq-list { max-width: 880px; margin: 0 auto; gap: 8px; }
.faq-body .faq-item { scroll-margin-top: 250px; }
.faq-body .faq-item[hidden] { display: none; }
.faq-h { margin: 0; font-size: inherit; font-weight: inherit; }
.faq-body .faq-q { cursor: pointer; line-height: 1.45; }
.faq-body .faq-q:hover { color: var(--accent); }
.faq-qt mark {
  background: rgba(240,96,31,0.20); color: inherit;
  border-radius: 3px; padding: 0 2px;
}
.faq-a-inner mark { background: rgba(240,96,31,0.18); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.faq-a-inner p { margin: 0; }

.faq-more {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--accent); text-decoration: none;
}
.faq-more span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.faq-more svg { width: 15px; height: 15px; transition: transform 200ms ease; }
.faq-more:hover svg { transform: translateX(3px); }

/* ── Empty state ──────────────────────────────────────────────── */
.faq-empty {
  max-width: 660px; margin: 0 auto 72px; text-align: center;
  padding: 48px 32px; border: 1px solid var(--border);
  border-radius: var(--radius-large); background: var(--off-white);
}
.faq-empty[hidden] { display: none; }
.faq-empty h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--ink); }
.faq-empty-sub { font-size: 15px; color: var(--grey-text); margin: 0 0 24px; }
.faq-empty-near { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; text-align: left; }
.faq-empty-near a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; background: var(--paper); border: 1px solid var(--border);
  border-radius: 12px; font-size: 14.5px; font-weight: 500; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.faq-empty-near a:hover { border-color: var(--accent); color: var(--accent); }
.faq-empty-near a::after { content: "→"; color: var(--accent); flex-shrink: 0; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .faq-search-band { top: var(--faq-stick, 74px); padding: 14px 0 12px; }
  .faq-search input { font-size: 16px; padding: 15px 10px; }
  .faq-search-ic { margin-left: 16px; }
  .faq-kbd { display: none; }
  .faq-chips {
    flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    padding: 2px 20px 4px; margin-inline: -20px; scrollbar-width: none;
  }
  .faq-chips::-webkit-scrollbar { display: none; }
  .faq-body { padding-top: 40px; }
  .faq-group { margin-bottom: 52px; }
  .faq-group-n { position: static; display: block; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-search, .faq-chip, .faq-more svg { transition: none; }
}
