/* antoniocosta.me
 *
 * One stylesheet for every variant of the site. The markup describes content
 * (sections, titles, rows with a label and optional details), and three
 * attributes on <html> choose how it looks:
 *
 *   data-theme   light | dark          (none: follow the system)
 *   data-font    inter | open-sans | instrument   (none: Inter)
 *   data-layout  shelves | ledger      (none: shelves)
 *
 * Order: Fonts, tokens, themes, base, components, layouts, the draft effect.
 */

/* ************** Fonts ************** */

/* Self-hosted variable fonts, Latin only, all under the SIL Open Font License
   (fonts/README.md). A browser downloads a file only when the page uses it. */
@font-face {
	font-family: "Open Sans";
	src: url("fonts/open-sans.woff2") format("woff2");
	font-style: normal;
	font-weight: 300 800;
	font-display: swap;
	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: "Open Sans";
	src: url("fonts/open-sans-italic.woff2") format("woff2");
	font-style: italic;
	font-weight: 300 800;
	font-display: swap;
	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";
	src: url("fonts/inter.woff2") format("woff2");
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	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 Tight";
	src: url("fonts/inter-tight.woff2") format("woff2");
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	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: "Instrument Sans";
	src: url("fonts/instrument-sans.woff2") format("woff2");
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	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;
}

/* ************** Tokens ************** */

:root {
	/* Type: The faces, and the scale every component draws from */
	--font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--font-display: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
	--weight-display: 300;
	--weight-body: 450;
	--weight-label: 600;
	--fs-display: calc(1.4rem + 1.2vw);   /* the headline */
	--fs-lead: 1.2rem;                    /* the About sentence */
	--fs-body: 1rem;
	--fs-label: 0.8rem;                   /* section titles */
	--fs-small: 0.83rem;                  /* footer, row details */
	--lh-display: 1.5;
	--lh-body: 1.4;
	--track-label: 0.02em;

	/* Space */
	--page-pad: 1.6rem;       /* around the page */
	--gap: 2rem;              /* between sections */
	--item-gap: 0.4rem;       /* between rows in a list */
	--content-max: 800px;
	--masthead-min: 50vh;
	--footer-gap: clamp(24px, 3vw, 48px);   /* between footer links, as holyokehirsch.com */
	--ledger-gutter: clamp(16px, 3vw, 40px);         /* the ledger's one page margin */
	--ledger-split: minmax(0, 1fr) minmax(0, 4fr);   /* its label and content columns */
	--ledger-gap: clamp(56px, 7vw, 112px);           /* between its sections */
	--ledger-column-gap: clamp(16px, 2vw, 32px);
	--ledger-fs: clamp(17px, 1.4vw, 20px);           /* its one type size */

	/* Lines */
	--rule: 2px;              /* the line over each section */
	--hairline: 1px;          /* lines between rows, where a layout draws them */

	/* Motion */
	--fade: 0.18s;

	/* Colour, light (the default) */
	--bg: #e9e9e8;
	--text: #60666f;
	--text-strong: #000;      /* links, the logo, the theme button */
	--text-label: #444;       /* section titles */
	--text-soft: #8b9097;     /* quieter than the text: the ledger's labels and numbers */
	--accent: #eeff41;        /* link highlight, selection */
	--invert-bg: #111;        /* the headline link's hover fill */
	--invert-text: #e9e9e8;
	--line: #53585f;
}

/* ************** Themes ************** */

/* Dark: Follows the system unless the toggle chose light, or set by the toggle */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #1a1a1a;
		--text: #b0b5bc;
		--text-strong: #fff;
		--text-label: #bbb;
		--text-soft: #7c8189;
		--accent: #535729;
		--invert-bg: #e9e9e8;
		--invert-text: #1a1a1a;
		--line: #b0b5bc;
	}
}
:root[data-theme="dark"] {
	--bg: #1a1a1a;
	--text: #b0b5bc;
	--text-strong: #fff;
	--text-label: #bbb;
	--text-soft: #7c8189;
	--accent: #535729;
	--invert-bg: #e9e9e8;
	--invert-text: #1a1a1a;
	--line: #b0b5bc;
}

