/* Shared lesson stylesheet — Tufte-inspired, print-friendly */

:root {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --paper: #faf8f5;
  --card: #ffffff;
  --accent: #0b3d2e;
  --accent-soft: #e6f0eb;
  --warn: #8a4b08;
  --warn-soft: #fdf0e0;
  --border: #e4dfd6;
  --correct: #0b5c3a;
  --wrong: #8b1e1e;
  --radius: 10px;
  --max: 42rem;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

header.lesson-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  max-width: 36em;
}

h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  font-family: var(--sans);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout.warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.grid-3 {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

@media (min-width: 720px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.card h3 {
  margin-top: 0;
  color: var(--accent);
}

.card p:last-child {
  margin-bottom: 0;
}

.card .role {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.25rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table.compare th,
table.compare td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

table.compare th {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f3f0ea;
  color: var(--muted);
}

table.compare tr:last-child td {
  border-bottom: none;
}

.cite {
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1rem;
}

.cite ol {
  padding-left: 1.1rem;
  margin: 0.5rem 0 0;
}

.cite li {
  margin-bottom: 0.35rem;
}

.quiz {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin: 1.25rem 0;
}

.quiz h3 {
  margin-top: 0;
}

.quiz .prompt {
  margin-bottom: 0.85rem;
}

.quiz .choices {
  display: grid;
  gap: 0.5rem;
}

.quiz button.choice {
  font: inherit;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quiz button.choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz button.choice:disabled {
  cursor: default;
  opacity: 0.95;
}

.quiz button.choice.correct {
  border-color: var(--correct);
  background: #e8f6ef;
}

.quiz button.choice.wrong {
  border-color: var(--wrong);
  background: #fceaea;
}

.quiz .feedback {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.action {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin: 1.5rem 0;
}

.action h2 {
  margin-top: 0;
  color: var(--accent);
}

.action ol {
  margin-bottom: 0.5rem;
}

.footer-note {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  .quiz button.choice {
    border: 1px solid #999;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
