/*
 * course.css — shared stylesheet for the LLM Post-Training teaching workspace.
 * Tufte-inspired: generous margins, readable serif body, restrained palette.
 * Linked by every lesson so the course looks like one consistent whole.
 * Designed to print cleanly (see @media print at the bottom).
 */

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --paper: #fdfcf9;
  --rule: #e3ddd0;
  --accent: #7a4b2b;      /* warm brown, for links & marks */
  --accent-soft: #f3ece2;
  --good: #2f6b43;
  --good-bg: #eaf3ec;
  --bad: #9a3434;
  --bad-bg: #f6ebeb;
  --maxw: 42rem;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 4rem 1.5rem 6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Masthead ---- */
.eyebrow {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.subtitle {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
}
.masthead { border-bottom: 1px solid var(--rule); padding-bottom: 1.4rem; margin-bottom: 2rem; }

/* ---- Typography ---- */
h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.6rem 0 0.6rem;
  letter-spacing: -0.01em;
}
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.8rem 0 0.4rem; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(122,75,43,0.3); }
a:hover { border-bottom-color: var(--accent); }

mark { background: var(--accent-soft); color: var(--ink); padding: 0 0.15em; border-radius: 2px; }

/* ---- The pipeline diagram ---- */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1.8rem 0;
}
.stage {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  background: #fff;
}
.stage .tag {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.stage .name { font-weight: 600; font-size: 1.05rem; }
.stage .gives { color: var(--ink-soft); font-size: 0.95rem; font-style: italic; }
.stage.post { border-left-color: var(--good); }
.arrow { text-align: center; color: var(--ink-soft); font-size: 1.1rem; line-height: 1; }

/* ---- Callouts ---- */
.callout {
  border: 1px solid var(--rule);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.6rem 0;
  font-size: 0.97rem;
}
.callout .label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); display: block; margin-bottom: 0.3rem; font-weight: 700;
}
.analogy { background: #eef2f5; }
.analogy .label { color: #335; }

/* ---- Margin notes / citations ---- */
.cite { font-size: 0.82rem; color: var(--ink-soft); }
sup.ref a { font-size: 0.7rem; border: none; }
.sources { font-size: 0.85rem; color: var(--ink-soft); border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1rem; }
.sources li { margin-bottom: 0.4rem; }

/* ---- Quiz widget (paired with quiz.js) ---- */
.quiz { border: 1px solid var(--rule); border-radius: 8px; padding: 1.2rem 1.3rem; margin: 1.6rem 0; background: #fff; }
.quiz h3 { margin-top: 0; }
.q { margin: 1.1rem 0; }
.q .stem { font-weight: 600; margin-bottom: 0.5rem; }
.q .opts { display: flex; flex-direction: column; gap: 0.4rem; }
.q button.opt {
  text-align: left; font: inherit; cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.55rem 0.8rem; transition: background 0.12s, border-color 0.12s;
}
.q button.opt:hover:not(:disabled) { background: var(--accent-soft); }
.q button.opt:disabled { cursor: default; opacity: 0.95; }
.q button.opt.correct { background: var(--good-bg); border-color: var(--good); color: var(--good); font-weight: 600; }
.q button.opt.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.q .feedback { margin-top: 0.55rem; font-size: 0.92rem; display: none; }
.q .feedback.show { display: block; }
.q .feedback .why { color: var(--ink-soft); }

/* ---- Footer nav ---- */
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; font-size: 0.9rem; }
.ask {
  background: var(--good-bg); border: 1px solid var(--good); border-radius: 6px;
  padding: 0.9rem 1.1rem; margin: 2rem 0 0; font-size: 0.95rem;
}
.ask .label { color: var(--good); font-weight: 700; }

/* ---- Print ---- */
@media print {
  html { font-size: 12pt; }
  body { max-width: none; padding: 0; background: #fff; }
  .quiz button.opt { border: 1px solid #ccc; }
  a { color: var(--ink); border: none; }
  .ask, .lesson-nav { break-inside: avoid; }
}