/* Fonts the address or the preview page can switch to (index.js reads ?font=) */
:root[data-font="open-sans"] {
	--font-body: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--font-display: var(--font-body);
	--weight-body: 400;
	--weight-label: 700;
}
:root[data-font="instrument"] {
	--font-body: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--font-display: var(--font-body);
	--weight-display: 400;
	--weight-label: 600;
}

/* ************** Base ************** */

html {
	font-size: 94%;
	overflow-x: clip; /* Never scroll sideways */
	touch-action: manipulation;
	background: var(--bg);
}
body {
	margin: var(--page-pad);
	padding: 0;
	color: var(--text);
	font-family: var(--font-body);
	font-weight: var(--weight-body);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure {
	margin: 0;
	padding: 0;
}
ul, ol {
	list-style: none;
}
b, strong {
	font-weight: 700;
}
small {
	font-size: var(--fs-small);
	line-height: 1.5;
}

/* Links: A highlight sweeps in from the left on hover */
a {
	color: var(--text-strong);
	text-decoration: none;
	background: linear-gradient(to right, var(--accent), var(--accent)) repeat-y;
	background-size: 0%;
	transition: background-size var(--fade), color var(--fade);
}
a:hover {
	background-size: 100%;
}

/* The highlighted link: Sits on the highlight, and fills dark on hover */
a.highlight {
	background: linear-gradient(to right, var(--invert-bg), var(--invert-bg)) repeat-y, var(--accent);
	background-size: 0%, 100%;
}
a.highlight:hover {
	background-size: 100%, 100%;
	color: var(--invert-text);
}
.highlight {
	background: var(--accent);
}

::selection {
	background: var(--accent);
	color: var(--text);
}

/* ************** Components ************** */

/* Masthead: The logo and theme button over the headline */
.masthead {
	position: relative;
	min-height: var(--masthead-min);
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: 2.2rem;
	margin-bottom: 0.6rem;
}
.masthead__inner {
	width: 100%;
	max-width: var(--content-max);
	/* No side padding: Its edges are the sections' edges, at every width */
	padding: var(--page-pad) 0;
}
/* The logo and theme button sit up top, as in the ledger, at the sections' width */
.masthead__top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	max-width: var(--content-max);
	margin-left: auto;
	margin-right: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.6rem;
}
.masthead__logo {
	display: block;
	width: 40px;
	height: auto;
}
.masthead__logo path {
	fill: var(--text-strong);
}
.masthead__title {
	margin: 1.6rem 0;
	font-family: var(--font-display);
	font-weight: var(--weight-display);
	font-size: var(--fs-display);
	line-height: var(--lh-display);
	color: var(--text);
}

/* Theme button: Shows the current mode, Auto (system), light or dark */
.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	/* A comfortable tap area, pulled back by its own padding so the icon itself lines
	   up with the right edge and sits on the logo's centre line */
	padding: 0.5rem;
	margin: -0.5rem -0.5rem -0.5rem 0;
	border: 0;
	background: none;
	color: var(--text-strong);
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s;
}
.theme-toggle:hover {
	opacity: 1;
}
.theme-toggle__icon {
	display: block;
	width: 20px;
	height: 20px;
}
.theme-toggle__icon--sun,
.theme-toggle__icon--moon,
:root[data-theme] .theme-toggle__icon--auto {
	display: none;
}
:root[data-theme="light"] .theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle__icon--moon {
	display: block;
}

