/*
Theme Name: Vialog
Theme URI: https://vialog.org
Description: Evidence-ledger theme for Vialog. Page bodies are generated from
  content/articles.json by build.py and pushed over the REST API; this theme
  supplies the masthead, footer, typography, self-hosted fonts, site search,
  colour system, and the Notes section, which is written in WordPress itself.
Author: Vialog
Version: 1.8.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: Proprietary
Text Domain: vialog
*/



@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-400-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-400-latin.woff2') format('woff2');
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/source-serif-4-400-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/source-serif-4-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/source-serif-4-400-latin.woff2') format('woff2');
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper:      #FBFAF7;
  --paper-2:    #F3F1EC;
  --paper-3:    #EAE7E0;
  --card:       #FFFFFF;

  --ink:        #14161A;
  --ink-2:      #3A4048;
  --muted:      #626871;
  --rule:       #E6E3DC;
  --rule-2:     #D4D0C7;

  --accent:     #1C5545;
  --accent-2:   #123B30;
  --accent-pale:#E7F0EC;
  --accent-line:#B9D0C6;

  --g-human:    #1C5545; --g-human-bg: #EAF2EE; --g-human-br: #BCD3C9;
  --g-animal:   #8A6410; --g-animal-bg:#FAF4E4; --g-animal-br:#E2D2A4;
  --g-invitro:  #5A6472; --g-invitro-bg:#F0F1F3; --g-invitro-br:#D3D6DB;
  --g-none:     #9E3324; --g-none-bg:  #FBEDEA; --g-none-br:  #E7C2B9;

  --serif: "Source Serif 4", Newsreader, Lora, ui-serif, Georgia, serif;
  --sans:  Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1220px;
  --measure:   700px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 88px;
}

:root[data-theme="dark"] {
  --paper:      #16181A;
  --paper-2:    #1D2023;
  --paper-3:    #24282C;
  --card:       #1A1D20;

  --ink:        #ECEAE5;
  --ink-2:      #B9BDC2;
  --muted:      #8D939C;
  --rule:       #2A2E33;
  --rule-2:     #383D43;

  --accent:     #6FC0A3;
  --accent-2:   #8AD1B7;
  --accent-pale:#1B2A25;
  --accent-line:#2E4A40;

  --g-human:    #6FC0A3; --g-human-bg: #17251F; --g-human-br: #2C4A3E;
  --g-animal:   #D7B45E; --g-animal-bg:#251F12; --g-animal-br:#4A3D1E;
  --g-invitro:  #9AA3AE; --g-invitro-bg:#1E2226; --g-invitro-br:#353A40;
  --g-none:     #E08774; --g-none-bg:  #271A17; --g-none-br:  #4C2F28;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--s5); }
.measure { max-width: var(--measure); }

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.011em; }
h1 { font-family: var(--serif); font-size: clamp(32px, 4.2vw, 52px); line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-family: var(--sans); font-size: 21px; font-weight: 680; line-height: 1.28; }
h3 { font-family: var(--sans); font-size: 16.5px; font-weight: 650; }
p { margin: 0 0 var(--s5); }

.prose { max-width: var(--measure); }
.prose p, .prose li { font-size: 18px; line-height: 1.68; color: var(--ink-2); }
.prose a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose h2 { margin: var(--s7) 0 var(--s3); color: var(--ink); scroll-margin-top: 80px; }
.prose h3 { margin: var(--s6) 0 var(--s2); color: var(--ink); }
.prose strong, .prose b { color: var(--ink); font-weight: 640; }

