/* knowledge-center/_kc.css — shared styles for Knowledge Center articles.
   Loaded by every article page. Keep this small — the goal is reading
   clarity, not visual flourish. Tokens snap to brand canon (Phase 0 #B).
   Design-tokens extraction (Item 11) DONE 2026-05-31: this stylesheet now
   *references* /tokens.css instead of hand-mirroring the palette, per the
   "Reference, don't duplicate" standing rule. The hex literals below are
   fallbacks only — they render if /tokens.css fails to load, and are the
   single remaining place a value is written, never the source of truth. */

@import url("/tokens.css");

:root {
  --ink: var(--ink-primary, #ECE3D0);   /* canonical: --ink-primary */
  --bg: var(--bg-paper, #211913);       /* canonical: --bg-paper */
  --line: var(--gray-300, #4A3D31);     /* canonical: --gray-300 (border) */
  --muted: var(--gray-700, #B8AC9A);    /* canonical: --gray-700 */
  --accent: var(--accent-gold, #E0B574);/* canonical: --accent-gold */
  --link: var(--accent-blue, #D8A45C);  /* canonical: --accent-blue */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
header.kc-header {
  background: var(--bg-slate, #1A130D);    /* canonical: --bg-slate */
  color: var(--ink-on-dark, #ECE3D0);      /* canonical: --ink-on-dark */
  padding: 16px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: center;
}
header.kc-header a { color: var(--ink-on-dark, #ECE3D0); text-decoration: none; }
header.kc-header .crumb { font-size: 13px; opacity: .75; }
/* KC-CTA (2026-06-15): above-the-fold in-page path to /quiz + /audit from every article page. */
header.kc-header .kc-cta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; }
header.kc-header .kc-cta a { font-weight: 600; }
header.kc-header .kc-cta a:hover { text-decoration: underline; }

main.kc-main { max-width: 760px; margin: 32px auto; padding: 0 22px; }
main.kc-main h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
main.kc-main h2 { font-size: 20px; margin: 28px 0 10px; }
main.kc-main h3 { font-size: 16px; margin: 20px 0 6px; }
main.kc-main p, main.kc-main li { font-size: 16px; }
main.kc-main .meta { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
/* Prose body links — without this, a raw <a> in article copy falls back to the
   UA default link blue (#0000EE ≈ 1.8:1 on espresso, fails WCAG AA). Brand brass
   --link (#D8A45C) clears ~7.7:1. Scoped to p/li so .card and .kc-back keep theirs. */
main.kc-main p a, main.kc-main li a { color: var(--link); text-decoration: underline; }
main.kc-main p a:hover, main.kc-main li a:hover { color: var(--accent); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card-grid a.card {
  display: block;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s;
}
.card-grid a.card:hover { border-color: var(--ink); }
.card-grid .card .h { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.card-grid .card .d { color: var(--muted); font-size: 14px; }

.callout {
  background: var(--bg-white);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 18px 0;
  border-radius: 4px;
}

footer.kc-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 0; }
footer.kc-footer a { color: var(--muted); }

a.kc-back { display: inline-block; margin-bottom: 12px; color: var(--link); text-decoration: none; font-size: 13px; }
a.kc-back:hover { text-decoration: underline; }

ul.kc-list { padding-left: 22px; }
ul.kc-list li { margin-bottom: 6px; }

/* Skip-link (WCAG 2.4.1) — first focusable element on the KC subpages, which
   use the stripped kc-header instead of the full site nav. Off-screen until
   focused, then drops into view. Mirrors the canonical site .skip-link. */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 200;
  padding: 0.5rem 1rem; border-radius: 0 0 8px 8px;
  background: var(--cta, #D8A45C); color: var(--cta-on, #211913);
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 0; }
