/* Shared stylesheet for Stat 110 lecture notes (Harvard Statistics 110, Blitzstein).
   Linked by every lecture-NN-*.html in this directory. Edit here to restyle all notes. */

:root {
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --bg: #fafaf8;
  --surface: #ffffff;
  --border: #e2e2e0;
  --accent: #2d5a9e;
  --accent-light: #eef3fb;
  --highlight: #fff8e6;
  --highlight-border: #e6c54f;
  --aside-bg: #f5f0eb;
  --aside-border: #c9b99a;
  --proof-bg: #f0f5f0;
  --proof-border: #7ba07b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

/* Header */
header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.source-info {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.source-info a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.source-info a:hover { border-bottom-color: var(--accent); }

/* Table of contents */
nav.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2.5rem;
}
nav.toc p {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
nav.toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0;
}
nav.toc li {
  counter-increment: toc;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
}
nav.toc li::before {
  content: counter(toc) ".";
  display: inline-block;
  width: 1.6em;
  color: var(--text-secondary);
  font-weight: 500;
}
nav.toc a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
nav.toc a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* Sections */
section { margin-bottom: 2.8rem; }

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
}
h4 {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}

p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 650; }
em { font-style: italic; }

ul, ol {
  margin-bottom: 0.9rem;
  padding-left: 1.4rem;
}
li { margin-bottom: 0.3rem; }
li:last-child { margin-bottom: 0; }

/* Callout boxes */
.callout {
  border-radius: 5px;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.callout-key {
  background: var(--highlight);
  border-left: 3.5px solid var(--highlight-border);
}
.callout-aside {
  background: var(--aside-bg);
  border-left: 3.5px solid var(--aside-border);
}
.callout-proof {
  background: var(--proof-bg);
  border-left: 3.5px solid var(--proof-border);
}

.callout-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Formula display blocks */
.formula {
  text-align: center;
  margin: 1.4rem 0;
  font-size: 1.15em;
}

/* Monospace diagram blocks (e.g., stars and bars, trees, tables) */
.diagram {
  font-family: 'Source Code Pro', monospace;
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  text-align: center;
  margin: 1rem 0;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.diagram .dot { color: var(--accent); font-weight: 500; }
.diagram .bar { color: #b35900; font-weight: 500; }
.diagram-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.3rem;
  letter-spacing: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
th {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }

/* Story proof / worked-example boxes */
.story-proof {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
}
.story-proof .identity {
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* Definition / axiom boxes */
.axiom {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--accent);
  border-radius: 0 5px 5px 0;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.axiom-title {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Index page: thematic units and lecture cards (index.html only) */
.unit-range {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: -0.4rem 0 0.6rem;
}
.lecture-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}
.lecture-list li { margin-bottom: 0.5rem; }
.lecture-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  transition: border-color 0.15s, background 0.15s;
}
.lecture-item:hover { border-color: var(--accent); background: var(--accent-light); }
.lec-num {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 2.4rem;
  text-align: right;
  flex-shrink: 0;
}
.lec-body { display: flex; flex-direction: column; }
.lec-title { font-weight: 600; line-height: 1.3; }
.lec-blurb {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.15rem;
}

/* Section dividers */
.section-divider {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--border);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 2rem 1rem 4rem; }
  header h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

/* Print */
@media print {
  body { font-size: 11pt; background: white; }
  .container { max-width: 100%; padding: 0; }
  nav.toc { break-inside: avoid; }
  section { break-inside: avoid; }
  .callout, .story-proof, .axiom { break-inside: avoid; }
}