.lede { font-size: 20.5px; line-height: 1.55; color: var(--ink-2); font-weight: 380; }
.small { font-size: 13px; color: var(--muted); }
a { color: inherit; }
.label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.masthead {
  border-bottom: 1px solid var(--rule);
  
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.masthead-in { display: flex; align-items: center; gap: var(--s6); height: 60px; }
.logo { font-family: var(--serif); font-size: 24px; letter-spacing: -0.025em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo b { font-weight: 500; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: var(--s5); margin-left: auto; align-items: center; }
.nav a { font-size: 14px; color: var(--ink-2); text-decoration: none; padding: var(--s2) 0; border-bottom: 1.5px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent-line); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

.theme-btn { background: none; border: 1px solid var(--rule-2); border-radius: 5px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.theme-btn svg { width: 15px; height: 15px; }
:root:not([data-theme="dark"]) .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }

.hero { padding: var(--s8) 0 var(--s7); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 17ch; }
.hero .lede { max-width: 58ch; margin-top: var(--s5); }
.hero.compact { padding: var(--s6) 0; }
.hero.compact h1 { max-width: 22ch; }

.method-line { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); font-size: 13px; color: var(--muted); align-items: center; }
.method-line b { color: var(--ink); font-weight: 500; font-family: var(--mono); font-size: 14px; }

.evbar { margin: var(--s6) 0 0; max-width: 620px; }
.evbar-track { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--paper-3); }
.evbar-seg { height: 100%; }
.evbar-seg.human { background: var(--g-human); }
.evbar-seg.animal { background: var(--g-animal); }
.evbar-seg.invitro { background: var(--g-invitro); }
.evbar-seg.none { background: var(--g-none); }
.evbar-key { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s3); font-size: 12.5px; color: var(--muted); }
.evbar-key i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.section { padding: var(--s7) 0; border-bottom: 1px solid var(--rule); }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head .more { margin-left: auto; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.section-head .more:hover { text-decoration: underline; }

.compound-table { width: 100%; border-collapse: collapse; font-size: 14.5px; table-layout: fixed; }
.compound-table th { text-align: left; font-weight: 620; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 0 var(--s3) var(--s3) 0; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.compound-table td { padding: var(--s4) var(--s3) var(--s4) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compound-table tbody tr:hover td { background: var(--paper-2); }
.compound-table a { font-weight: 630; text-decoration: none; color: var(--ink); }
.compound-table a:hover { color: var(--accent); }
.compound-table .cmpd-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 3px; line-height: 1.45; }
.compound-table th:nth-child(1), .compound-table td:nth-child(1) { width: 44%; padding-right: var(--s5); }
.compound-table th:nth-child(2), .compound-table td:nth-child(2) { width: 34%; }
.compound-table th:nth-child(3), .compound-table td:nth-child(3),
.compound-table th:nth-child(4), .compound-table td:nth-child(4) { width: 11%; text-align: right; font-family: var(--mono); font-size: 13px; }

.grade { display: inline-flex; align-items: flex-start; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .045em; text-transform: uppercase; line-height: 1.4; padding: 4px 8px; border-radius: 4px; border: 1px solid; }
.grade::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-top: 4px; flex: 0 0 auto; }
.grade.human   { color: var(--g-human);   border-color: var(--g-human-br);   background: var(--g-human-bg); }
.grade.animal  { color: var(--g-animal);  border-color: var(--g-animal-br);  background: var(--g-animal-bg); }
.grade.invitro { color: var(--g-invitro); border-color: var(--g-invitro-br); background: var(--g-invitro-bg); }
.grade.none    { color: var(--g-none);    border-color: var(--g-none-br);    background: var(--g-none-bg); }

.grade-note {
  display: inline; margin-left: 8px; font-size: 13px; line-height: 1.55;
  color: var(--ink-2); font-family: var(--sans); text-transform: none;
  letter-spacing: 0;
}

.grade-line { flex: 1 1 100%; max-width: 82ch; padding-bottom: 2px; }
.compound-table .grade-note { display: block; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 620px) {
  .grade-note { display: block; margin: 6px 0 0; }
}

.ledger { border: 1px solid var(--rule-2); border-radius: 6px; margin: var(--s5) 0 var(--s6); background: var(--card); }
.ledger-head { padding: var(--s3) var(--s4); background: var(--paper-2); border-bottom: 1px solid var(--rule-2); display: flex; align-items: center; gap: var(--s3); border-radius: 6px 6px 0 0; }
.ledger-head h3 { font-size: 13.5px; }
.ledger-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 6px 6px; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger th { text-align: left; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 620; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--card); }
.ledger td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: top; line-height: 1.5; }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: var(--paper-2); }
.ledger .num { font-family: var(--mono); color: var(--ink); font-size: 13px; }
.ledger .cite a { color: var(--accent); font-size: 12.5px; }
.ledger tr.untraced td, .ledger tr.untraced:hover td { background: var(--g-none-bg); }

