/* Light, single-column reading theme for the LaTeXML Gray Paper render.
   Loaded after LaTeXML's default CSS so these rules win. */

:root { color-scheme: light; }

html, body {
  background: #ffffff;
  color: #1b1b1b;
}

/* Body text — Computer Modern if installed, else STIX Two Text (PDF-like serif). */
.ltx_page_main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 8rem;
  font-family: "Latin Modern Roman", "CMU Serif", "STIX Two Text", Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  text-align: left;
}

/* ---- Fixed sidebar table of contents (injected by toc.py) ---- */
body { padding-left: 17rem; transition: padding-left .18s ease; }  /* room for nav */
#gp-toc {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 17rem;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 1rem 0.75rem 2rem;
  background: #f7f7f5;
  border-right: 1px solid #e2e2dd;
  font-family: "STIX Two Text", Georgia, serif;
  font-size: 13px;
  line-height: 1.35;
  transition: transform .18s ease;
}
#gp-toc .gp-toc-head {
  font-weight: 700; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: #888;
  margin: 0 0 .5rem 2.2rem;          /* clear the toggle button */
}

/* Version selector at the top of the sidebar */
#gp-version { margin: .1rem 0 1rem 2.2rem; display: flex; align-items: center; gap: .4rem; }
#gp-version .gp-version-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #999; }
#gp-version select {
  font: inherit; font-size: 12px; padding: 1px 4px;
  border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #333; cursor: pointer;
}

/* Collapse toggle — always visible at top-left */
#gp-toc-toggle {
  position: fixed; top: .5rem; left: .5rem; z-index: 1000;
  width: 1.9rem; height: 1.9rem; padding: 0;
  border: 1px solid #e2e2dd; border-radius: 6px;
  background: #f7f7f5; color: #555; cursor: pointer;
  font-size: 15px; line-height: 1;
}
#gp-toc-toggle:hover { background: #e8e8e2; color: #1a5fb4; }
body.gp-toc-collapsed { padding-left: 0; }
body.gp-toc-collapsed #gp-toc { transform: translateX(-100%); }
#gp-toc a { display: block; text-decoration: none; color: #333; border-radius: 4px; padding: 2px 6px; }
#gp-toc a:hover { background: #e8e8e2; color: #1a5fb4; }
#gp-toc a:target, #gp-toc a.gp-active { background: #e3ebf7; color: #1a5fb4; }
#gp-toc .gp-toc-l1 { font-weight: 600; margin-top: .5rem; color: #1b1b1b; }
#gp-toc .gp-toc-l2 { padding-left: 1.1rem; color: #444; }
#gp-toc .gp-toc-l3 { padding-left: 2rem; color: #777; font-size: 12px; }

/* Narrow screens: let the TOC scroll inline above the content. */
@media (max-width: 1000px) {
  body { padding-left: 0; }
  #gp-toc { position: static; width: auto; height: auto; bottom: auto;
            border-right: none; border-bottom: 1px solid #e2e2dd; max-height: 40vh; }
  #gp-toc .gp-toc-head { margin-left: 2.2rem; }
  body.gp-toc-collapsed #gp-toc { display: none; }
}

/* Math uses a real math font with full glyph coverage. */
math, .ltx_Math {
  font-family: "Latin Modern Math", "STIX Two Math", math, serif;
  font-size: 1.02em;
}
/* Override the dark mathcolor/mathbackground attributes LaTeXML baked onto
   every MathML token (from the GP's \color{white}/\pagecolor dark theme). */
math, math * {
  background: transparent !important;
  background-color: transparent !important;
  color: #1b1b1b !important;
}

/* Title block */
.ltx_title_document { font-size: 2rem; line-height: 1.2; margin-bottom: .25rem; }
.ltx_author, .ltx_date, .ltx_personname { color: #444; }

/* Headings */
.ltx_title_section    { font-size: 1.5rem;  font-weight: 700; margin: 2.4rem 0 .8rem; line-height: 1.25; }
.ltx_title_subsection { font-size: 1.2rem;  font-weight: 700; margin: 1.8rem 0 .6rem; }
.ltx_title_subsubsection { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .5rem; }

/* Paragraphs: first-line indent separation (no vertical gaps), matching the PDF.
   LaTeXML already indents non-leading paragraphs and leaves the first after a
   heading flush; a uniform bottom margin made that look inconsistent (the run-in
   first paragraph is inline, so its gap didn't apply). */
.ltx_p { margin: 0; }

/* Inline code / URLs: counteract the browser's oversized generic monospace and
   use a proper mono stack. */
.ltx_font_typewriter, .ltx_url, .ltx_verbatim {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

/* Equations: room to breathe, scroll if a wide one overflows the column */
.ltx_equation, .ltx_eqn_table, .ltx_eqnarray { margin: 1rem 0; }
.ltx_equationgroup, table.ltx_equation { overflow-x: auto; display: block; }
.ltx_eqn_eqno { color: #888; }

/* Links / cross-refs */
a, .ltx_ref { color: #1a5fb4; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Tables (PVM etc.) */
.ltx_tabular { border-collapse: collapse; margin: 1rem 0; font-size: .95em; }
.ltx_tabular td, .ltx_tabular th { padding: .25rem .5rem; vertical-align: top; }
.ltx_tabular .ltx_border_t, .ltx_tabular .ltx_border_b { border-color: #ccc; }

/* Defensive: if any dark inline style survived a stale build, neutralize it. */
[style*="#262626"] { background-color: transparent !important; }
[style*="background-color:#262626"] { background-color: #fff !important; }
[style*="#FFFFFF"] { color: inherit !important; }