/* Section: A rule, a title, then its content (a lead, a list, or both) */
.section {
	min-width: 0;
	overflow-wrap: break-word;
	align-self: start; /* the masonry needs each section at its own height */
}
.section__rule {
	display: block;
	height: var(--rule);
	margin: 0 0 0.6rem;
	border: 0;
	background: var(--line);
}
.section__title {
	margin: 0 0 1rem;
	font-size: var(--fs-label);
	font-weight: var(--weight-label);
	letter-spacing: var(--track-label);
	text-transform: uppercase;
	color: var(--text-label);
}
.section__lead {
	margin: var(--item-gap) 0 1em;
	font-size: var(--fs-lead);
	font-weight: var(--weight-body);
}

/* List: Rows of a label, and optional details (a year, a role) that a layout may show.
   A row is its number (.list__no), its label (.list__label), then its fields as cells
   (.list__cell). Shelves show the label and the detail. The ledger shows them all. */
.list__item {
	margin: var(--item-gap) 0;
}
.list__head,
.list__no,
.list__cell:not(.list__detail) {
	display: none;
}
.list__detail {
	font-size: var(--fs-small);
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

/* Prose: Paragraphs of running text, at a readable measure */
.prose {
	max-width: 62ch;
}
.prose p + p {
	margin-top: 0.9em;
}

/* Gallery: A grid of photos with captions. As many columns as fit the space it has:
   One in a shelf, several in a wide section or the ledger's content column. */
.section--wide {
	grid-column: 1 / -1;
}
.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
	gap: var(--gap) calc(var(--gap) * 0.75);
}
.shot img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--line);
}
.shot a {
	display: block;
	background: none;
}
.shot figcaption {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0 12px;
	padding: 8px 0 6px;
	border-bottom: var(--hairline) solid var(--line);
	font-size: var(--fs-small);
}
.shot__year {
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}
.shot__credit {
	flex-basis: 100%;
	margin-top: 4px;
	opacity: 0.8;
}

/* Drawer: A row with more opens it under the row (index.js). Ledger only: Shelves stay minimal */
.list__toggle,
.list__drawer {
	display: none;
}
.list__toggle {
	margin-left: 0.5em;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: var(--fs-small);
	color: var(--text-strong);
	cursor: pointer;
}
/* Icons sit on the text like a letter, one em square */
.icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.14em;
}
/* The down arrow turns up when the row is open */
.list__arrow {
	display: inline-block;
	margin-left: 0.25em;
	transition: transform var(--fade);
}
.list__item.is-open .list__arrow {
	transform: rotate(180deg);
}
.list__drawer {
	margin: 0.6rem 0 1.2rem;
}
/* The drawer's facts (place, projects) as label and value, then its notes */
.list__facts {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 2px 16px;
	margin: 0 0 0.6em;
}
.list__facts div {
	display: contents;
}
.list__facts dt {
	color: var(--text-soft);
}
.list__facts dd {
	margin: 0;
}
.list__notes p {
	max-width: 62ch;
	margin: 0 0 0.6em;
}
.list__go {
	display: none;
}
.list__strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
}
.list__strip img {
	flex: none;
	height: clamp(160px, 22vw, 320px);
	width: auto;
	scroll-snap-align: start;
	background: var(--line);
}

/* Footer. Shelves (attentionshoppers.net): A thick rule, then the links and the end, small.
   The ledger shows the label, the links and the copyright instead (below). */
.footer {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 24px;
	max-width: var(--content-max);
	margin: 100px auto 0;
	padding: 16px 0 48px;
	border-top: 3px solid var(--line);
}
.footer p {
	max-width: 60ch;
}
.footer__end {
	white-space: nowrap;
}
/* Shelves: The links and the end spread evenly across the footer */
.footer__links {
	display: contents;
}
.footer__label,
.footer__copyright {
	display: none;
}
@media (max-width: 600px) {
	.footer {
		flex-direction: column;
		gap: 8px;
	}
}

/* Sections a layout leaves out (content/site.json layouts.<layout>.hidden) */
:root:not([data-layout="ledger"]) [data-hide~="shelves"],
:root[data-layout="ledger"] [data-hide~="ledger"] {
	display: none;
}

