/* ============================================================
   Shared lesson stylesheet — "learn-cyber"
   Tufte-inspired: quiet, readable, prints well.
   Every lesson and reference doc links this file.
   ============================================================ */

:root {
  --ink:        #1a1a1a;
  --ink-soft:   #44423d;
  --paper:      #fffef9;
  --rule:       #d9d4c7;
  --accent:     #7a1f1f;   /* deep red — citations, links */
  --accent-2:   #1f4d7a;   /* deep blue — labels, headings accents */
  --good:       #1d6b3a;
  --bad:        #9a2a2a;
  --code-bg:    #f3f1e9;
  --note-bg:    #f6f4ec;
  --shadow:     rgba(40,36,28,0.08);
  --maxw:       42rem;
}

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: et-book, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Kicker / breadcrumb ---- */
.kicker {
  font-family: "Iowan Old Style", Georgia, serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent-2);
  margin: 0 0 0.5rem;
}

/* ---- Headings ---- */
h1 {
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}
h1 + .subtitle {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin: 0 0 2rem;
}
h2 {
  font-weight: 600;
  font-size: 1.35rem;
  margin: 2.6rem 0 0.6rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
}
h3 {
  font-weight: 600;
  font-size: 1.08rem;
  margin: 1.8rem 0 0.4rem;
}

p { margin: 0.9rem 0; }

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

strong { font-weight: 600; }

/* ---- Mission tie-in band ---- */
.mission {
  background: var(--note-bg);
  border-left: 3px solid var(--accent-2);
  padding: 0.8rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.97rem;
}
.mission .label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 600;
  margin-right: 0.4rem;
}

/* ---- Key idea callout ---- */
.key {
  background: #fbf6ee;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
  box-shadow: 0 1px 3px var(--shadow);
}
.key .label {
  display: block;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* ---- Sidenote / margin note ---- */
.note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: 0.9rem;
  margin: 1.1rem 0;
}

/* ---- Code & monospace ---- */
code, pre, kbd {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
}
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.4;
}
pre code { background: none; padding: 0; }

/* ---- Pipeline / step diagram ---- */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin: 1.6rem 0;
}
.pipeline .stage {
  flex: 1 1 7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.7rem 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px var(--shadow);
}
.pipeline .stage b { display: block; font-size: 0.92rem; margin-bottom: 0.2rem; color: var(--accent-2); }
.pipeline .arrow { align-self: center; color: var(--accent); font-size: 1.1rem; }

/* ---- Definition list (glossary) ---- */
dl.glossary dt {
  font-weight: 600;
  color: var(--accent-2);
  margin-top: 1.1rem;
}
dl.glossary dd { margin: 0.2rem 0 0; }
dl.glossary dd .also { color: var(--ink-soft); font-style: italic; font-size: 0.9rem; }

/* ---- Citations list ---- */
.sources { font-size: 0.9rem; }
.sources li { margin: 0.4rem 0; }

/* ---- Footer nav ---- */
.lesson-foot {
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.lesson-foot .ask {
  background: var(--note-bg);
  border: 1px dashed var(--accent-2);
  border-radius: 5px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
}
.lesson-foot .ask b { color: var(--accent-2); }

.primary-source {
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--good);
  padding: 0.8rem 1.1rem;
  margin: 1.6rem 0;
}
.primary-source .label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--good);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---- Print ---- */
@media print {
  body { max-width: none; padding: 0; font-size: 11pt; color: #000; }
  a { color: #000; border: none; }
  .quiz button, .lesson-foot .ask { box-shadow: none; }
  h2 { page-break-after: avoid; }
  .key, .pipeline, .primary-source { page-break-inside: avoid; }
}
