/* BoardVoice — shared polish layer.
 *
 * Loaded LAST in each public page's <head> so it wins same-specificity
 * battles against per-page inline <style> blocks (no !important needed
 * for single-class selectors). Targets the cross-page inconsistencies
 * found in the visual audit:
 *   - radius (some pages were 5px, 8px, 10px, 12px, 14px → unified 6px)
 *   - button padding (8/9/13 → 9px 20px standard, 7px 14px small)
 *   - card padding (20px 22px → 22px square)
 *   - logo-mark radius (5px → 6px)
 *   - form input focus glow (consistent gold halo)
 *   - typography hierarchy clamps
 *   - print mode hides language toggle
 *
 * Anything truly page-specific stays in the page's own <style>. This
 * file is the design-token contract, not a UI library. */

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn:focus-visible {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
}

/* ── Cards / surfaces ────────────────────────────────────────────── */
.card { border-radius: 6px; }
.feature, .ap-card, .search-card { border-radius: 6px; }
.logo-mark, .slm { border-radius: 6px; }

/* ── Nav / sidebar links ─────────────────────────────────────────── */
.nav-link, .sl, .sidebar-link {
  border-radius: 6px;
}

/* ── Form inputs — consistent paddings + focus halo ──────────────── */
.form-input, .form-select, .form-textarea,
.sub-input, input.search-input, .filter-input, .filter-select {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--border, #E2DDD4);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
  font-size: 14px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus,
.sub-input:focus, input.search-input:focus,
.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--gold, #C9A84C);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.12);
}

/* ── Typography hierarchy on hero sections ───────────────────────── */
.page-hero h1 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.2;
}
.page-hero .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* ── Stat tiles — consistent across pages ────────────────────────── */
.stat, .stat-mini {
  border-radius: 6px;
}

/* ── Pills / badges — slightly rounded for fluent feel ────────────── */
.status-pill, .vote-pill, .out-pill, .stat-pill, .badge {
  border-radius: 999px;
  font-feature-settings: 'tnum' 1;   /* tabular numerals in counts */
}

/* ── Tables — tighter, more uniform ──────────────────────────────── */
table.dt th, table.dt td {
  font-feature-settings: 'tnum' 1;
}

/* ── Visually-hidden text for screen readers (WCAG labels) ───────── */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ── Skip-to-content link (WCAG 2.4.1) ────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 10000;
  padding: 9px 16px;
  background: var(--navy, #1A2744);
  color: var(--gold, #C9A84C);
  font-weight: 700;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-decoration: none;
  border: 2px solid var(--gold, #C9A84C);
  border-radius: 6px;
  transition: top 0.15s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 8px;
  outline: none;
}

/* ── Focus-visible across every clickable non-button widget ───────── */
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
.cat-nav-item:focus-visible,
.ft:focus-visible,
.tab-btn:focus-visible,
.qa-row:focus-visible {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
}

/* ── Subscribe / CTA buttons feel ─────────────────────────────────── */
.sub-btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
}

/* ── Print: hide app chrome that doesn't belong on paper ─────────── */
@media print {
  #bv-lang-toggle { display: none !important; }
  .nav-toggle,
  .nav,
  .topbar,
  .header,
  footer { display: none !important; }
  body { background: #fff !important; }
}

/* ── Focus visibility (a11y) ──────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
}

/* ── Scrollbar polish on long admin lists / search results ─────────── */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ── Selection color matches brand ────────────────────────────────── */
::selection {
  background: rgba(201, 168, 76, 0.30);
  color: var(--navy, #1A2744);
}

/* ── Respect reduced-motion preference (WCAG 2.3.3 / vestibular a11y) ─
   Users who set "reduce motion" in their OS get near-instant transitions
   and no animation/auto-scroll. Loaded site-wide via bv-polish.css. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── A11y: darker gold for TEXT on light backgrounds (WCAG 1.4.3) ─────
   The brand gold #C9A84C on white is 2.28:1 — fails the 4.5:1 normal-
   text threshold. #856B00 on white is 5.12:1, comfortably passing,
   and notice.html was already using exactly that value as precedent.
   This file loads AFTER each page's inline <style>, so these rules
   win the cascade at equal specificity. Backgrounds, buttons, icons,
   and gold-on-dark contexts keep the original brand gold because they
   override `color` with their own values at higher specificity.

   IMPORTANT: do NOT add selectors here whose elements live on dark
   navy backgrounds (`.audit-proof`, `.sv-band`, `.sv-badge`, the hero).
   Darker gold on navy drops below 4.5:1 — the original #C9A84C on
   navy is the correct value there. */
:root { --gold-text: #856B00; }

/* Base anchors (light-background body links). Section-specific classes
   on dark backgrounds (.footer a, .sv-actions a, .topbar-nav a, etc.)
   override this via higher specificity and keep their own colors. */
a { color: var(--gold-text); }
a:hover { color: var(--gold-text); }

/* Small uppercase eyebrows / labels rendered on white sections only.
   `.audit-proof .section-eyebrow` and `.sv-badge .sv-eyebrow` are
   deliberately excluded — those live on navy backgrounds where the
   bright brand gold has plenty of contrast. */
.section-eyebrow,
.search-label,
.toc-num,
.article-eyebrow {
  color: var(--gold-text);
}

/* Inline strong accents in body copy on light surfaces only.
   `.ap-row strong` is excluded — it sits on the navy audit-proof
   band where the original gold already passes. */
.result-meta strong {
  color: var(--gold-text);
}

/* Placeholder text on LIGHT backgrounds. The shared --light token
   (#94A3B8) tests at 2.56:1 on white — fails 4.5:1. Upgrade these
   placeholders to --muted (#64748B, 4.77:1 on white) so the
   resident-facing search/signup boxes meet WCAG 1.4.3.
   Dark-bg placeholders (.subscribe-input, .sub-input on navy
   gradient hero cards) use white-at-opacity intentionally and are
   not affected here. */
.search-input::placeholder,
.form-input::placeholder {
  color: var(--muted, #64748B);
}