/* ************** Layouts ************** */

/* Shelves (the default): Columns of sections, balanced by masonry (index.js does it
   where the browser cannot). Sections fill row by row, so the nth in order goes
   under the (n - columns)th, and each column count has its own order. On phones
   (1 column) the order is the sections' own, in content/site.json. */
.sections {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* 1 column: The HTML order */
	grid-template-rows: masonry;
	gap: var(--gap);
	max-width: var(--content-max);
	margin: auto;
}
/* The orders come from content/site.json (layouts.shelves): The build puts them on each
   section as --o2 and --o3 */
@media (min-width: 481px) and (max-width: 719.98px) {
	.sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.section { order: var(--o2, 0); }
}
@media (min-width: 720px) {
	.sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.section { order: var(--o3, 0); }
}

/* Ledger (holyokehirsch.com): The whole page is one frame, full width inside a single
   gutter. The header, every section and the footer share one grid, a label column and a
   content column at 1:4, so every label starts at the same place and every content
   column lines up. One type size throughout: Labels differ by colour only. Rows are a
   table filling the content column. The order comes from content/site.json as --ol. */
:root[data-layout="ledger"] body {
	margin: 0;
	padding: 0 var(--ledger-gutter) var(--ledger-gutter);
	font-size: var(--ledger-fs);
	line-height: 1.4;
}
:root[data-layout="ledger"] .masthead__inner,
:root[data-layout="ledger"] .section,
:root[data-layout="ledger"] .footer {
	display: grid;
	grid-template-columns: var(--ledger-split);
	column-gap: var(--ledger-column-gap);
	row-gap: 8px;
	max-width: none;
	margin: 0;
	padding: 0;
}
:root[data-layout="ledger"] .masthead {
	display: block;
	min-height: 0;
	margin: 0 0 var(--ledger-gap);
	padding: var(--ledger-gutter) 0 0;
}
:root[data-layout="ledger"] .masthead__top {
	position: static;
	max-width: none;
	grid-column: 1 / -1;
	margin: 0 0 var(--ledger-gap);
}
:root[data-layout="ledger"] .masthead__title {
	grid-column: 2;
	max-width: 32ch;
	margin: 0;
	font: inherit;
	/* The headline at twice the ledger's one size */
	font-size: calc(var(--ledger-fs) * 2);
	line-height: 1.2;
}
:root[data-layout="ledger"] .sections {
	display: flex;
	flex-direction: column;
	gap: var(--ledger-gap);
	max-width: none;
	margin: 0;
}
:root[data-layout="ledger"] .section {
	order: var(--ol, 0);
	align-self: stretch; /* full width: every section's columns at the same place */
	align-items: baseline;
	margin: 0 !important; /* the masonry script's offsets belong to shelves */
}
:root[data-layout="ledger"] .section__rule {
	display: none;
}
:root[data-layout="ledger"] .section__title {
	grid-column: 1;
	grid-row: 1 / span 2;
	margin: 0;
	font: inherit;
	letter-spacing: 0;
	text-transform: none;
	color: var(--text-soft);
}
:root[data-layout="ledger"] .section__lead,
:root[data-layout="ledger"] .prose,
:root[data-layout="ledger"] .gallery,
:root[data-layout="ledger"] .list {
	grid-column: 2;
}
/* Text sections sit between the same lines as a row: The lines run the full width, the
   text keeps a readable measure */
:root[data-layout="ledger"] .section__lead,
:root[data-layout="ledger"] .prose {
	max-width: none;
	margin: 0;
	padding: 4px max(0px, calc(100% - 62ch)) 4px 0;
	font-size: inherit;
	border-top: var(--hairline) solid var(--line);
	border-bottom: var(--hairline) solid var(--line);
}
/* A lead over a list shares the list's top line */
:root[data-layout="ledger"] .section__lead + .list {
	border-top: 0;
}
/* Column widths every list shares, so columns line up from one section to the next. A
   column grows past its share only when its text would not fit on one line. */
