/* faq.css — /faq/ only (theme-src/page-faq.hbs). The accordion stack is
   home.css's shared component: never fork it here. This sheet owns the search
   bar, the empty state and the anchor geometry. */

/* faq.js measures the bar height into this; fallback for the no-JS paint. */
.faq-page {
  --faq-bar-h: 5.5rem;
}

/* 1 · Most-asked row — cards: support.css (.fe-grid / .fe-card) */

/* 2 · Live search */

/* Sticky at --chrome-offset (screen.css) so it rises with the header; z-index
   under the mask (40) keeps content sliding under one opaque sheet. Ships
   `hidden`; faq.js unhides it. */
.faq-search-bar {
  position: sticky;
  top: var(--chrome-offset);
  z-index: 1;
  display: grid;
  gap: var(--space-sm);
  margin: var(--space-xs) 0 var(--space-md);
  padding: var(--space-sm) 0;
  background: var(--color-bg);
}


/* Soft edge so text slides under instead of being cut — .doc-head::after's
   device, in support.css. */
.faq-search-bar::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 1rem;
  background: linear-gradient(var(--color-bg), transparent);
  pointer-events: none;
}

/* Author `display` beats the UA's [hidden] rule — guard it explicitly. */
.faq-search-bar[hidden] {
  display: none;
}

.faq-search {
  --ring-color: var(--color-border);
  --ring-face: var(--color-card);
}

/* see DESIGN.md → Shapes · The ring surface. The input holds focus, so the frame
   answers :focus-within with screen.css's inset .ring:focus-visible ring; an
   outside outline would be clipped. */
.faq-search:focus-within {
  /* Re-point, never re-colour (DESIGN.md → focus); the custom offset keeps the
     ring inside the clipped frame. */
  --focus-color: currentColor;
  outline: var(--focus-w) solid var(--focus-color);
  outline-offset: calc(-1 * (var(--ring-w) + 2px));
}

.faq-search-face {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-left: var(--space-md);
}

.faq-search-icon {
  flex-shrink: 0;
  color: var(--color-muted);
}

.faq-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 var(--space-md) 0 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--color-heading);
  -webkit-appearance: none;
  appearance: none;
}

.faq-search-input:focus {
  outline: none;
}

.faq-search-input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

/* The caption role owns the type; the rules below own the box and the muted ink. */
.faq-count {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
}

.faq-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-md);
}

.faq-empty[hidden] {
  display: none;
}

.faq-empty p {
  margin: 0;
  color: var(--color-body);
}

.faq-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-card);
  font: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
  cursor: pointer;
}

.faq-clear:hover {
  background: var(--color-border);
}

.faq-clear:focus-visible {
  --focus-color: currentColor;
  outline: var(--focus-w) solid var(--focus-color);
  outline-offset: 2px;
}

/* Quiet while a query is active (faq.js sets .is-searching): the dot would
   chase headings the search has filtered out. */
.doc-toc-list.is-searching .doc-toc-dot {
  opacity: 0;
}

/* 3 · Category sections */

/* No rhythm here: `.doc-content h2` carries it (--space-2xl above, --space-md
   below) and it collapses out of a padding-less section, so every category lands
   on the site's beat. A second margin breaks it.
   See DESIGN.md → Layout · Section rhythm. */

/* 4 · Anchor geometry */

/* A question anchor (/faq/#q-…) is the shareable URL, so it clears the navbar
   (--chrome-offset) and the sticky bar (--faq-bar-h) — h2s too. Higher
   specificity than support.css's scroll margins. */
.faq-page .doc-content h2[id],
.faq-page .faq-item[id] {
  scroll-margin-top: calc(var(--chrome-offset) + var(--faq-bar-h, 5.5rem));
}


/* 5 · Closing block */

.faq-more-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.doc-content .faq-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* 6 · Related under a question */

/* Related links stay easy to tap; their ink and hover come from .link-text. */
.doc-content .faq-related {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-lg);
  margin: var(--space-md) 0 0;
  padding: 0;
  list-style: none;
}

.doc-content .faq-related .faq-related-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

