/* The web book. Loaded after LaTeXML's stylesheet. */
:root {
  --bg: #e7e8ea; --leaf: #ffffff; --ink: #15171b; --soft: #565d68; --accent: #1f2de6; --tint: #f0f1f4; --rule: #15171b;
  --face: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: "Schibsted", system-ui, sans-serif; --size: 1.1875rem;
}
:root.night { --bg: #0b0d0f; --leaf: #15181b; --ink: #e4e2dc; --soft: #a2a8b0; --accent: #9db4ff; --tint: #1f2428; --rule: #e4e2dc; }
body.book { font-family: var(--face); font-size: var(--size); line-height: 1.62; }
.book a { color: var(--accent); }
.book a.skip { color: var(--bg); }

.bookbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px 24px; padding: 10px 24px; background: var(--leaf); font-family: var(--ui); font-size: 0.9375rem; font-weight: 600; }
.bookbar a { color: var(--ink); text-decoration: none; padding: 8px 0; }
.bookbar a:hover { text-decoration: underline; }
.running { margin: 0 auto; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); font-weight: 500; }
.settings { display: flex; gap: 4px; }
.settings button { min-width: 40px; min-height: 40px; padding: 0 12px; background: var(--tint); font-weight: 600; }
.settings button[aria-pressed="true"] { background: var(--ink); color: var(--leaf); }
.bookbar .get { background: var(--accent); color: var(--leaf); padding: 9px 16px; }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(var(--read, 0)); transform-origin: left; }

.leaf { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 32px 16px 56px; gap: 24px; }
.leaf > article { width: min(100%, 54rem); background: var(--leaf); padding: clamp(24px, 7vw, 104px) clamp(20px, 7vw, 104px); margin: 0; }
.book .ltx_document { font-size: 1em; }
.book .ltx_title { font-family: var(--ui); letter-spacing: -0.025em; line-height: 1.12; color: var(--ink); }
.book .opening, .book .ltx_title_section, .book .ltx_title_appendix, .book .ltx_title_bibliography { font-family: var(--ui); font-size: clamp(2rem, 1.2rem + 2.4vw, 3.1rem) !important; font-weight: 800; margin: 0 0 1.4em; }
.book .ltx_title_section .ltx_tag, .book .ltx_title_appendix .ltx_tag { display: block; font-size: 0.5em; color: var(--accent); margin-bottom: 0.5em; letter-spacing: 0; }
.book .ltx_title_subsection { font-size: 1.4em; margin: 2.2em 0 0.7em; }
.book .ltx_title_subsubsection, .book .ltx_title_paragraph, .book .ltx_title_theorem { font-size: 1.05em; margin-top: 1.6em; }
.book .ltx_title_theorem, .book .ltx_runin { font-family: var(--face); letter-spacing: 0; }
.book .ltx_p { margin: 0 0 0.85em; text-align: left; hyphens: manual; }
.book .ltx_abstract { width: auto; margin: 0 0 2.5em; font-size: 1em; }
.book .ltx_abstract .ltx_title_abstract { font-size: 1.3em; text-align: left; }
.book .ltx_theorem { background: var(--tint); padding: 4px 24px 12px; margin: 1.6em 0; }
.book .ltx_font_typewriter { font-size: 0.9em; overflow-wrap: anywhere; }
.book .ltx_inline-block, .book .unscaled { max-width: 100%; }
.book math { font-family: "STIX Two Math", "Latin Modern Math", "Cambria Math", math; font-size: 1.04em; }
.scroll { max-width: 100%; overflow-x: auto; padding-block: 4px; }
/* Nothing inside the leaf may push the page wider than the screen. */
.book .ltx_item, .book .ltx_item > .ltx_para, .book .ltx_para, .book .ltx_theorem, .book .ltx_proof, .book .ltx_minipage { max-width: 100%; min-width: 0; }
.book .ltx_flex_figure { flex-wrap: wrap; }
.book .ltx_flex_cell { min-width: 0; max-width: 100%; }
.book table.ltx_tabular { margin-inline: auto; font-size: 0.86em; line-height: 1.4; }
.book figure { margin: 2.2em 0; }
.book .ltx_caption { font-family: var(--ui); font-size: 0.85em; line-height: 1.45; text-align: left; }
.book figure img { margin-inline: auto; height: auto; max-width: 100%; }
:root.night .book figure img { background: #fff; }
:root.night .book .ltx_text[class*="ltx_framed"] { border-color: var(--rule); }
.book .ltx_bibitem { margin-bottom: 0.8em; font-size: 0.92em; overflow-wrap: anywhere; }
.book :target { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.turn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 54rem); font-family: var(--ui); }
.turn a { display: grid; gap: 4px; padding: 20px 24px; background: var(--leaf); color: var(--ink); text-decoration: none; transition: translate 0.25s; }
.turn a:hover { translate: 0 -3px; }
.turn a[rel="next"] { grid-column: 2; text-align: right; }
.turn span { color: var(--soft); font-size: 0.875rem; }
.colophon { font-family: var(--ui); font-size: 0.875rem; color: var(--soft); text-align: center; }
.citebox { position: absolute; z-index: 30; width: min(420px, calc(100vw - 24px)); padding: 14px 16px; background: var(--ink); color: var(--leaf); font-family: var(--ui); font-size: 0.875rem; line-height: 1.45; box-shadow: 0 16px 40px rgb(0 0 0 / 0.25); }
.citebox .ltx_tag { display: block; font-weight: 700; }
.citebox a { color: inherit; }