@media (max-width: 760px) {
  .ledger-scroll { overflow-x: visible; }
  .ledger table, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger thead { display: none; }
  .ledger tr { border-bottom: 1px solid var(--rule-2); padding: var(--s2) 0 var(--s3); }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { border: 0; padding: 5px var(--s4); }
  .ledger td.num:first-child { font-weight: 640; color: var(--ink); font-family: var(--sans); font-size: 15px; padding-top: var(--s3); }
  .ledger td[data-l]::before { content: attr(data-l); display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
}

.idcard { border: 1px solid var(--rule-2); border-radius: 6px; background: var(--card); margin: var(--s6) 0; max-width: var(--measure); overflow: hidden; }
.idcard-head { padding: var(--s3) var(--s4); background: var(--paper-2); border-bottom: 1px solid var(--rule-2); font-size: 13px; font-weight: 650; }
.idcard dl { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
.idcard dt { padding: var(--s3) var(--s4); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); font-weight: 620; }
.idcard dd { margin: 0; padding: var(--s3) var(--s4); font-family: var(--mono); font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--rule); word-break: break-word; }
.idcard dl > :nth-last-child(1), .idcard dl > :nth-last-child(2) { border-bottom: 0; }
.idcard dd.unverified { color: var(--muted); font-family: var(--sans); font-style: italic; font-size: 13.5px; }

.doc { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: var(--s9); align-items: start; padding: var(--s7) 0 var(--s9); }
.doc-main { min-width: 0; }
.toc { position: sticky; top: 84px; font-size: 13px; border-left: 1px solid var(--rule); padding-left: var(--s4); }
.toc h2 { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); font-weight: 620; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 7px; line-height: 1.35; }
.toc a { color: var(--muted); text-decoration: none; display: block; border-left: 2px solid transparent; margin-left: -17px; padding-left: 15px; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

.crumbs { font-size: 12.5px; color: var(--muted); padding: var(--s4) 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; color: var(--muted); opacity: 0.55; }

.note { border-left: 2px solid var(--accent-line); padding: var(--s1) 0 var(--s1) var(--s5); margin: var(--s6) 0; color: var(--ink-2); font-size: 16px; max-width: var(--measure); line-height: 1.6; }
.note.warn { border-left-color: var(--g-none-br); }
.note b { color: var(--ink); }

.byline { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; padding: var(--s4) 0; margin-top: var(--s5); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); max-width: var(--measure); }
.byline b { color: var(--ink); font-weight: 620; }

.refs { max-width: var(--measure); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--rule); }
.refs ol { padding-left: var(--s5); margin: 0; }
.refs li { font-size: 13.5px; color: var(--ink-2); margin-bottom: var(--s3); line-height: 1.55; }
.refs a { color: var(--accent); }

.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.cell { background: var(--card); padding: var(--s5); display: block; text-decoration: none; color: inherit; }
.cell:hover { background: var(--paper-2); }
.cell h3 { margin: 0 0 6px; font-size: 15.5px; }
.cell p { margin: 0 0 var(--s3); font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.related { border-top: 1px solid var(--rule); margin-top: var(--s8); padding-top: var(--s6); }

.faq { max-width: var(--measure); margin: var(--s6) 0 0; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: var(--s4) 0; font-weight: 620; font-size: 16px; list-style: none; display: flex; gap: var(--s3); align-items: flex-start; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--accent); font-weight: 400; font-size: 18px; line-height: 1.2; flex: 0 0 auto; }
.faq details[open] summary::before { content: "\2013"; }
.faq .ans { padding: 0 0 var(--s4) 30px; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }

