/* ============================================================
   handbooks — web stylesheet
   the house style (conventions/house-style.md) applied to the
   department handbooks. one sheet, linked by every handbook in
   documents/handbooks/, so a style change here never touches the
   curriculum set or the rest of the repo.

   typed-memo character: Courier Prime does the structural work,
   Source Serif 4 carries the prose, white page, one oxblood accent.

   built june 2026, tracking house-style v1.
   ============================================================ */

:root {
  /* house tokens (conventions/house-style.md is source of truth) */
  --paper:        #FFFFFF;
  --canvas:       #F2F2F0;
  --ink:          #1B1C1E;
  --ink-soft:     #5E6166;
  --rule:         #E6E6E3;
  --accent:       #6E1F2A;   /* oxblood */
  --accent-tint:  #F7ECED;

  --serif: "Source Serif 4", Georgia, serif;
  --mono:  "Courier Prime", ui-monospace, "Courier New", monospace;

  --sidebar-w: 300px;
  --max-w:     1080px;
  --measure:   780px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-tint); }
a:hover { border-bottom-color: var(--accent); }

/* ── sidebar nav (table of contents) ── */
nav {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink);
  color: #fff;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  z-index: 100;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  padding-bottom: 0.85rem;
}
.nav-version {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  margin-top: 0.5rem;
  margin-bottom: 1.4rem;
}
nav a {
  display: block;
  font-family: var(--mono);
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  border: none;
  font-size: 0.83rem;
  line-height: 1.4;
  padding: 0.32rem 0;
  transition: color 0.15s;
}
nav a:hover { color: #fff; }
nav a .nav-num { color: var(--accent); font-weight: 700; margin-right: 0.5rem; }
.nav-sub {
  font-size: 0.77rem !important;
  color: rgba(255,255,255,0.55) !important;
  padding: 0.22rem 0 0.22rem 1.5rem !important;
}
.nav-sub:hover { color: #fff !important; }
.nav-sub2 {
  font-size: 0.73rem !important;
  color: rgba(255,255,255,0.45) !important;
  padding: 0.18rem 0 0.18rem 2.7rem !important;
}
.nav-sub2:hover { color: #fff !important; }
.nav-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.14);
  margin: 1.1rem 0 0.6rem;
}

/* ── main column ── */
main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  max-width: calc(var(--max-w) + var(--sidebar-w));
  padding: 4rem 4rem 6rem;
  background: var(--paper);
  min-height: 100vh;
}
.measure { max-width: var(--measure); }

/* ── record header (the routing slip) ── */
.page-header {
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1.5rem;
  margin-bottom: 2.75rem;
}
.institution {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.page-header h1 {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: lowercase;
  margin-bottom: 0.5rem;
}
.page-header .subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
}
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.meta-item strong { color: var(--ink); font-weight: 700; }

/* ── numbered sections ── */
main { counter-reset: sec; }
.hb-section { margin-bottom: 3rem; counter-increment: sec; }
.hb-section > h2 {
  font-family: var(--mono);
  font-size: 1.22rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--ink);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.hb-section > h2::before {
  content: counter(sec, decimal-leading-zero);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* front-matter sections carry no number */
.front { margin-bottom: 2.5rem; }
.front h2 {
  font-family: var(--mono);
  font-size: 1.22rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

/* subsection + minor headings, mono lowercase, no title case */
h3 {
  font-family: var(--mono);
  font-size: 1.08rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink);
  margin: 1.7rem 0 0.6rem;
}
h4 {
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 1.2rem 0 0.5rem;
}
h5 {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin: 1.1rem 0 0.4rem;
}

p { font-family: var(--serif); margin-bottom: 0.85rem; }
p:last-child { margin-bottom: 0; }
.lead { color: var(--ink-soft); }
strong { font-weight: 600; }

/* defined term: oxblood underline + mono gloss */
.term { border-bottom: 1.5px solid var(--accent); }
.gloss { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); }

/* ── plain bullet + numbered lists ── */
ul.b-list, ol.num-steps { list-style: none; margin: 0.7rem 0; }
ul.b-list > li {
  position: relative;
  padding: 0.32rem 0 0.32rem 1.2rem;
  font-family: var(--serif);
  line-height: 1.65;
}
ul.b-list > li::before {
  content: "";
  position: absolute; left: 0; top: 0.72em;
  width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
}
ol.num-steps { counter-reset: step; }
ol.num-steps > li {
  counter-increment: step;
  position: relative;
  padding: 0.4rem 0 0.4rem 2.3rem;
  font-family: var(--serif);
  line-height: 1.65;
}
ol.num-steps > li::before {
  content: counter(step) ".";
  position: absolute; left: 0; top: 0.4rem;
  font-family: var(--mono); font-weight: 700;
  color: var(--accent); font-size: 0.85rem;
}

/* ── course / requirement lists ── */
.course-list { list-style: none; margin: 0.7rem 0 1rem; }
.course-list li {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}
.course-list li:last-child { border-bottom: none; }
.cl-code {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  color: var(--accent); flex: 0 0 auto; min-width: 5.5rem;
}
.cl-title { font-family: var(--serif); flex: 1 1 auto; line-height: 1.45; }
.cl-desc {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: 0.9rem; color: var(--ink-soft);
  line-height: 1.5; margin-top: 0.3rem;
}
.cl-ge { font-family: var(--serif); font-style: italic; font-size: 0.85rem; color: var(--ink-soft); }
.cl-units {
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft);
  flex: 0 0 auto; text-align: right; white-space: nowrap; min-width: 4.5rem;
}
.cl-group {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  text-transform: lowercase; letter-spacing: 0.03em; color: var(--ink);
  margin: 1.2rem 0 0.3rem;
}

