/* ————— e-book chrome for session notes —————
   The site chrome (navbar, sidebar, TOC) stays in the house sans/mono;
   the reading column becomes a typeset book page. Two serifs are offered —
   Latin Modern Roman (default; matches the KaTeX math and the PDF) and
   Palatino — switched by the reader via the type toggle, which stamps
   data-notes-font on <html>. */

@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/lmroman10-regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/lmroman10-bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/lmroman10-italic.otf") format("opentype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/lmroman10-bolditalic.otf") format("opentype");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  --notes-serif: "Latin Modern Roman", "Computer Modern", Georgia, serif;
}
:root[data-notes-font="palatino"] {
  --notes-serif: "Palatino", "Palatino Linotype", "Book Antiqua", "URW Palladio L", "P052", Georgia, serif;
}

/* the type toggle, rendered under the title block */
.notes-font-toggle {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 0.72rem;
  color: var(--graphite, #575b64);
  margin-top: 0.9rem;
}
.notes-font-toggle .lab { letter-spacing: 0.1em; text-transform: uppercase; }
.notes-font-toggle button {
  font: inherit;
  background: none;
  border: 1px solid var(--hairline, #e7e8eb);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  color: var(--graphite, #575b64);
  cursor: pointer;
}
.notes-font-toggle button[aria-pressed="true"] {
  border-color: var(--accent, #002fa7);
  color: var(--accent, #002fa7);
}

main.content,
#title-block-header {
  font-family: var(--notes-serif, Georgia, serif);
}

main.content {
  font-size: 1.16rem;
  line-height: 1.72;
  max-width: 46rem;
}

main.content p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

main.content :is(h1, h2, h3, h4) {
  font-family: var(--notes-serif, Georgia, serif);
  font-weight: 600;
  letter-spacing: 0;
}

main.content h2 {
  margin-top: 2.6rem;
  border-bottom: none;
}

main.content h3 {
  margin-top: 1.9rem;
  font-style: italic;
  font-weight: 500;
}

#title-block-header .title {
  font-size: 2.3rem;
  letter-spacing: 0;
  line-height: 1.15;
}

/* section numbers in the accent, like a well-kept book */
main.content .header-section-number {
  color: var(--accent, #002fa7);
  margin-right: 0.55rem;
  font-weight: 500;
}

/* block furniture */
main.content blockquote {
  font-style: italic;
  border-left: 2px solid var(--accent, #002fa7);
}

main.content .callout {
  font-size: 1.02rem;
}

/* wide display math scrolls inside its own box, never under the sidebar */
main.content .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0;
}

/* code and tables stay in the utility faces — they are apparatus, not prose */
main.content :is(code, pre, .sourceCode) {
  font-size: 0.88em;
}

main.content table {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.88rem;
}

/* exercises: numbered like a textbook */
main.content .exercise {
  margin: 1.1rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--hairline, #e7e8eb);
}