:root[data-layout="ledger"] {
	--c-label: minmax(6em, 1fr);
	--c-mid: minmax(max-content, 40%);
	/* Two middle columns split the middle share exactly, at every width */
	--c-sub: minmax(0, 10em);
	--c-rest: minmax(0, calc(40% - 10em));
	--c-last: minmax(max-content, 7em);
	--c-end: 1.5em;
}
/* Below 1280px the longest role would not fit its share on one line: Text wraps instead,
   so the shares hold and columns line up across sections at every width */
@media (max-width: 1279.98px) {
	:root[data-layout="ledger"] {
		--c-mid: minmax(0, 40%);
	}
}
/* Rows as a table: The number, the label, then one column per cell, aligned across rows */
:root[data-layout="ledger"] .list {
	display: grid;
	/* The build writes each list's columns: The number, the label, one per cell */
	grid-template-columns: var(--ledger-cols, minmax(0, 1fr));
	border-top: var(--hairline) solid var(--line);
}
/* Numbering: Per section from the data (.list--numbered), or for every list by the switch */
:root[data-layout="ledger"] .list--numbered,
:root[data-layout="ledger"][data-numbers="on"] .list {
	grid-template-columns: 3em var(--ledger-cols, minmax(0, 1fr));
}
:root[data-layout="ledger"][data-numbers="off"] .list {
	grid-template-columns: var(--ledger-cols, minmax(0, 1fr));
}
:root[data-layout="ledger"] .list:not(.list--numbered) .list__no,
:root[data-layout="ledger"][data-numbers="off"] .list .list__no {
	display: none;
}
:root[data-layout="ledger"][data-numbers="on"] .list .list__no {
	display: block;
}
:root[data-layout="ledger"] .list__item,
:root[data-layout="ledger"] .list__head {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	column-gap: 16px;
	align-items: baseline;
	margin: 0;
	padding: 4px 0;
	border-bottom: var(--hairline) solid var(--line);
}
:root[data-layout="ledger"] .list__no,
:root[data-layout="ledger"] .list__cell {
	display: block;
	font-size: inherit;
	opacity: 1;
	font-variant-numeric: tabular-nums;
}
:root[data-layout="ledger"] .list__no {
	padding-left: 4px;
	color: var(--text-soft);
}
/* The last column keeps off the row's edge, as the number does on the left */
:root[data-layout="ledger"] .list__cell--last {
	padding-right: 4px;
}
/* Wide screens: Field columns keep each value on one line */
@media (min-width: 1280px) {
	:root[data-layout="ledger"] .list__cell {
		white-space: nowrap;
	}
}
/* The header row: The column names, in the label colour, with no line above them */
:root[data-layout="ledger"] .list:has(> .list__head) {
	border-top: 0;
}
:root[data-layout="ledger"] .list__head {
	padding-top: 0;
	color: var(--text-soft);
}
:root[data-layout="ledger"] .list__head .list__cell {
	display: block;
}
:root[data-layout="ledger"] .footer {
	margin-top: var(--ledger-gap);
	padding: 0;
	border: 0;
	font-size: inherit;
	align-items: baseline;
}
/* The footer (holyokehirsch.com): The label, then the links in a line and the copyright at its end */
:root[data-layout="ledger"] .footer__end {
	display: none;
}
:root[data-layout="ledger"] .footer__label {
	display: block;
	grid-column: 1;
	margin: 0;
	font: inherit;
	color: var(--text-soft);
}
:root[data-layout="ledger"] .footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--footer-gap);
	grid-column: 2;
	grid-row: 1;
}
:root[data-layout="ledger"] .footer__copyright {
	display: block;
	grid-column: 2;
	grid-row: 1;
	justify-self: end;
	max-width: none;
	color: var(--text-soft);
}
/* The whole row is the link: It highlights end to end on hover, and a click anywhere on
   it follows the link (or opens its images) */