.calc { border: 1px solid var(--rule-2); border-radius: 6px; background: var(--card); max-width: var(--measure); margin: var(--s6) 0; overflow: hidden; }
.calc-body { padding: var(--s5); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.field label { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 620; margin-bottom: 6px; }
.field input { width: 100%; padding: 9px 11px; font-family: var(--mono); font-size: 14px; border: 1px solid var(--rule-2); border-radius: 4px; background: var(--paper); color: var(--ink); }
.field input:focus { outline: 2px solid var(--accent-pale); border-color: var(--accent); }
.calc-out { border-top: 1px solid var(--rule-2); background: var(--paper-2); padding: var(--s5); }
.calc-out .big { font-family: var(--mono); font-size: 24px; color: var(--accent); }
.calc-out .cap { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.search { position: relative; max-width: 440px; margin: 0 0 var(--s4); }
.search input { width: 100%; padding: 10px 14px; font-size: 14.5px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--card); color: var(--ink); font-family: var(--sans); }
.search input:focus { outline: 2px solid var(--accent-pale); border-color: var(--accent); }
.no-hits { color: var(--muted); font-size: 14.5px; padding: var(--s5) 0; display: none; }
.pill-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s5); }
.pill { font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--rule-2); border-radius: 99px; background: var(--card); color: var(--ink-2); cursor: pointer; font-family: var(--sans); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.on { background: var(--accent); color: var(--paper); border-color: var(--accent); }

.post-list { border-top: 1px solid var(--rule); max-width: 860px; }
.post-item { display: block; padding: var(--s5) 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.post-item:hover h3 { color: var(--accent); }
.post-item h2 { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: -0.015em; margin-bottom: 6px; }
.post-item p { margin: 0 0 var(--s3); font-size: 16px; color: var(--ink-2); line-height: 1.6; max-width: 68ch; }
.post-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: var(--s4); flex-wrap: wrap; }

.foot { padding: var(--s8) 0; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--rule); background: var(--paper-2); }
.foot-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s6); }
.foot h2 { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); margin: 0 0 var(--s3); font-weight: 620; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 7px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot-legal { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--rule-2); font-size: 12.5px; line-height: 1.65; max-width: 78ch; }

@media (max-width: 1000px) { .doc { grid-template-columns: 1fr; gap: 0; } .toc { display: none; } }
@media (max-width: 860px) {
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .nav { gap: var(--s4); } .nav a { font-size: 13px; }
  .hide-sm { display: none; }
  .compound-table { table-layout: auto; }
  .compound-table th:nth-child(1), .compound-table td:nth-child(1),
  .compound-table th:nth-child(2), .compound-table td:nth-child(2) { width: auto; }
  .grid.c3 { grid-template-columns: 1fr 1fr; }
  .idcard dl { grid-template-columns: 1fr; }
  .idcard dt { border-bottom: 0; padding-bottom: 0; }
  .hero { padding: var(--s6) 0 var(--s5); }
  .section { padding: var(--s6) 0; }
}
@media (max-width: 620px) {
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .calc-body { grid-template-columns: 1fr; }
  .grade { white-space: normal; }
  .post-item h2 { font-size: 20px; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sitesearch { position: relative; max-width: 520px; margin: var(--s6) 0 var(--s5); }

.sitesearch input {
  width: 100%; padding: 12px 16px 12px 42px; font-size: 15px; font-family: var(--sans);
  color: var(--ink); background: var(--card);
  border: 1px solid var(--rule-2); border-radius: 7px;
  
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626871' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px 50%; background-size: 16px;
}
.sitesearch input::placeholder { color: var(--muted); }
.sitesearch input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-line);
}
.sitesearch input::-webkit-search-cancel-button { cursor: pointer; }

.sitesearch-results {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: 7px;
  overflow: hidden; max-height: 60vh; overflow-y: auto;
}

.sitesearch-hit {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--s4);
  align-items: baseline; padding: 12px var(--s4);
  text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule);
}
.sitesearch-hit:last-child { border-bottom: 0; }
.sitesearch-hit:hover, .sitesearch-hit.on { background: var(--paper-2); }