/* Cover and contents */
.cover { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; align-items: start; }
.jacket { position: sticky; top: 61px; min-height: calc(100svh - 61px); display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 48px clamp(24px, 4vw, 72px); background: #1f2de6; color: #fff; font-family: var(--ui); }
.jacket h1 { font-size: clamp(2.6rem, 1rem + 3.8vw, 4.8rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.98; }
.sub { font-family: var(--face); font-size: 1.35em; line-height: 1.4; }
.by { font-weight: 700; margin-top: 24px; }
.date { font-size: 0.9375rem; }
.front { padding: clamp(28px, 5vw, 88px) clamp(20px, 5vw, 88px); background: var(--leaf); display: grid; gap: 32px; font-family: var(--ui); }
.front .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.front .actions a { display: inline-flex; align-items: center; min-height: 54px; padding: 0 24px; text-decoration: none; font-weight: 700; }
.front .primary { background: var(--ink); color: var(--leaf) !important; }
.front .second { background: var(--tint); color: var(--ink) !important; }
.also { font-size: 0.9375rem; color: var(--soft); }
.front h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.front ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.front li a { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 8px; align-items: baseline; padding: 12px 14px; background: var(--tint); color: var(--ink); text-decoration: none; transition: background-color 0.2s, color 0.2s; }
.front li a:hover { background: var(--accent); color: var(--leaf); }
.front li em { font-style: normal; font-weight: 600; line-height: 1.35; }
.front li span { font-size: 0.8125rem; white-space: nowrap; }
.note p { font-family: var(--face); font-size: 0.95em; max-width: 62ch; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .cover { grid-template-columns: minmax(0, 1fr); }
  .jacket { position: static; min-height: 0; }
  .running { display: none; }
  .bookbar { flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; position: static; }
  .settings { margin-left: auto; }
  .leaf { padding: 0 0 32px; }
  .turn { grid-template-columns: 1fr; padding-inline: 12px; }
  .turn a[rel="next"] { grid-column: 1; order: -1; }
  .book .ltx_theorem { padding-inline: 14px; }
  .book math:not([display="block"]) { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }
  .book .ltx_item > .ltx_tag + .ltx_para { display: block; }
}
@media print { .bookbar, .turn { display: none; } .leaf > article { width: 100%; padding: 0; } }