:root[data-layout="ledger"] .list__item {
	position: relative;
	/* The same sweep as a link, across the whole row */
	background: linear-gradient(to right, var(--accent), var(--accent)) no-repeat;
	background-size: 0% 100%;
	transition: background-size var(--fade), color var(--fade);
}
:root[data-layout="ledger"] .list__item:has(a, .list__toggle):hover,
:root[data-layout="ledger"] .list__item.is-open {
	background-size: 100% 100%;
	color: var(--text-strong);
}
:root[data-layout="ledger"] .list__item:has(a, .list__toggle):hover .list__no {
	color: inherit;
}
:root[data-layout="ledger"] .list__item a {
	background: none;
}
:root[data-layout="ledger"] .list__item a::after,
:root[data-layout="ledger"] .list__item .list__toggle::before {
	content: "";
	position: absolute;
	inset: 0;
}
:root[data-layout="ledger"] .list__toggle,
:root[data-layout="ledger"] .list__go {
	display: block;
	justify-self: end;
	margin: 0;
	padding-right: 4px;
	font-size: inherit;
	color: inherit;
}
/* Arrows: Down opens the row, out leaves for another site */
:root[data-layout="ledger"] .list__toggle-text {
	display: none;
}
:root[data-layout="ledger"] .list__arrow {
	margin-left: 0;
}
/* A row does one thing: A row that opens only opens (its site is linked inside), any
   other row follows its link */