.sitesearch-kind {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); padding-top: 2px;
}
.sitesearch-title { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.sitesearch-sum {
  grid-column: 2; font-size: 13px; color: var(--muted); line-height: 1.5;
  display: block; margin-top: 2px;
}
.sitesearch-empty { margin: 0; padding: 14px var(--s4); font-size: 14px; color: var(--muted); }

.cell-kicker {
  display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.cell h3 + p { margin-top: 0; }
.cell-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }

@media (max-width: 640px) {
  .sitesearch { margin: var(--s5) 0 var(--s4); }
  .sitesearch-hit { grid-template-columns: 1fr; gap: 2px; }
  .sitesearch-sum { grid-column: 1; }
}

.mast-search { max-width: 210px; margin: 0 0 0 auto; flex: 0 1 210px; }
.mast-search input { padding: 7px 12px 7px 32px; font-size: 13.5px; border-radius: 6px; background-size: 14px; background-position: 11px 50%; }
.mast-search .sitesearch-results { width: 380px; left: auto; right: 0; }

@media (max-width: 900px) {
  .masthead-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px;
                 gap: var(--s4); row-gap: 8px; }
  .logo { order: 1; }
  .mast-search { order: 2; margin: 0 0 0 auto; max-width: none; flex: 1 1 150px; }
  .theme-btn { order: 3; }
  .nav { order: 4; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none;
         -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .mast-search .sitesearch-results { width: auto; left: 0; right: 0; }
}
@media (max-width: 480px) {
  .masthead-in { gap: var(--s3); }
  .mast-search { flex-basis: 110px; }
  .nav { gap: var(--s5); }
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.az-block { margin-bottom: var(--s7); }
.az-block:last-child { margin-bottom: 0; }
.az-block h3 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule); margin: 0 0 var(--s3);
}
.az-count { color: var(--rule-2); margin-left: 4px; }
ul.az { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: var(--s7); }
ul.az li {
  display: flex; align-items: baseline; gap: var(--s3); break-inside: avoid;
  padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px;
}
ul.az a { color: var(--ink-2); text-decoration: none; flex: 1 1 auto; }
ul.az a:hover { color: var(--accent); }
ul.az .grade { flex: 0 0 auto; font-size: 9.5px; padding: 2px 6px; white-space: nowrap; }
ul.az .grade::before { width: 5px; height: 5px; margin-top: 3px; }

@media (max-width: 1000px) { ul.az { columns: 2; column-gap: var(--s6); } }
@media (max-width: 620px)  { ul.az { columns: 1; } }

.pager { display: flex; gap: var(--s4); align-items: center; margin-top: var(--s6); font-size: 14px; }
.pager a, .pager span {
  padding: 8px 14px; border: 1px solid var(--rule-2); border-radius: 6px;
  text-decoration: none; color: var(--ink-2); background: var(--card);
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .dots { border: 0; background: none; padding: 8px 0; color: var(--muted); }

.prose ul, .prose ol { padding-left: var(--s5); margin: 0 0 var(--s4); }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  margin: var(--s5) 0; padding: 2px 0 2px var(--s5);
  border-left: 2px solid var(--accent-line); color: var(--ink-2); font-style: normal;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: var(--s3); font-size: 13px; color: var(--muted); font-style: normal; }
.prose figure { margin: var(--s6) 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose figcaption { margin-top: var(--s2); font-size: 13px; color: var(--muted); }
.prose hr, .prose .wp-block-separator {
  border: 0; border-top: 1px solid var(--rule); margin: var(--s7) 0;
}
.prose code, .prose kbd {
  font-family: var(--mono); font-size: 0.88em; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px;
}
.prose pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 6px; padding: var(--s4);
  overflow-x: auto; margin: var(--s5) 0;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s5) 0; font-size: 14.5px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.prose .wp-block-table { overflow-x: auto; }
.prose .wp-block-image { margin: var(--s6) 0; }
.prose .aligncenter { text-align: center; }

.doc.no-toc { grid-template-columns: minmax(0, 1fr); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 6px 0; font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 0; }

.write {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--accent); border-radius: 5px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.write:hover { color: #fff; filter: brightness(1.08); }
.write:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.write svg { width: 13px; height: 13px; flex: 0 0 auto; }

.editorbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4);
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px dashed var(--rule-2);
}
.editorbar .label { flex: 1 1 100%; }
.editorbar a.quiet {
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
}
.editorbar a.quiet:hover { color: var(--accent); border-bottom-color: var(--accent); }

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

@media (max-width: 900px) {
  .write { order: 3; padding: 0 9px; }
  .write span { display: none; }
}
