/*
Theme Name: Ledger
Theme URI: https://www.venusbetgiris.com/
Description: Statement-style theme for venusbetgiris.com: address record, ledger rows, sheet sections. Self-hosted Source Serif 4 and Source Sans 3 (SIL Open Font License 1.1).
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: ledger
License: GNU General Public License v2 or later
*/

/* ---------- Fonts (self-hosted, latin + a Turkish cut of latin-ext) ---------- */
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("assets/fonts/source-sans-3-turkish.woff2") format("woff2");
	unicode-range: U+011E-011F, U+0130, U+015E-015F, U+20BA;
}
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("assets/fonts/source-sans-3-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: 600;
	font-display: swap;
	src: url("assets/fonts/source-serif-4-turkish.woff2") format("woff2");
	unicode-range: U+011E-011F, U+0130, U+015E-015F;
}
@font-face {
	font-family: "Source Serif 4";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/source-serif-4-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 {
	--desk: #E4E7EC;       /* grey desk the sheets lie on */
	--sheet: #FFFFFF;      /* statement sheet */
	--ink: #1F1B3D;        /* vault ink: text, header, footer */
	--slate: #434A5E;      /* secondary text, 8.6:1 on white */
	--engrave: #47398A;    /* links, engraving lines */
	--gold: #E5AC00;       /* Venus gold, used sparingly */
	--gold-deep: #7D5C00;  /* gold for text and lines on white */
	--rule: #D3D8E0;
	--rule-soft: #E6E9EE;
	--alert: #A3263A;
	--ok: #1F6B45;

	--serif: "Source Serif 4", "Source Sans 3", Georgia, serif;
	--sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

	/* type scale, ratio about 1.25 from an 18px body */
	--step--1: 0.9375rem;  /* 15 */
	--step-0: 1.125rem;    /* 18 */
	--step-1: 1.375rem;    /* 22 */
	--step-2: 1.75rem;     /* 28 */
	--step-3: 2.25rem;     /* 36 */
	--step-4: 3rem;        /* 48 */

	/* 8px rhythm */
	--space-1: .5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2rem;
	--space-5: 3rem;
	--space-6: 4rem;

	--measure: 40rem;
	--frame: 70rem;
	--sheet-pad: 3rem;
	--gutter: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
	margin: 0;
	background: var(--desk);
	color: var(--ink);
	font: 400 var(--step-0)/1.62 var(--sans);
	font-feature-settings: "kern", "liga";
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--engrave); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--engrave); outline-offset: 3px; border-radius: 2px; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
strong { font-weight: 600; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--sheet); color: var(--ink); padding: .5rem .875rem; }