:root[data-layout="ledger"] .list__item.has-drawer a {
	pointer-events: none;
}
:root[data-layout="ledger"] .list__item.has-drawer a::after {
	content: none;
}
/* The drawer slides open: Its one row grows from nothing to its content's height */
:root[data-layout="ledger"] .list__drawer:not([hidden]) {
	display: grid;
}
:root[data-layout="ledger"] .list__drawer {
	grid-column: 1 / -1;
	grid-template-rows: 0fr;
	margin: 0;
	padding: 0;
	border-bottom: var(--hairline) solid var(--line);
	transition: grid-template-rows 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
:root[data-layout="ledger"] .list__drawer.is-open {
	grid-template-rows: 1fr;
}
:root[data-layout="ledger"] .list__more {
	min-height: 0;
	overflow: hidden;
	padding: 12px 4px 16px;
	opacity: 0;
	transition: opacity 0.3s;
}
:root[data-layout="ledger"] .list__drawer.is-open .list__more {
	opacity: 1;
	transition-delay: 0.1s;
}
/* In a numbered list the drawer starts under the label */
:root[data-layout="ledger"] .list--numbered .list__more {
	padding-left: calc(3em + 16px);
}
@media (prefers-reduced-motion: reduce) {
	:root[data-layout="ledger"] .list__drawer,
	:root[data-layout="ledger"] .list__more {
		transition: none;
	}
}
/* Browsers without subgrid: Each row lines up on its own */
@supports not (grid-template-columns: subgrid) {
	:root[data-layout="ledger"] .list__item {
		display: flex;
		gap: 16px;
	}
	:root[data-layout="ledger"] .list__no {
		flex: 0 0 3em;
	}
	:root[data-layout="ledger"] .list__label {
		flex: 1;
	}
	:root[data-layout="ledger"] .list__cell {
		flex: 0 0 18%;
	}
}
/* Narrow: The label stacks over its content */
@media (max-width: 760px) {
	:root[data-layout="ledger"] .masthead__inner,
	:root[data-layout="ledger"] .section,
	:root[data-layout="ledger"] .footer {
		grid-template-columns: minmax(0, 1fr);
	}
	:root[data-layout="ledger"] .masthead__title,
	:root[data-layout="ledger"] .section__title,
	:root[data-layout="ledger"] .section__lead,
	:root[data-layout="ledger"] .list,
	:root[data-layout="ledger"] .footer__links,
	:root[data-layout="ledger"] .footer__copyright {
		grid-column: 1;
		grid-row: auto;
		justify-self: start;
	}
	/* The footer links stack, with the copyright under them */
	:root[data-layout="ledger"] .footer__links {
		flex-direction: column;
		gap: 6px;
	}
	:root[data-layout="ledger"] .footer__copyright {
		margin-top: 10px;
	}
	/* Tables collapse: The number, the label and the last column on one line, the other
	   columns as softer lines under the label. The header row goes. */
	:root[data-layout="ledger"] .list {
		display: block;
		justify-self: stretch;
	}
	:root[data-layout="ledger"] .list__head {
		display: none;
	}
	/* Without the header row, the first row gets its line above back */
	:root[data-layout="ledger"] .list:has(> .list__head) {
		border-top: var(--hairline) solid var(--line);
	}
	:root[data-layout="ledger"] .list__item {
		grid-template-columns: [main] minmax(0, 1fr) [end] auto [go] auto;
		column-gap: 12px;
		padding: 6px 4px;
	}
	:root[data-layout="ledger"] .list--numbered .list__item,
	:root[data-layout="ledger"][data-numbers="on"] .list .list__item {
		grid-template-columns: [no] 2.2em [main] minmax(0, 1fr) [end] auto [go] auto;
	}
	:root[data-layout="ledger"][data-numbers="off"] .list .list__item {
		grid-template-columns: [main] minmax(0, 1fr) [end] auto [go] auto;
	}
	:root[data-layout="ledger"] .list__no {
		grid-column: no;
		grid-row: 1 / span 2;
		padding-left: 0;
	}
	:root[data-layout="ledger"] .list__label {
		grid-column: main;
		grid-row: 1;
		text-wrap: pretty;
	}
	:root[data-layout="ledger"] .list__cell {
		grid-column: main / -1;
		color: var(--text-soft);
	}
	:root[data-layout="ledger"] .list__cell--last {
		grid-column: end;
		grid-row: 1;
		color: inherit;
		text-align: right;
	}
	:root[data-layout="ledger"] .list__toggle,
	:root[data-layout="ledger"] .list__go {
		grid-column: go;
		grid-row: 1;
		padding-right: 0;
	}
	:root[data-layout="ledger"] .list--numbered .list__more {
		padding-left: calc(2.2em + 16px);
	}
	:root[data-layout="ledger"] .list__item:has(a, .list__toggle):hover .list__cell,
	:root[data-layout="ledger"] .list__item.is-open .list__cell {
		color: inherit;
	}
}

/* Phones */
@media (max-width: 480px) {
	body,
	.masthead {
		margin: 0;
	}
	.sections,
	.footer {
		margin: var(--page-pad);
	}
	.masthead__inner,
	.masthead__top {
		padding: var(--page-pad);
		box-sizing: border-box;
	}
	.footer {
		margin-top: 80px;
	}
}

/* ************** Draft (drift.js) ************** */

.drift-word {
	display: inline-block;
	white-space: nowrap;
}
.drift {
	display: inline-block;
}
html.drafted .drift,
html.drafted .drift-word,
html.drafted .drift-el {
	pointer-events: none;
}
html.drafted .drift-src .drift {
	pointer-events: auto;
}
/* Touch screens: A held link shows the draft, not the phone's link preview or text selection */
@media (pointer: coarse) {
	a {
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		user-select: none;
	}
}
/* A strike-through does not reach into inline-blocks: Each struck letter draws its own */
s .drift,
del .drift,
strike .drift {
	text-decoration: line-through;
}
/* The text as screen readers hear it: Not seen, and not copied twice */
.drift-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	user-select: none;
	-webkit-user-select: none;
}
/* Link highlights would stay behind while their letters fly */
html.drafted a:not(.drift-src) {
	background: none;
}