/* ── checklist ── */
.checklist { list-style: none; margin: 0.7rem 0; }
.checklist li {
  font-family: var(--serif);
  padding: 0.4rem 0 0.4rem 1.9rem;
  position: relative;
  line-height: 1.55;
  border-bottom: 1px solid var(--rule);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "\2610";
  position: absolute; left: 0; top: 0.28rem;
  font-family: var(--mono); color: var(--accent); font-size: 1.05rem;
}

/* ── contact blocks (facilities, offices) ── */
.contact {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1.15rem;
  margin: 0.8rem 0;
  background: var(--paper);
}
.contact h4 {
  font-family: var(--mono); font-size: 0.92rem; font-weight: 700;
  text-transform: lowercase; color: var(--ink); margin: 0 0 0.4rem;
}
.c-line { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7; overflow-wrap: anywhere; }
.c-line strong { color: var(--ink); font-weight: 700; }
.c-line a { border: none; }
.c-role { font-family: var(--serif); font-size: 0.9rem; color: var(--ink); margin-top: 0.25rem; }

/* ── note / policy block ── */
.policy-block {
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  padding: 0.95rem 1.2rem;
  margin: 1rem 0;
  font-family: var(--serif);
  line-height: 1.65;
}
.policy-block .policy-label {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: lowercase; color: var(--accent);
  display: block; margin-bottom: 0.4rem;
}
.policy-block p { margin-bottom: 0.5rem; }
.policy-block p:last-child { margin-bottom: 0; }

/* visible to-do marker for unresolved links */
.todo {
  font-family: var(--mono); font-size: 0.78rem;
  background: #fff6d6; border: 1px dashed #b8902a; color: #6b5410;
  padding: 0.05rem 0.4rem;
}

/* ── tables (house treatment) ── */
table.hb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--serif);
  font-size: 0.95rem;
  margin: 0.8rem 0 1rem;
}
.hb-table th {
  font-family: var(--mono); font-size: 0.84rem; font-weight: 700;
  text-transform: lowercase; color: var(--ink);
  text-align: left; padding: 0 0.7rem 0.55rem;
  border-bottom: 1.5px solid var(--accent);
}
.hb-table td {
  padding: 0.55rem 0.7rem; vertical-align: top;
  border-bottom: 1px solid var(--rule); line-height: 1.5;
}
.hb-table tr:last-child td { border-bottom: none; }
.hb-table td.col-code, .hb-table th.col-code {
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft);
}
.hb-table td.num, .hb-table th.num { text-align: right; font-family: var(--mono); font-size: 0.85rem; }
.hb-table tr.row-accent td {
  font-family: var(--mono); font-weight: 700; text-transform: lowercase;
  color: var(--accent); background: var(--accent-tint);
}

/* ── figures (jury diagrams) ── */
.hb-figure {
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.4rem 1.4rem 1rem;
}
.hb-figure svg { width: 100%; height: auto; display: block; }
.hb-figure figcaption {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em;
  color: var(--ink-soft); margin-top: 0.9rem; padding-top: 0.7rem;
  border-top: 1px solid var(--rule); line-height: 1.6;
}
.hb-figure figcaption strong { color: var(--accent); font-weight: 700; }

/* ── jury requirements by area ── */
/* one label size throughout; color carries the distinction, not size */
.jarea {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  padding: 0.55rem 0.85rem;
  margin: 2.2rem 0 1.1rem;
}
.jlevel {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--ink);
  margin: 1.5rem 0 0.5rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--rule);
}
.jlevel:first-of-type { border-top: none; padding-top: 0; margin-top: 0.6rem; }
.jtag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: 0.6rem;
}
.jlabel {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-soft);
  margin: 0.85rem 0 0.2rem;
}

/* ── capstone: set the recital and the lecture apart ── */
.capstone-type {
  margin: 0.6rem 0 1.6rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}
.capstone-type > h5 { margin-top: 0.2rem; color: var(--accent); }

/* ── body divider between parts ── */
hr.hb-rule {
  border: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: 2.8rem 0 1.6rem;
}

/* ── footer ── */
footer {
  margin-top: 3.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── responsive ── */
@media (max-width: 860px) {
  nav { display: none; }
  main { margin-left: 0; width: 100%; max-width: 100%; padding: 2.5rem 1.4rem 4rem; }
  .course-list li { flex-wrap: wrap; }
  .cl-units { min-width: 0; }
}

/* office contact popovers */
.office {
  color: var(--accent);
  border-bottom: 1px dotted var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.office:hover,
.office:focus-visible {
  background: var(--accent-tint);
}
.office-pop {
  position: absolute;
  z-index: 60;
  width: 300px;
  max-width: calc(100vw - 1.5rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 0.85rem 1rem 0.95rem;
}
.office-pop .contact {
  margin: 0;
  padding: 0;
  border: 0;
}
.office-pop h4 {
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
}

/* ------------------------------------------------------------------
   folded panels (details/summary): collapsible guideline sections.
   Courier Prime summary in the oxblood accent, serif body, flat chrome.
   ------------------------------------------------------------------ */
details.fold {
  border: 1px solid var(--rule);
  margin: 0.5rem 0;
  background: var(--paper);
}
details.fold > summary {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "+";
  width: 1ch;
  color: var(--accent);
  font-weight: 700;
}
details.fold[open] > summary::before { content: "\2212"; }
details.fold[open] > summary { border-bottom: 1px solid var(--rule); }
details.fold .fold-body { padding: 0.5rem 0.9rem 0.85rem; }
details.fold .fold-body > :first-child { margin-top: 0; }
details.fold .fold-body > :last-child { margin-bottom: 0; }