.frame { width: min(var(--frame), 100% - 2.5rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--ink); color: #fff; border-bottom: 3px solid var(--gold); }
.site-header .frame { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 4.5rem; flex-wrap: wrap; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.brand img { width: 172px; height: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.main-nav a { color: #E6E3F4; text-decoration: none; font-size: 1rem; padding-block: .375rem; display: inline-block; border-bottom: 1px solid transparent; }
.main-nav a:hover { color: #fff; border-bottom-color: #8D86B8; }
.main-nav a[aria-current] { color: #fff; border-bottom-color: var(--gold); }

/* ---------- Page opening ---------- */
.opening { padding-block: clamp(2rem, 5vw, 4rem) 0; }
.title-block {
	display: flex; flex-wrap: wrap; align-items: last baseline; justify-content: space-between;
	gap: var(--space-1) var(--space-4);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--ink);
	position: relative;
}
/* second hairline: a double rule, like the head of a statement */
.title-block::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; border-bottom: 1px solid var(--ink); opacity: .35; }
.title-block h1 {
	font: 600 var(--step-4)/1.06 var(--serif);
	font-optical-sizing: auto;
	letter-spacing: -0.015em;
	margin: 0;
	max-width: 28ch;
	text-wrap: balance;
}
.filed { margin: 0; font-size: .875rem; color: var(--slate); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.filed strong { color: var(--ink); font-weight: 600; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--slate); max-width: 38rem; margin: var(--space-3) 0 0; }

/* ---------- Plate: the info card of the page, mounted on a sheet under the title block ---------- */
/* 720px image (PLATE_WIDTH in functions.php) + padding + border */
.plate {
	margin: var(--space-4) 0 0;
	max-width: calc(720px + 1.5rem + 2px);
	padding: .75rem;
	background: var(--sheet);
	border: 1px solid var(--rule);
	box-shadow: 0 1px 0 rgba(31, 27, 61, .05), 0 22px 44px -30px rgba(31, 27, 61, .5);
}
.plate-image {
	width: 100%; height: auto; aspect-ratio: 1200 / 675;
	background: var(--ink);
	box-shadow: 0 0 0 1px rgba(31, 27, 61, .35);
}

/* ---------- The record (address certificate) ---------- */
.record {
	position: relative;
	margin-top: var(--space-4);
	background: var(--sheet);
	border: 1px solid var(--rule);
	box-shadow: 0 1px 0 rgba(31, 27, 61, .05), 0 22px 44px -30px rgba(31, 27, 61, .5);
	padding: 4.5rem clamp(1.25rem, 4vw, var(--sheet-pad)) 4.25rem;
	overflow: hidden;
}
/* guilloche borders, top and bottom, each held between two ink rules */
.record::before, .record::after {
	content: "";
	position: absolute; left: 0; right: 0;
	height: 30px;
	border-block: 1px solid var(--ink);
	background: url("assets/svg/guilloche-band.svg") repeat-x 0 50% / 96px 28px;
}
.record::before { top: 12px; }
.record::after { bottom: 12px; }
.record-inner { position: relative; z-index: 1; }
.watermark {
	position: absolute; z-index: 0; pointer-events: none;
	width: 460px; height: 460px; right: -190px; top: 96px;
	background: url("assets/svg/watermark.svg") center / contain no-repeat;
	opacity: .2;
}
.microprint {
	margin: var(--space-3) 0 0; font-size: 9px; line-height: 1; letter-spacing: .08em;
	color: var(--engrave); opacity: .8; white-space: nowrap; overflow: hidden;
	user-select: none;
}

.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; padding-bottom: var(--space-2); border-bottom: 1px solid var(--ink); }
.record-title { font: 600 var(--step-1)/1.2 var(--serif); margin: 0; }
.record-ref { font-size: .875rem; color: var(--slate); font-variant-numeric: lining-nums tabular-nums; margin: 0; }

.record-primary { padding-block: var(--space-4) var(--space-4); border-bottom: 1px solid var(--rule); }
.record-split { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; column-gap: var(--space-5); align-items: start; }
.record:has(.record-split) .watermark { top: 520px; }
.field-label { display: block; font-size: var(--step--1); color: var(--slate); margin-bottom: .375rem; }
.address {
	display: block;
	font: 600 clamp(2.25rem, 5vw, 4rem)/1.04 var(--serif);
	font-optical-sizing: auto;
	font-variant-numeric: lining-nums;
	letter-spacing: -0.02em;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.address .num { color: var(--engrave); }
.address-note { margin: var(--space-2) 0 0; font-size: 1rem; color: var(--slate); max-width: 34rem; }

/* status line in the record head: the result of the last automatic check */
.status { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: .625rem; margin: 0; font-size: var(--step--1); color: var(--slate); font-variant-numeric: lining-nums tabular-nums; }
.status strong { color: var(--ok); font-weight: 600; }
.status-dot { width: .5rem; height: .5rem; transform: translateY(-.05em); border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 107, 69, .16); flex: none; }
.status time { color: var(--ink); }
.status-text { text-wrap: pretty; }
.nowrap { white-space: nowrap; }

/* address anatomy: every part of the domain gets an engraved bracket and a short reading */
.address { display: flex; flex-wrap: nowrap; align-items: flex-start; }
.part { display: flex; flex-direction: column; min-width: 0; }
.part-text { position: relative; display: block; padding-bottom: .16em; }
.part-text::after {
	content: ""; position: absolute; left: .045em; right: .045em; bottom: 0;
	height: 9px; border: 1px solid var(--ink); border-top: 0;
}
.part-text::before {
	content: ""; position: absolute; left: 50%; bottom: -9px;
	width: 1px; height: 9px; background: var(--ink);
}
.part-number .part-text::after { border-color: var(--engrave); }
.part-number .part-text::before { background: var(--engrave); }
.part-note {
	display: block;
	contain: inline-size;  /* the note wraps to the width of its own glyphs, never widens the part */
	margin-top: 1.125rem; padding-inline: .375rem;
	text-align: center; text-wrap: balance;
	font: 400 .875rem/1.4 var(--sans); letter-spacing: 0; color: var(--slate);
	overflow-wrap: normal; user-select: none;
}
.part-note b { display: block; font-weight: 600; color: var(--ink); }
.part-number .part-note b { color: var(--engrave); }
.record-split .address { font-size: clamp(2.75rem, 6.4vw, 4rem); }

/* the same reading as a key, for small screens and screen readers */
.anatomy-key {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
	margin: 0;
}
.anatomy-key div { display: grid; grid-template-columns: 5.5rem 1fr; gap: .75rem; align-items: baseline; padding-block: .375rem; border-top: 1px solid var(--rule-soft); }
.anatomy-key dt { font: 600 1.0625rem/1.2 var(--serif); font-variant-numeric: lining-nums; color: var(--ink); }
.anatomy-key .key-number dt { color: var(--engrave); }
.anatomy-key dd { margin: 0; font-size: var(--step--1); line-height: 1.4; color: var(--slate); }

/* address history, set in the margin of the record */
.history { position: relative; border-left: 1px solid var(--rule); padding-left: var(--space-3); font-size: var(--step--1); line-height: 1.5; color: var(--slate); }
.history-title { font: 400 var(--step--1)/1.62 var(--sans); color: var(--slate); margin: 0 0 .875rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; flex-direction: column; padding: 0 0 1.125rem 1.75rem; }
.timeline li::before {
	content: ""; position: absolute; left: 0; top: .45rem;
	width: .6875rem; height: .6875rem; border-radius: 50%;
	border: 1.5px solid var(--slate); background: var(--sheet); box-sizing: border-box;
}
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: calc(.34375rem - .5px); top: 1.375rem; bottom: .25rem; width: 1px; background: var(--rule); }
.timeline .timeline-now::before { background: var(--ink); border-color: var(--ink); }
.timeline-domain { font: 600 1.125rem/1.35 var(--serif); font-variant-numeric: lining-nums; color: var(--ink); }
.timeline-now .num { color: var(--engrave); font-size: 1.375rem; line-height: 1.1; }
.timeline-old .timeline-domain { color: var(--slate); font-weight: 400; }
.timeline-old s { text-decoration-color: var(--slate); text-decoration-thickness: 1px; }
.timeline-when { font-variant-numeric: lining-nums tabular-nums; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.record-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: var(--space-3); }

.button {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 3rem; padding: .625rem 1.5rem;
	font: 600 1rem/1.2 var(--sans);
	border-radius: 3px; border: 1px solid transparent;
	text-decoration: none; cursor: pointer;
}
.button svg { width: 18px; height: 18px; flex: none; }
.button-gold { background: var(--gold); color: var(--ink); border-color: #C99600; box-shadow: inset 0 -2px 0 rgba(125, 92, 0, .35); }
.button-gold:hover { background: #F0B90F; }
.button-plain { background: var(--sheet); color: var(--ink); border-color: var(--ink); }
.button-plain:hover { background: var(--ink); color: #fff; }
.button[data-copied="true"] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: none; }
.record-actions .button-gold { min-width: 11.5rem; }

.ledger { margin: 0; }
.record > .record-inner > .ledger { max-width: 46rem; }
.ledger-row { display: grid; grid-template-columns: 12rem 1fr; gap: .25rem var(--space-3); padding-block: .875rem; border-bottom: 1px solid var(--rule-soft); }
.ledger-row:last-child { border-bottom: 0; }
.ledger dt { color: var(--slate); font-size: 1rem; }
.ledger dd { margin: 0; font-variant-numeric: lining-nums tabular-nums; }
.ledger dd small { display: block; color: var(--slate); font-size: var(--step--1); line-height: 1.5; margin-top: .125rem; }

.record-foot { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--ink); }
.seal { position: relative; width: 104px; height: 104px; flex: none; background: url("assets/svg/seal.svg") center / contain no-repeat; }
.seal img { position: absolute; left: 36px; top: 36px; width: 32px; height: 32px; border-radius: 8px; }
.checked { margin: 0; font: 600 1.25rem/1.3 var(--serif); font-variant-numeric: lining-nums; }
.record-foot p + p { margin: .25rem 0 0; font-size: 1rem; color: var(--slate); max-width: 34rem; }


/* ---------- Quick answers: ledger with dot leaders ---------- */
.quick { margin-top: var(--space-4); background: var(--sheet); border: 1px solid var(--rule); padding: var(--space-4) var(--sheet-pad) var(--space-3); }
.quick-title { font: 600 var(--step-1)/1.2 var(--serif); margin: 0 0 var(--space-2); max-width: none; }
.quick ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
.quick li { border-top: 1px solid var(--rule-soft); }
.quick a { display: flex; align-items: baseline; gap: .5rem; padding-block: .75rem; color: var(--ink); text-decoration: none; }
.quick a:hover .quick-q { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.quick-q { flex: none; }
.quick-dots { flex: 1 1 1.5rem; min-width: 1.5rem; border-bottom: 1.5px dotted #A9AFBD; transform: translateY(-.3em); }
.quick-a { flex: none; font: 600 1.0625rem/1.3 var(--serif); color: var(--engrave); font-variant-numeric: lining-nums; text-align: right; }

/* ---------- Body sections: each one a white sheet ---------- */
.statement { padding-block: var(--space-4) clamp(3rem, 6vw, 4.5rem); }
.section {
	display: grid;
	grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
	column-gap: var(--gutter);
	background: var(--sheet);
	border: 1px solid var(--rule);
	padding: var(--sheet-pad);
}
.section + .section { margin-top: var(--space-3); }
.section > * { grid-column: 1; }
.section > .margin { grid-column: 2; grid-row: 1 / span 20; align-self: start; position: sticky; top: 1.5rem; }
.section > .margin-short { grid-row: 1 / span 2; }
.section > .wide { grid-column: 1 / -1; }
/* ruled margin: a soft vertical line down the gutter of every sheet that carries notes */
.section:has(> .margin) {
	background-image: linear-gradient(var(--rule-soft), var(--rule-soft));
	background-repeat: no-repeat;
	background-size: 1px calc(100% - 2 * var(--sheet-pad));
	background-position: calc(var(--sheet-pad) + var(--measure) + var(--gutter) / 2) var(--sheet-pad);
}

h2 { font: 600 var(--step-3)/1.15 var(--serif); letter-spacing: -0.012em; margin: 0 0 var(--space-3); max-width: 26ch; text-wrap: balance; }
h3 { font: 600 var(--step-1)/1.3 var(--serif); margin: var(--space-4) 0 var(--space-1); }
p { margin: 0 0 var(--space-2); }
.section > :last-child:not(.margin) { margin-bottom: 0; }
.statement ul { padding-left: 1.25rem; margin: 0 0 var(--space-2); }
.statement ul li { margin-bottom: .5rem; padding-left: .25rem; }
.statement ul li::marker { color: var(--gold-deep); }

/* sequence list: real steps only */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 var(--space-3); }
.steps li { counter-increment: step; position: relative; padding: .875rem 0 .875rem 3.25rem; border-top: 1px solid var(--rule-soft); }
.steps li:last-child { border-bottom: 1px solid var(--rule-soft); }
.steps li::before {
	content: counter(step);
	position: absolute; left: 0; top: .7rem;
	font: 600 1.75rem/1 var(--serif);
	font-variant-numeric: lining-nums;
	color: var(--gold-deep);
	width: 2rem; text-align: right;
}

/* tables styled as statement ledgers */
.table-wrap { margin: var(--space-3) 0; border: 1px solid var(--rule); background: var(--sheet); position: relative; }
.section > .table-wrap:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: lining-nums tabular-nums; }
caption { text-align: left; padding: .875rem 1.125rem; font: 600 1.125rem/1.3 var(--serif); border-bottom: 1px solid var(--ink); }
th, td { text-align: left; vertical-align: top; padding: .75rem 1.125rem; }
thead th { font-weight: 600; font-size: var(--step--1); color: var(--slate); border-bottom: 1px solid var(--rule); }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--rule-soft); }
tbody tr:nth-child(even) { background: #FAFBFC; }
tbody th { font-weight: 600; white-space: nowrap; }
td.amount { white-space: nowrap; }

/* margin notes: statement annotations */
div.margin > * + * { margin-top: var(--space-4); }
.note { border-top: 2px solid var(--gold); padding-top: var(--space-2); font-size: var(--step--1); line-height: 1.55; color: #3E4456; }
.note-title { font: 600 1.125rem/1.3 var(--serif); color: var(--ink); margin: 0 0 .5rem; }
.note p { margin: 0 0 .5rem; }
.note p:last-child { margin-bottom: 0; }
.note .ledger-row { grid-template-columns: 1fr; gap: 0; padding-block: .5rem; }
.note .ledger dt { font-size: .875rem; color: #3E4456; }
.note .ledger dd { color: var(--ink); font-size: 1rem; }
.note-figure { font: 600 2rem/1.1 var(--serif); color: var(--ink); display: block; font-variant-numeric: lining-nums; margin-bottom: .375rem; letter-spacing: -0.01em; }

/* screenshots as attached documents */
.attachment { margin: 0; }
.attachment img { width: 100%; border: 1px solid var(--rule); background: var(--ink); }
.attachment figcaption { font-size: var(--step--1); color: #3E4456; margin-top: .625rem; line-height: 1.5; }

/* lookalike domain specimen */
.specimen { margin: var(--space-3) 0; border: 1px solid var(--rule); }
.specimen-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline; padding: .875rem 1.125rem; }
.specimen-row + .specimen-row { border-top: 1px solid var(--rule-soft); }
.specimen-row code { font: 600 1.375rem/1.2 var(--serif); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.specimen-row mark { background: none; color: var(--alert); text-decoration: underline wavy var(--alert); text-underline-offset: .2em; }
.verdict { font-size: var(--step--1); color: var(--slate); white-space: nowrap; }
.verdict-ok { color: var(--ok); font-weight: 600; }
.verdict-bad { color: var(--alert); font-weight: 600; }

/* questions */
.questions { margin: 0; }
.questions dt { font: 600 var(--step-1)/1.3 var(--serif); padding-top: var(--space-3); margin-top: var(--space-3); border-top: 1px solid var(--rule-soft); scroll-margin-top: 1.5rem; }
.questions dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.questions dd { margin: .5rem 0 0; }
.questions dt:target { color: var(--engrave); }

.aside-note { border-left: 3px solid var(--gold); padding: .25rem 0 .25rem 1.125rem; color: var(--slate); }

/* ---------- Article page ---------- */
.trail { font-size: .875rem; color: var(--slate); margin: 0 0 var(--space-3); }
.trail ol { list-style: none; padding: 0; margin: -.75rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5rem; }
.trail li + li::before { content: "/"; margin-right: .5rem; color: #8A90A0; }
.trail a { color: var(--slate); display: inline-block; padding-block: .75rem; }

.byline { display: flex; align-items: center; gap: .875rem; margin-top: var(--space-3); }
.byline-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; font: 600 1rem/1 var(--serif); flex: none; box-shadow: 0 0 0 3px var(--desk), 0 0 0 4px var(--gold-deep); }
.byline p { margin: 0; font-size: 1rem; line-height: 1.4; }
.byline p span { display: block; color: var(--slate); font-size: var(--step--1); }

.record-compact { padding-bottom: 4.25rem; }
.record-compact .watermark { right: -80px; left: auto; top: 70px; width: 360px; height: 360px; }

.check-list { list-style: none; padding: 0 !important; }
.check-list li { position: relative; padding-left: 2rem !important; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1.125rem; height: 1.125rem; border: 1.5px solid var(--gold-deep); border-radius: 2px; background: linear-gradient(var(--gold-deep), var(--gold-deep)) center / .5rem .5rem no-repeat; }

.handles { margin: var(--space-3) 0; border: 1px solid var(--rule); }

.author-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; padding: var(--space-3) 0 0; border-top: 1px solid var(--ink); }
.author-card p { margin: 0; }
.author-card .byline-mark { width: 56px; height: 56px; font-size: 1.25rem; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--gold-deep); }
.author-name { font: 600 var(--step-1)/1.2 var(--serif); margin-bottom: .375rem !important; }

.related { list-style: none; padding: 0 !important; margin: 0 !important; }
.related li { border-top: 1px solid var(--rule); padding: .75rem 0 !important; margin: 0 !important; }
.related li:last-child { border-bottom: 1px solid var(--rule); }
.related a { font: 600 1.0625rem/1.3 var(--serif); text-decoration: none; }
.related a:hover { text-decoration: underline; }
.related span { display: block; font-size: var(--step--1); color: #3E4456; }

/* address strip on inner pages */
.address-strip { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.address-strip .frame { display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; padding-block: .75rem; font-size: 1rem; }
.strip-label { color: var(--slate); }
.strip-value { font: 600 1.375rem/1.2 var(--serif); font-variant-numeric: lining-nums; color: var(--ink); margin-left: .375rem; }
.strip-value .num { color: var(--engrave); }
.address-strip .button { min-height: 2.75rem; min-width: 9.5rem; padding: .375rem 1rem; font-size: .9375rem; }
.address-strip .strip-alt { color: var(--slate); font-size: var(--step--1); margin-left: auto; }
.strip-status { font-size: .875rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #D9D6EA; padding-block: 3.5rem 2rem; font-size: 1rem; border-top: 3px solid var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem 3rem; }
.site-footer h2 { font: 600 1.125rem/1.3 var(--serif); color: #fff; margin: 0 0 .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0; }
.site-footer li a { display: inline-block; padding-block: .5625rem; }
.site-footer a { color: #E6E3F4; }
.footer-about img { width: 160px; margin-bottom: 1rem; }
.footer-about p { color: #BEB9D6; max-width: 26rem; }
.responsible { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3A3462; display: flex; gap: 1rem; align-items: center; }
.age-mark { flex: none; width: 48px; height: 48px; border: 1.5px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold); font: 600 1rem/1 var(--serif); }
.responsible p { margin: 0; color: #CFCBE3; }
.legal { margin-top: 1.25rem; font-size: .875rem; color: #A9A4C6; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
	.record { animation: settle .6s cubic-bezier(.2, .7, .2, 1) both; }
	.seal { animation: stamp .5s .45s cubic-bezier(.3, 1.4, .5, 1) both; }
	@keyframes settle { from { opacity: 0; transform: translateY(10px); } }
	@keyframes stamp { from { opacity: 0; transform: scale(1.25) rotate(-12deg); } }
	.button { transition: background-color .15s, color .15s; }
	html { scroll-behavior: smooth; }
}

/* ---------- Address anatomy: below 800px the readings move into a key ---------- */
@media (max-width: 799px) {
	.part-text { padding-bottom: 0; }
	.part-text::after, .part-text::before, .part-note { display: none; }
	.anatomy-key { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin: 1rem 0 0; max-width: 30rem; }
}

/* ---------- Article record: two columns on wide screens ---------- */
@media (min-width: 961px) {
	.record-compact .record-inner { padding-right: 11rem; }
	.record-compact .record-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: var(--space-5); }
	.record-compact .record-primary { border-bottom: 0; padding-bottom: 0; }
	.record-compact .ledger { padding-top: var(--space-2); }
	.record-compact .ledger-row { grid-template-columns: 8.5rem 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	:root { --sheet-pad: 2rem; }
	.section { grid-template-columns: minmax(0, 1fr); }
	.section:has(> .margin) { background-image: none; }
	.section > .margin, .section > .margin-short { position: static; grid-column: 1; grid-row: auto; margin-top: var(--space-3); margin-bottom: var(--space-3); max-width: 34rem; }
	.section > .margin:last-child { margin-bottom: 0; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
	.quick ol { grid-template-columns: 1fr; }
	.watermark { right: -230px; }
	.record-split { grid-template-columns: minmax(0, 1fr); }
	.record-split .history { margin-top: var(--space-4); max-width: 40rem; border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: var(--space-2); }
	.record-split .timeline { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
	.record-split .timeline li:not(:last-child)::after { display: none; }
}
@media (max-width: 640px) {
	:root { --step-0: 1.0625rem; --step-1: 1.25rem; --step-3: 1.625rem; --step-4: 1.75rem; --sheet-pad: 1.25rem; }
	.frame { width: min(var(--frame), 100% - 2rem); }
	.brand img { width: 148px; }
	.site-header .frame { gap: .125rem; min-height: 0; padding-block: .5rem 0; }
	.main-nav {
		width: calc(100% + 2rem); margin-inline: -1rem; padding-inline: 1rem;
		overflow-x: auto; scrollbar-width: none;
	}
	/* the scrolling nav fades out at the right edge while there is more of it (site.js sets
	   data-overflow; without script it always fades) */
	.main-nav:not([data-overflow="false"]):not([data-overflow="end"]) {
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 4rem), transparent);
		mask-image: linear-gradient(90deg, #000 calc(100% - 4rem), transparent);
	}
	.main-nav::-webkit-scrollbar { display: none; }
	.main-nav ul { flex-wrap: nowrap; white-space: nowrap; gap: 0 1.25rem; padding-right: 2.5rem; padding-block: 6px; }
	.main-nav a { font-size: .9375rem; padding-block: .625rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
	.main-nav a:focus-visible { outline-offset: -2px; scroll-margin-inline: 2.5rem; }
	.opening { padding-top: var(--space-3); }
	.title-block { padding-bottom: .75rem; }
	.filed { white-space: normal; }
	.lede { font-size: 1.0625rem; margin-top: var(--space-2); }
	.plate { margin-top: var(--space-3); padding: .5rem; }
	.record { padding: 3.25rem 1.125rem 3.5rem; margin-top: var(--space-3); }
	.record::before, .record::after { height: 22px; background-size: 72px 21px; }
	.record::before { top: 10px; }
	.record::after { bottom: 10px; }
	.record-head { flex-direction: column; align-items: flex-start; gap: .375rem; padding-bottom: .875rem; }
	.record-title { font-size: 1.125rem; }
	.status { font-size: .875rem; }
	.record-split .address { font-size: clamp(1.875rem, 9vw, 2.75rem); }
	.anatomy-key dt { font-size: 1rem; }
	.record-split .history { margin-top: var(--space-3); }
	.record-split .timeline { display: block; }
	.record-split .timeline li:not(:last-child)::after { display: block; }
	.timeline-domain { font-size: 1.0625rem; }
	.record-primary { padding-block: var(--space-2) var(--space-3); }
	.address { font-size: clamp(1.875rem, 9vw, 2.75rem); }
	.address-note { font-size: var(--step--1); margin-top: .75rem; }
	.record-actions { flex-direction: column; margin-top: var(--space-2); }
	.record-actions .button { width: 100%; }
	.watermark { display: none; }
	.ledger-row { grid-template-columns: 1fr; gap: .125rem; padding-block: .75rem; }
	.ledger dt { font-size: var(--step--1); }
	.record-foot { gap: var(--space-2); align-items: flex-start; }
	.seal { width: 76px; height: 76px; }
	.seal img { left: 26px; top: 26px; width: 24px; height: 24px; border-radius: 6px; }
	.checked { font-size: 1.125rem; }
	.record-foot p + p { font-size: var(--step--1); }
	.microprint { margin-top: var(--space-2); }
	.quick { padding: var(--space-3) var(--sheet-pad) var(--space-2); }
	.quick a { flex-wrap: wrap; column-gap: .5rem; row-gap: 0; }
	.quick-q { flex: 1 1 auto; }
	.quick-dots { display: none; }
	.quick-a { flex-basis: 100%; text-align: left; font-size: 1rem; }
	.statement { padding-top: var(--space-3); }
	.section + .section { margin-top: var(--space-2); }
	.section { border-inline: 0; margin-inline: -1rem; padding-inline: 1rem; }
	h2 { margin-bottom: var(--space-2); }
	th, td { padding: .625rem .75rem; }
	.table-stack thead { display: none; }
	.table-stack tr { display: block; padding: .75rem; }
	.table-stack tbody tr + tr { border-top: 1px solid var(--rule); }
	.table-stack td, .table-stack th { display: block; padding: .125rem 0; border: 0 !important; }
	.table-stack th { font-family: var(--serif); font-size: 1.0625rem; margin-bottom: .25rem; white-space: normal; }
	.table-stack td[data-label]::before { content: attr(data-label) ": "; color: var(--slate); font-size: var(--step--1); }
	td.amount { white-space: normal; }
	.specimen-row { grid-template-columns: 1fr; padding: .75rem .875rem; }
	.specimen-row code { font-size: 1.1875rem; }
	.footer-grid { grid-template-columns: 1fr; }
	.address-strip .strip-alt { display: none; }
	.address-strip .frame { justify-content: space-between; column-gap: .75rem; padding-block: .625rem; }
	.strip-label { font-size: .875rem; }
	.strip-value { display: block; margin-left: 0; font-size: 1.25rem; }
	.strip-status { order: 3; flex-basis: 100%; }
	.address-strip .button { min-width: 8.75rem; padding-inline: .625rem; }
}


/* =====================================================================
   Theme additions: WordPress content, archives, search, 404
   ===================================================================== */

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* keep the footer at the bottom of short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* lede made from the opening paragraph of a post */
div.lede > p { margin: 0; }
.lede a { color: var(--engrave); }

/* status when the last check is older than the freshness window */
.status[data-status="unknown"] .status-dot { background: #8A90A0; box-shadow: 0 0 0 3px rgba(138, 144, 160, .2); }

/* byline and author card link to the author archive */
.byline a { color: var(--ink); font-weight: 600; text-decoration: none; }
.byline a:hover { text-decoration: underline; }
.author-name a { color: var(--ink); text-decoration: none; }
.author-name a:hover { text-decoration: underline; }

/* ---------- Post content inside the sheets ---------- */
.section > :first-child { margin-top: 0; }
.section ol:not([class]) { list-style: none; counter-reset: step; padding: 0; margin: 0 0 var(--space-3); }
.section ol:not([class]) > li { counter-increment: step; position: relative; padding: .875rem 0 .875rem 3.25rem; border-top: 1px solid var(--rule-soft); }
.section ol:not([class]) > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.section ol:not([class]) > li::before {
	content: counter(step);
	position: absolute; left: 0; top: .7rem;
	font: 600 1.75rem/1 var(--serif);
	font-variant-numeric: lining-nums;
	color: var(--gold-deep);
	width: 2rem; text-align: right;
}
.section > ul:not([class]) { padding-left: 1.25rem; margin: 0 0 var(--space-2); }
.section > ul:not([class]) li { margin-bottom: .5rem; padding-left: .25rem; }
.section > ul:not([class]) li::marker { color: var(--gold-deep); }
.section blockquote { margin: var(--space-3) 0; border-left: 3px solid var(--gold); padding: .25rem 0 .25rem 1.125rem; color: var(--slate); }
.section blockquote p:last-child { margin-bottom: 0; }
.section hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-4) 0; }
.section code { font-size: .9em; }

/* tables from the editor: block tables and bare tables both scroll sideways inside the sheet.
   content_parts() marks the ones that span the sheet with .wide. */
.wp-block-table, .table-scroll {
	margin: var(--space-3) 0; border: 1px solid var(--rule); background: var(--sheet);
	max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.wp-block-table .table-scroll { margin: 0; border: 0; }
.wp-block-table figcaption { font-size: var(--step--1); color: #3E4456; padding: .625rem 1.125rem; border-top: 1px solid var(--rule-soft); margin: 0; }
.section > .wp-block-table:last-child, .section > .table-scroll:last-child { margin-bottom: 0; }
.wp-block-table table, .table-scroll table { margin: 0; }
tbody th.wrap { white-space: normal; }
tbody th a { font-weight: 600; }
/* a scroll box whose table is wider than the sheet fades out at the edge it can scroll to (site.js) */
.wp-block-table[data-overflow="true"], .table-scroll[data-overflow="true"] {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
}
thead th, thead td { font-weight: 600; font-size: var(--step--1); color: var(--slate); border-bottom: 1px solid var(--rule); text-align: left; }
tbody td:first-child { font-weight: 600; }
td a, th a { overflow-wrap: anywhere; }

/* images */
.section figure { margin: var(--space-3) 0; }
.section figure img, .section > p > img, .section > p > a > img { border: 1px solid var(--rule); }
.section figcaption { font-size: var(--step--1); color: #3E4456; margin-top: .625rem; line-height: 1.5; }
.section .wp-block-image a { display: block; }
.alignleft { float: left; margin: .25rem var(--space-3) var(--space-2) 0; }
.alignright { float: right; margin: .25rem 0 var(--space-2) var(--space-3); }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
iframe, video, embed { max-width: 100%; }

/* author section: card in the text column, related posts in the margin */
.author-bio { color: var(--slate); }
.related time { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Address strip placed inside content (pages, shortcode) ---------- */
.address-strip-inline { border: 1px solid var(--rule); border-top: 2px solid var(--gold); margin: var(--space-3) 0; grid-column: 1 / -1; container-type: inline-size; }
/* not enough room for all four parts on one line: the permanent address takes its own line */
/* next to a margin note the strip keeps to the text column */
.section:has(> .margin) > .address-strip-inline { grid-column: 1; }
@container (max-width: 68rem) {
	.address-strip-inline .strip-alt { flex-basis: 100%; margin-left: 0; }
}
.address-strip-inline .strip-inner { display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; padding: .875rem 1.125rem; font-size: 1rem; }
.address-strip-inline .strip-alt { color: var(--slate); font-size: var(--step--1); margin-left: auto; }
.address-strip-inline .button { min-height: 2.75rem; min-width: 9.5rem; padding: .375rem 1rem; font-size: .9375rem; }
.address-strip .strip-status { margin: 0; }

/* ---------- Post list: archives, search, author ---------- */
.list-sheet { display: block; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); align-items: baseline;
	padding-block: var(--space-3); border-top: 1px solid var(--rule-soft);
}
.post-item:first-child { border-top: 0; padding-top: 0; }
.post-item:last-child { padding-bottom: 0; }
.post-item-title { font: 600 var(--step-1)/1.3 var(--serif); margin: 0; max-width: 40rem; letter-spacing: 0; }
.post-item-title a { color: var(--ink); text-decoration: none; }
.post-item-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.post-item-excerpt { grid-column: 1; margin: .5rem 0 0; color: var(--slate); font-size: 1rem; max-width: 40rem; }
.post-item-date { grid-column: 2; grid-row: 1; margin: 0; font-size: var(--step--1); color: var(--slate); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.list-count { margin: 0 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--ink); font-size: var(--step--1); color: var(--slate); }

.pagination { margin-top: var(--space-3); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .25rem .875rem;
	background: var(--sheet); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-variant-numeric: lining-nums tabular-nums;
}
.pagination a.page-numbers:hover { border-color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-numbers.dots { background: none; border-color: transparent; }

/* search form */
.search-form { display: flex; gap: .75rem; flex-wrap: wrap; max-width: 34rem; margin: var(--space-3) 0 0; }
.search-form input[type="search"] {
	flex: 1 1 14rem; min-width: 0; min-height: 3rem; padding: .5rem .875rem;
	font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--sheet);
	border: 1px solid #8A90A0; border-radius: 3px;
}
.search-form input[type="search"]:focus-visible { outline: 2px solid var(--engrave); outline-offset: 1px; border-color: var(--engrave); }
.section .search-form { margin-top: var(--space-2); }

/* 404: the most important pages as a ledger */
.statement .page-index { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.statement .page-index li { margin: 0; padding-left: 0; display: grid; grid-template-columns: 14rem 1fr; gap: .25rem var(--space-3); padding-block: .875rem; border-top: 1px solid var(--rule-soft); }
.statement .page-index li:last-child { border-bottom: 1px solid var(--rule-soft); }
.statement .page-index a { font: 600 1.125rem/1.3 var(--serif); text-decoration: none; }
.statement .page-index a:hover { text-decoration: underline; }
.statement .page-index span { color: var(--slate); font-size: 1rem; }

/* opening paragraphs that lead into the first sheet sit above its heading */
.section > * + h2 { margin-top: var(--space-5); }

/* margin note listing the sheets of a long post */
.contents-list { list-style: none; margin: 0; padding: 0; counter-reset: contents; }
.contents-list li { counter-increment: contents; display: grid; grid-template-columns: 1.5rem 1fr; padding-block: .5rem; border-top: 1px solid var(--rule-soft); }
.contents-list li::before { content: counter(contents); font: 600 1rem/1.4 var(--serif); color: var(--gold-deep); font-variant-numeric: lining-nums; }
.contents-list a { color: var(--ink); text-decoration: none; font-size: 1rem; line-height: 1.4; }
.contents-list a:hover { text-decoration: underline; }

/* notes written in the post content (aside): a dl of dt/dd pairs without row wrappers */
.note dl.ledger:not(:has(.ledger-row)) { margin: 0 0 .5rem; }
.note dl.ledger:not(:has(.ledger-row)) dt { font-size: .875rem; color: #3E4456; padding-top: .5rem; }
.note dl.ledger:not(:has(.ledger-row)) dd { color: var(--ink); font-size: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule-soft); }
.note dl.ledger:not(:has(.ledger-row)) dd:last-child { border-bottom: 0; padding-bottom: 0; }
.note .note-figure a { color: inherit; text-decoration: none; }
/* notes written in the post content (aside) */
.section > aside.note > :last-child { margin-bottom: 0; }
.note ul { padding-left: 1.125rem; margin: 0 0 .5rem; }
.note ul li { margin-bottom: .25rem; }

/* questions sheet: h3 questions read like the questions list of the design */
.questions-sheet h3 { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--rule-soft); scroll-margin-top: 1.5rem; }
.questions-sheet > h3:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.questions-sheet h3 + p { margin-top: .5rem; }
.questions-sheet h3:target { color: var(--engrave); }

/* author sheet without related posts: a smaller head, the card is the content */
.author-section:not(:has(> .margin)) h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }

/* footer: addresses at the same rhythm as the links, site documents in one row with the copyright */
.footer-addresses li { padding-block: .5625rem; }
.footer-addresses li a { display: inline; padding: 0; }
.legal { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; }
.legal p { margin: 0; }
.legal-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-footer .legal-nav li a { padding-block: .75rem; color: #C9C4E0; }

@media (max-width: 960px) {
	tbody th { white-space: normal; }
}
@media (max-width: 640px) {
	.address-strip-inline .strip-inner { justify-content: space-between; column-gap: .75rem; padding: .75rem .875rem; }
	.address-strip-inline .strip-alt { display: none; }
	.address-strip-inline .button { min-width: 8.75rem; padding-inline: .625rem; }
	.wp-block-table table:not(.table-stack):has(tr > :nth-child(3)), .table-scroll table:not(.table-stack):has(tr > :nth-child(3)) { min-width: 28rem; }
	.table-stack tbody tr:nth-child(even) { background: #FAFBFC; }
	/* a trail with only the home link left adds nothing above the H1 */
	.trail:not(:has(li:nth-child(3))) { display: none; }
	.post-item { grid-template-columns: minmax(0, 1fr); padding-block: var(--space-2); }
	.post-item-date { grid-column: 1; grid-row: auto; margin-top: .375rem; }
	.post-item-title { font-size: 1.1875rem; }
	.statement .page-index li { grid-template-columns: 1fr; gap: .125rem; }
	/* the H1 right below already names the page */
	.trail li[aria-current="page"]:not(:first-child) { display: none; }
	.alignleft, .alignright { float: none; margin: var(--space-2) 0; }
}

/* ---------- Statement with a page margin: posts, pages, archives, search, 404 ----------
   Wide screens: the sheets on the left, the page margin (aside.page-margin) on the right,
   starting level with the first sheet. The margin is one long sheet of the same paper:
   its first part (.margin-follow) stays in view while reading, the rest (.margin-end)
   closes the column next to the end of the sheets. Small screens: everything in the flow. */
:root { --margin-col: clamp(16rem, 24vw, 21rem); }

.sheets { min-width: 0; }
.page-margin {
	display: flex; flex-direction: column; gap: var(--space-5);
	background: var(--sheet); border: 1px solid var(--rule);
	padding: var(--space-4) var(--space-3);
	min-width: 0;
}
.margin-start, .margin-follow, .margin-end { display: flex; flex-direction: column; gap: var(--space-5); }
.page-margin .note { border-top-width: 2px; }
.page-margin h2.note-title { max-width: none; letter-spacing: 0; text-wrap: pretty; }
.page-margin .note p { margin: 0 0 .5rem; }
.page-margin .description-note p { font-size: 1rem; line-height: 1.55; color: var(--slate); }
.page-margin .ledger-row:first-child { padding-top: 0; }
.page-margin .ledger dd { overflow-wrap: anywhere; }
.page-margin .related a { font-size: 1rem; line-height: 1.35; }
.page-margin .related li { padding: .625rem 0 !important; }
.page-margin .related li:last-child { border-bottom: 0; padding-bottom: 0 !important; }
.page-margin .related span { margin-top: .125rem; }

/* category list with post counts: name on the left, count on the right */
.count-links .related li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.count-links .related span { flex: none; margin: 0; font-variant-numeric: lining-nums tabular-nums; }

/* contents in the margin: the sheet in view is marked (site.js); without script a plain list */
.contents-margin .contents-list li { position: relative; }
.contents-margin .contents-list li::after {
	content: ""; position: absolute; top: .5rem; bottom: .5rem; left: calc(-1 * var(--space-3) - 1px);
	width: 3px; background: transparent;
}
.contents-margin .contents-list a[aria-current="location"] { color: var(--engrave); }
.contents-margin .contents-list li:has(a[aria-current="location"])::after { background: var(--gold); }
.contents-margin .contents-list li:has(a[aria-current="location"])::before { color: var(--engrave); }
@media (prefers-reduced-motion: no-preference) {
	.contents-margin .contents-list a { transition: color .15s; }
	.contents-margin .contents-list li::after { transition: background-color .15s; }
}

/* list sheets on the 404 page carry their own heading */
.list-title { font-size: var(--step-2); margin-bottom: var(--space-3); }
.search-sheet .search-form { margin-top: 0; }

@media (min-width: 961px) {
	.statement.with-margin {
		display: grid; grid-template-columns: minmax(0, 1fr) var(--margin-col);
		column-gap: var(--space-4); align-items: stretch;
	}
	.margin-track { flex: 1 0 auto; }
	/* list pages: the rest of the margin follows straight on, no empty band above it */
	.margin-track.margin-compact { flex: none; }
	.margin-follow { position: sticky; top: 1.5rem; }
	/* on a short screen the following part scrolls inside itself instead of running off the bottom;
	   the padding keeps the current-section rule of the contents inside the scroll box */
	.margin-follow {
		max-height: calc(100vh - 3rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
		margin-inline: calc(-1 * var(--space-3)) -.25rem; padding-inline: var(--space-3) .25rem;
	}
	/* the last sheet reaches the foot of the margin, so no bare desk shows beside it */
	.with-margin .sheets { display: flex; flex-direction: column; }
	.with-margin .sheets > section.section:last-of-type { flex: 1 0 auto; }

	/* inside the sheets column every sheet is one text column; notes written in the content sit in the flow */
	.with-margin .section { grid-template-columns: minmax(0, 1fr); background-image: none; }
	.with-margin .section > .margin,
	.with-margin .section > .margin-short { position: static; grid-column: 1; grid-row: auto; margin: 0 0 var(--space-3); max-width: 34rem; }
	.with-margin .section > .margin:last-child { margin-bottom: 0; }
	.with-margin .section > .wide { grid-column: 1; }

	/* the margin carries these on wide screens */
	.contents-inline, .related-inline, .lede-flow { display: none; }
	.author-section h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
}
@media (max-width: 960px) {
	.page-margin { margin-top: var(--space-3); }
	.contents-margin, .related-margin, .description-note { display: none; }
	/* the track keeps only links that the flow does not repeat (the pages' other documents) */
	.margin-track:has(.contents-margin):not(:has(.links:not(.related-margin))) { display: none; }
	.page-margin .note { max-width: 34rem; }
}
@media (max-width: 640px) {
	.page-margin { margin-top: var(--space-2); margin-inline: -1rem; border-inline: 0; padding: var(--space-3) 1rem; }
}
