/* Theory page: reading typography, typeset mathematics and paper-style figures.
   Headings, navigation and chips keep the site font (Inter); running text is set in Source Serif 4 (vendored,
   SIL Open Font License 1.1); formulas are typeset by KaTeX (vendored, MIT), loaded by theory-page.js. */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../vendor/fonts/source-serif-4-vietnamese-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../vendor/fonts/source-serif-4-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-display: swap; font-weight: 200 900;
  src: url(../vendor/fonts/source-serif-4-vietnamese-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-display: swap; font-weight: 200 900;
  src: url(../vendor/fonts/source-serif-4-latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.theoryPage { --read: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif; --measure: 46rem; }

/* ---------------------------------------------------------------- running text: one comfortable measure */
.theoryPage section > p, .theoryPage section > ul, .theoryPage section > ol, .theoryPage .th-more-body > p, .theoryPage .th-more-body > ul, .theoryPage .th-more-body > ol,
.theoryPage .th-read, .theoryPage > .note { font-family: var(--read); font-size: 18px; line-height: 1.68; max-width: var(--measure); color: #d5e0ea; font-optical-sizing: auto; }
.theoryPage section > p { margin: 0 0 14px; }
.theoryPage section li, .theoryPage .th-read li, .theoryPage .th-read p { font-family: var(--read); font-size: 18px; line-height: 1.6; color: #d5e0ea; }
.theoryPage section li { margin: 4px 0; }
.theoryPage section b, .theoryPage .th-read b { font-weight: 650; color: #fff; }
.sectionPage.theoryPage > h1 + p { font-family: var(--read); font-size: clamp(19px, 1.5vw, 22px); line-height: 1.5; max-width: 44rem; }
.theoryPage .th-more-body > p, .theoryPage .th-more-body li { font-size: 16.5px; line-height: 1.62; color: var(--text-2); }
.theoryPage > .note { overflow-wrap: anywhere; font-size: 15px; color: var(--muted); margin-top: 40px; }
.theoryPage a { text-decoration-thickness: 1px; }

/* headings stay in the site font; the section number hangs in the accent colour */
.sectionPage.theoryPage h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; color: #fff; margin: 64px 0 18px; max-width: 40rem; text-wrap: balance; }
.theoryPage .th-part { margin-top: 88px; }
.theoryPage .th-part-t { font-size: 24px; letter-spacing: -.01em; }
.sectionPage.theoryPage .th-part p { font-family: var(--read); font-size: 17px; max-width: var(--measure); }
.sectionPage.theoryPage .th-part + section h2 { margin-top: 36px; }
.theoryPage .th-read { padding: 6px 0 6px 20px; margin-bottom: 28px; }
.theoryPage .toc a { font-size: 13px; padding: 5px 12px; }
.theoryPage .toc-part { font-size: 13px; }
.theoryPage table.data { font-size: 15px; }
.theoryPage table.data td, .theoryPage table.data th { line-height: 1.5; }
.theoryPage .table-wrap { max-width: 60rem; }

/* ---------------------------------------------------------------- mathematics */
.theoryPage .formula { font-family: inherit; background: none; border: 0; border-left: 2px solid var(--border-strong); border-radius: 0; padding: 6px 0 6px 22px; margin: 20px 0; max-width: 60rem; overflow: visible; color: #f1f6fb; }
.theoryPage .fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 44px; }
.theoryPage .fx { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 0; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.theoryPage .fx:not([data-tex]) { font-size: 19px; color: #f1f6fb; }
.theoryPage .fx .katex-display { margin: 0; text-align: left; }
.theoryPage .fx .katex-display > .katex { text-align: left; white-space: nowrap; }
.theoryPage .formula .lbl { font-family: var(--read); font-size: 15px; line-height: 1.55; color: var(--text-2); margin-top: 10px; max-width: var(--measure); }
.theoryPage .th-more { margin-top: 22px; max-width: 62rem; background: #0b1c30; }
.theoryPage .th-more > summary { font-size: 14px; padding: 13px 18px; }
.theoryPage .th-more-body { padding: 10px 20px 18px; }
/* inline symbols written in HTML (D<sub>Q</sub>, γ⁰ …) read as mathematics inside the notes */
.theoryPage .lbl sub, .theoryPage .lbl sup, .theoryPage p sub, .theoryPage p sup { font-size: .72em; line-height: 0; }

/* ---------------------------------------------------------------- figures */
.theoryPage .diagram { background: none; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; padding: 26px 0 16px; margin: 28px 0; max-width: 54rem; }
.theoryPage .diagram figcaption { font-family: var(--read); font-size: 15px; line-height: 1.5; color: var(--text-2); margin-top: 16px; }
.theoryPage .fg-scroll { overflow-x: auto; }
.theoryPage .diagram svg { width: 100%; height: auto; display: block; }
.theoryPage .fg-scroll > svg { min-width: 520px; }
.fg-rule { stroke: #9db3c7; stroke-width: 1.4; stroke-linecap: round; fill: none; }
.fg-strong { stroke: #c9d6e2; stroke-width: 1.8; }
.fg-accent { stroke: var(--accent); stroke-width: 1.6; }
.fg-warm { stroke: #fbbf24; }
.fg-dash { stroke-dasharray: 5 4; }
.fg-faint { stroke: #5d7389; stroke-width: 1; }
.fg-link { stroke: #4b7096; stroke-width: 1.2; }
.fg-waterline { stroke: #56b4e9; stroke-width: 2; }
.fg-ground { fill: #9db3c714; }
.fg-water { fill: #56b4e92e; }
.fg-soil { fill: #c9a26b33; }
.fg-wall { fill: #8f9aa8; }
.fg-beam { fill: #22d3ee14; }
.fg-swath { fill: #fbbf24; }
.fg-sat { fill: var(--accent); }
.fg-panel { fill: #5d7389; }
.fg-box { fill: #10243a; stroke: #3a6187; stroke-width: 1.2; }
.fg-step { stroke: var(--accent); }
.fg-out { fill: var(--accent); }
.fg-t { font-family: var(--font); font-size: 12.5px; fill: #d5e0ea; }
.fg-out-t { fill: #04202b; font-weight: 600; }
.fg-warm-t { fill: #fbbf24; }
.fg-m { font-family: KaTeX_Math, 'Source Serif 4', 'Times New Roman', serif; font-style: italic; font-size: 19px; fill: #f1f6fb; }
.fg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.fg-cell svg { max-width: 300px; margin: 0 auto; }
.fg-cap { font-family: var(--font) !important; font-size: 13.5px !important; line-height: 1.4 !important; margin: 10px 0 0 !important; text-align: center; color: #d5e0ea; }
.fg-cap b { display: block; font-weight: 600; color: #f1f6fb; }
.fg-cap span { display: block; color: var(--muted); margin-top: 2px; }

@media (max-width: 720px) {
  .theoryPage section > p, .theoryPage section li, .theoryPage .th-read, .theoryPage .th-read li, .theoryPage .th-read p { font-size: 17px; }
  .sectionPage.theoryPage h2 { font-size: 25px; margin-top: 48px; }
  .theoryPage .fx:not([data-tex]) { font-size: 17px; }
  .theoryPage .formula { padding-left: 14px; }
  .fg-grid { grid-template-columns: 1fr; gap: 22px; }
  .theoryPage .th-more-body { padding: 8px 14px 14px; }
}
