/*
  module.css — remediated module stylesheet (MIT licensed, see LICENSE-CODE)

  PALETTE — every pair measured with the WCAG relative-luminance formula
  (scripts/verify-palette.mjs re-checks these on demand). All text pairs
  exceed 4.5:1; UI-component and focus-indicator pairs exceed 3:1.

  body text   #1f2a37 on #ffffff  14.54:1
  soft text   #444f60 on #ffffff   8.29:1
  headings    #7a1f2b on #ffffff  10.20:1
  links       #0b4f8a on #ffffff   8.40:1   (7.53:1 on tint #eef3f8)
  inverted    #ffffff on #7a1f2b  10.20:1
  muted       #55617a on #f2f4f7   5.64:1
  UI border   #5b6b7f vs #ffffff   5.45:1   (>= 3:1 required)
  focus ring  #b34700 vs #ffffff   5.50:1   (4.93:1 on tint; >= 3:1 required)
  success     #1e6b3a on #ffffff   6.52:1
  error       #a02020 on #ffffff   7.71:1
  table head  #ffffff on #33415c  10.24:1
  chart       #1f2a37 / #7a6a54 / #4a6d8c on white  14.54 / 5.23 / 5.44:1

  Layout is fluid (max-width + relative units); no horizontal scrolling at
  320 px. No animation is used, so prefers-reduced-motion is satisfied
  trivially (still declared for future additions).
*/

:root {
  --paper: #ffffff;
  --tint: #f7f2ee;
  --tint-cool: #eef3f8;
  --rule: #d8dde3;
  --ink: #1f2a37;
  --ink-soft: #444f60;
  --ink-muted: #55617a;
  --brand: #7a1f2b;
  --link: #0b4f8a;
  --ui-border: #5b6b7f;
  --focus: #b34700;
  --ok: #1e6b3a;
  --err: #a02020;
  --table-head: #33415c;
  --chart-1: #1f2a37;
  --chart-2: #7a6a54;
  --chart-3: #4a6d8c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;      /* 17 px, scales with user settings */
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
.wrap-wide { max-width: 60rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- skip link: first tab stop, visible on focus ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-family: Verdana, Arial, sans-serif;
  z-index: 10;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- global focus visibility ---------- */
a:focus, button:focus, input:focus, select:focus, summary:focus, video:focus, video:focus-within, [tabindex]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }
code { overflow-wrap: anywhere; }

/* ---------- header / nav / footer ---------- */
.site-header {
  border-bottom: 3px solid var(--brand);
  background: var(--paper);
  padding: 0.75rem 0;
}
.site-header p { margin: 0.2rem 0; }
.site-title {
  font-family: Verdana, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: bold;
}
.site-title a { color: var(--ink); text-decoration: none; }
.site-kicker {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-nav { font-family: Verdana, Arial, sans-serif; }
.site-nav ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.2rem;
  color: var(--link);
  text-decoration: underline;
  min-height: 24px;             /* target size >= 24 px (WCAG 2.5.8, exceeds 2.1) */
}
.site-nav a[aria-current="page"] {
  color: var(--brand);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 3px solid var(--brand);
}

.site-footer {
  border-top: 3px solid var(--rule);
  margin-top: 3rem;
  padding: 1.2rem 0 2rem;
  background: #f2f4f7;
  color: var(--ink-soft);
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.85rem;
}

/* ---------- content ---------- */
main { padding: 1.5rem 0 0; }

h1, h2, h3, h4 {
  font-family: Verdana, Arial, sans-serif;
  color: var(--brand);
  line-height: 1.25;
}
h1 { font-size: 1.7rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; color: var(--ink); }

a { color: var(--link); }
a.visited { color: var(--ink-soft); }

.lede { font-size: 1.15rem; color: var(--ink-soft); }

.meta {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.note {
  border-left: 4px solid var(--ui-border);
  background: var(--tint-cool);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.caption {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ---------- tables ---------- */
table.data {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}
table.data caption {
  text-align: left;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.4rem 0;
}
table.data th, table.data td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
table.data thead th {
  background: var(--table-head);
  color: #ffffff;
  font-family: Verdana, Arial, sans-serif;
}
table.data tbody th { background: var(--tint-cool); }
.table-scroll { overflow-x: auto; }

/* ---------- slides ---------- */
.slide {
  border: 1px solid var(--rule);
  border-top: 4px solid var(--brand);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper);
}
.slide h3 { margin-top: 0.25rem; }
.slide .speaker-note {
  background: var(--tint);
  padding: 0.6rem 0.9rem;
  margin-top: 0.8rem;
  font-size: 0.95rem;
}
.slide .speaker-note h4 {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.slide-no {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---------- quiz ---------- */
.quiz-q { border: 1px solid var(--rule); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.quiz-q legend {
  font-family: Verdana, Arial, sans-serif;
  font-weight: bold;
  color: var(--ink);
  padding: 0 0.3rem;
}
.choice { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.45rem 0; }
.choice input { margin-top: 0.35rem; }
.choice label { cursor: pointer; }
.feedback {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-left: 4px solid var(--ui-border);
  background: var(--tint-cool);
  display: none;
}
.feedback[data-state="correct"] { border-left-color: var(--ok); background: #eef6f0; }
.feedback[data-state="incorrect"] { border-left-color: var(--err); background: #f9efef; }
.feedback .verdict { font-family: Verdana, Arial, sans-serif; font-weight: bold; }
.feedback[data-state="correct"] .verdict { color: var(--ok); }
.feedback[data-state="incorrect"] .verdict { color: var(--err); }
.quiz-actions { margin-top: 0.8rem; }
button.check {
  font-family: Verdana, Arial, sans-serif;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: var(--brand);
  color: #ffffff;
  border: 2px solid var(--brand);
  border-radius: 4px;
  cursor: pointer;
  min-height: 44px;             /* target size (WCAG 2.5.8, exceeds 2.1) */
}
button.check:hover { background: #5e161f; }
.quiz-score {
  font-family: Verdana, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: bold;
  padding: 0.75rem 1rem;
  background: var(--tint);
  border: 1px solid var(--rule);
}

/* ---------- video page ---------- */
.video-frame video { width: 100%; height: auto; background: #000; }
.chapters ol { line-height: 1.9; }

/* ---------- utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-inline { margin: 1rem 0; }
