/* ==========================================================================
   Akafi — "Marginalia"
   One serif voice, a wide left margin that carries dates, topics and references,
   hairlines instead of cards, and one red — used the way a pen marks a page.

   Rules of the system
   - The left margin is content: dates, topics, sidenotes and references live there.
   - Hairlines and whitespace separate things. No cards, shadows or gradients.
   - Red marks one thing per view: the label, the link, or the pulse.
   - Show real counts. Nothing says "coming soon".
   ========================================================================== */

/* ---------- Fonts (self-hosted; see assets/fonts/README.md) ---------- */
@font-face { font-family: "Canela Text"; src: local("Canela Text Regular"), local("CanelaText-Regular"), url("../fonts/canela-text-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Canela Text"; src: local("Canela Text Regular Italic"), local("CanelaText-RegularItalic"), url("../fonts/canela-text-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Charter"; src: local("Charter Roman"), local("Charter-Roman"), url("../fonts/charter-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: local("Inter"), url("../fonts/inter-variable.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
/* Charter italic comes from the system copy where present; the 4-file budget goes to the faces above. */

/* ---------- Tokens ---------- */
:root {
	--paper: #F5F0E6;
	--paper-2: #ECE5D6;
	--rule: #D8CEBE;
	--muted: #7A6F66;
	--soft: #4A413B;
	--ink: #1B1613;
	--text: #2A2320;
	--red: #8E1B22;
	--dark: #191411;
	--cream: #EFE8DA;
	--d-rule: #3A322C;
	--d-muted: #A3978B;

	--display: "Canela Text", Canela, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
	--ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

	--gutter: clamp(20px, 8.33vw, 120px);
	--wrap: 1200px;
	--margin: 240px;   /* the left margin column */
	--gap: 60px;
	--measure: 660px;  /* reading column */
	--rail: 180px;     /* right rail (contents) */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 20px/1.65 var(--serif);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-kerning: normal;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p, h1, h2, h3, h4, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: rgba(142, 27, 34, .16); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-site-blocks { padding: 0; }

/* ---------- Layout ---------- */
.ak-wrap {
	width: 100%;
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}
/* margin column + main */
.ak-row {
	display: grid;
	grid-template-columns: var(--margin) minmax(0, 1fr);
	column-gap: var(--gap);
	align-items: start;
}
/* margin + main + right rail */
.ak-row--rail { grid-template-columns: var(--margin) minmax(0, 600px) minmax(0, 1fr); }
.ak-row--rail > .ak-rail { justify-self: end; width: 100%; max-width: 240px; }

.ak-margin { display: grid; gap: 6px; align-content: start; }

/* ---------- Type primitives ---------- */
.ak-label {
	font: 500 11px/16px var(--ui);
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--muted);
}
.ak-red { color: var(--red); }
.ak-meta { font: 400 13px/1.45 var(--ui); color: var(--muted); }
.ak-dek { font: italic 400 22px/1.5 var(--serif); color: var(--soft); max-width: 700px; }
.ak-footnote { font: italic 400 15px/1.5 var(--serif); color: var(--muted); margin-top: 20px; }

.ak-link {
	font: 500 15px/1.4 var(--ui);
	color: var(--red);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	background: none; border: 0; padding: 0; cursor: pointer;
	white-space: nowrap;
}
.ak-link--ink { color: var(--ink); font-size: 14px; }
.ak-link:hover { text-decoration-thickness: 2px; }
.ak-links { display: flex; flex-wrap: wrap; gap: 12px 32px; }

.ak-button {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 12px 20px;
	border: 0; border-radius: 999px;
	background: var(--ink); color: var(--cream);
	font: 500 13px/16px var(--ui);
	text-decoration: none; cursor: pointer;
	transition: background-color .15s;
}
.ak-button:hover { background: var(--red); }
.ak-button--red { background: var(--red); }
.ak-button--red:hover { background: var(--ink); }
.ak-button--large { padding: 16px 28px; font-size: 14px; }

.ak-stars { display: block; color: var(--red); font: 13px/16px var(--ui); letter-spacing: .1em; }

/* The pulse: a hairline with one beat. */
.ak-pulse { display: flex; align-items: center; color: var(--red); height: 40px; }
.ak-pulse > span { height: 1.25px; background: currentColor; }
.ak-pulse > span:first-child { flex: 0 0 150px; }
.ak-pulse > span:last-child { flex: 1; }
.ak-pulse > svg { flex: none; overflow: visible; }
.ak-flatline { border: 0; height: 1.25px; background: var(--red); margin: 0 0 56px; }

/* ---------- Header ---------- */
.ak-header { border-bottom: 1px solid var(--rule); position: relative; }
.ak-header__bar { display: flex; align-items: center; justify-content: space-between; min-height: 82px; gap: 24px; }
.ak-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.ak-brand img { width: 30px; height: 30px; }
.ak-brand span { font: 500 24px/28px var(--display); letter-spacing: -.005em; }
.ak-header__panel { display: contents; }
.ak-nav { display: flex; gap: 40px; }
.ak-nav a, .ak-header__actions a:not(.ak-button) {
	font: 400 14px/20px var(--ui); color: var(--soft); text-decoration: none;
}
.ak-nav a:hover { color: var(--ink); }
.ak-nav a[aria-current] { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 5px; }
.ak-header__actions { display: flex; align-items: center; gap: 24px; }
.ak-header__search input {
	width: 64px; border: 0; border-bottom: 1px solid transparent; background: none; padding: 2px 0;
	font: 400 14px/20px var(--ui); color: var(--soft); transition: width .2s, border-color .2s;
}
.ak-header__search input::placeholder { color: var(--soft); opacity: 1; }
.ak-header__search input:focus { width: 180px; outline: none; border-color: var(--ink); }
.ak-header__search input::-webkit-search-cancel-button { display: none; }
.ak-lang { font: 500 12px/1 var(--ui); letter-spacing: .06em; color: var(--muted); }
.ak-lang a { color: var(--muted) !important; font: inherit !important; }
.ak-lang a[aria-current] { color: var(--ink) !important; }
.ak-menu-toggle { display: none; background: none; border: 0; padding: 8px 0; font: 500 14px/1 var(--ui); color: var(--ink); cursor: pointer; }
.ak-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.ak-progress span { display: block; height: 100%; width: 0; background: var(--red); }

/* ---------- Hero ---------- */
.ak-hero { padding-top: 88px; }
.ak-hero .ak-margin { padding-top: 26px; }
.ak-hero__main { display: grid; gap: 32px; justify-items: start; }
.ak-hero__title {
	font: 400 148px/.95 var(--display);
	letter-spacing: -.03em;
	color: var(--ink);
	max-width: 900px;
}
.ak-hero--xl .ak-hero__title { font-size: 168px; line-height: .93; }
.ak-hero--xl .ak-margin { padding-top: 30px; }
.ak-hero--m .ak-hero__title { font-size: 124px; line-height: .97; }
.ak-hero--s .ak-hero__title { font-size: 92px; line-height: 1.02; letter-spacing: -.025em; }
.ak-hero__title em, .ak-hero__title i { color: var(--red); }
.ak-hero__lede { font: 400 24px/1.54 var(--serif); color: var(--soft); max-width: 700px; }
.ak-hero--xl .ak-hero__lede { max-width: 680px; }
.ak-hero__pulse { margin-top: 56px; }
.ak-hero:not(:has(.ak-hero__pulse)) { padding-bottom: 64px; }
em { font-style: italic; }

.ak-byline { display: flex; align-items: center; gap: 14px; }
.ak-avatar { border-radius: 50%; object-fit: cover; object-position: 50% 15%; aspect-ratio: 1; }
.ak-byline__name { font: 500 15px/1.4 var(--ui); color: var(--ink); }
.ak-byline .ak-meta { margin-top: 2px; }

.ak-search { display: flex; gap: 10px; width: 100%; max-width: 560px; }
.ak-search label { flex: 1; }
.ak-search input {
	width: 100%; height: 52px; padding: 0 18px;
	border: 1px solid var(--ink); border-radius: 4px; background: transparent;
	font: 400 15px var(--ui);
}
.ak-search button {
	flex: 0 0 130px; height: 52px; border: 0; border-radius: 4px;
	background: var(--ink); color: var(--cream); font: 500 14px var(--ui); cursor: pointer;
}
.ak-search button:hover { background: var(--red); }

/* ---------- Section heads ---------- */
.ak-section-head {
	display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
	border-top: 1px solid var(--ink);
	padding: 28px 0;
}
.ak-section-head h2 { font: 400 40px/1.1 var(--display); letter-spacing: -.015em; }
.ak-section-head__title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.ak-section-head__title p { font: italic 16px/1.5 var(--serif); color: var(--muted); }
.ak-section-head--plain { border: 0; padding: 0 0 48px; }

/* ---------- Latest essay (home) ---------- */
.ak-latest { padding: 40px 0 96px; }
.ak-latest .ak-margin { padding-top: 10px; }
.ak-latest__main { display: grid; gap: 22px; justify-items: start; }
.ak-latest__title { font: 400 54px/1.11 var(--display); letter-spacing: -.015em; }
.ak-latest__title a { text-decoration: none; }
.ak-latest__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.ak-latest .ak-dek { max-width: 560px; }
.ak-latest__opening { font: 400 19px/1.63 var(--serif); color: var(--soft); }

/* numbered list in the right rail */
.ak-rail { padding-top: 10px; }
.ak-rail ol { list-style: none; margin-top: 14px; counter-reset: ak; border-bottom: 1px solid var(--rule); }
.ak-rail li { counter-increment: ak; display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule); font: 400 15px/22px var(--serif); color: var(--soft); }
.ak-rail li::before { content: counter(ak); font: 500 12px/22px var(--ui); color: var(--red); flex: none; }
.ak-rail a { text-decoration: none; }
.ak-rail a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Essay index ---------- */
.ak-index { padding-bottom: 96px; }
.ak-index__label { margin-bottom: 16px; }
.ak-list { list-style: none; border-bottom: 1px solid var(--rule); }
.ak-entry {
	display: grid;
	grid-template-columns: var(--margin) minmax(0, 600px) 170px minmax(40px, 1fr);
	column-gap: var(--gap);
	padding: 26px 0;
	border-top: 1px solid var(--rule);
}
.ak-entry__date, .ak-entry__topic, .ak-entry__mins { font: 400 13px/38px var(--ui); color: var(--muted); }
.ak-entry__topic { color: var(--soft); line-height: 20px; padding-top: 9px; }
.ak-entry__mins { color: var(--ink); text-align: right; }
.ak-entry__main { display: grid; gap: 6px; }
.ak-entry h3 { font: 400 30px/38px var(--display); letter-spacing: -.005em; }
.ak-entry h3 a { text-decoration: none; }
.ak-entry h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.ak-entry__main p { font: 400 17px/26px var(--serif); color: var(--muted); }

.ak-pager { display: flex; gap: 24px; justify-content: flex-end; margin-top: 24px; font: 500 14px var(--ui); }
.ak-pager a, .ak-pager span { color: var(--ink); text-underline-offset: 3px; }
.ak-pager .current { color: var(--red); }

/* ---------- Notes ---------- */
.ak-notes { padding-bottom: 96px; }
.ak-notes--columns .ak-notes__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.ak-notes--columns .ak-note { border-top: 1px solid var(--rule); padding-top: 16px; display: grid; gap: 10px; align-content: start; }
.ak-notes--columns .ak-meta { font-size: 12px; }
.ak-note h3 { font: 400 24px/30px var(--display); }
.ak-note h3 a { text-decoration: none; }
.ak-note h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ak-notes--columns .ak-note__body { font: 400 16px/25px var(--serif); color: var(--soft); }
.ak-note__main { display: grid; gap: 10px; align-content: start; }

.ak-notes--stream .ak-notes__list { border-bottom: 1px solid var(--rule); }
.ak-notes--stream .ak-note {
	display: grid; grid-template-columns: var(--margin) minmax(0, var(--measure)); column-gap: var(--gap);
	padding: 36px 0; border-top: 1px solid var(--rule);
}
.ak-notes--stream .ak-note + .ak-note { border-top: 1px solid var(--rule); }
.ak-notes--stream .ak-note__margin { padding-top: 8px; display: grid; gap: 6px; align-content: start; }
.ak-note__date { font: 400 13px/1.4 var(--ui); }
.ak-note__date a { text-decoration: none; color: var(--ink); }
.ak-notes--stream h3 { font-size: 32px; line-height: 40px; }
.ak-notes--stream .ak-note__main { gap: 12px; }
.ak-notes--stream .ak-note__body { font: 400 20px/33px var(--serif); color: var(--text); }
.ak-note__body > * + * { margin-top: 16px; }

.ak-source { display: flex; align-items: center; gap: 10px; font: 400 13px/1.45 var(--ui); color: var(--muted); }
.ak-source::before { content: ""; flex: 0 0 18px; height: 1px; background: var(--red); }
.ak-source a { color: var(--soft); text-underline-offset: 3px; }

/* Filter row (notes kinds, book genres) */
.ak-filters {
	display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap;
	padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.ak-notes--stream .ak-filters { border-bottom: 0; }
.ak-filters__chips { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.ak-filters__chips a, .ak-filters__chips button {
	background: none; border: 0; padding: 0; cursor: pointer;
	font: 400 14px/20px var(--ui); color: var(--soft); text-decoration: none;
}
.ak-filters__chips sup { font-size: 10px; color: var(--muted); margin-left: 4px; vertical-align: 5px; }
.ak-filters__chips [aria-current], .ak-filters__chips [aria-pressed="true"] {
	color: var(--red); font-weight: 500; text-decoration: underline; text-underline-offset: 4px;
}
.ak-filters__aside { font: 400 13px/20px var(--ui); color: var(--ink); }
.ak-filters__aside select { border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer; padding: 0 2px; }

/* ---------- Bookshelf ---------- */
.ak-band { background: var(--paper-2); }
.ak-shelf { padding: 96px 0; }
.ak-shelf__title { font: 400 54px/1.11 var(--display); letter-spacing: -.015em; margin-top: 12px; }
.ak-books { list-style: none; display: grid; }
.ak-books--strip { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28.8px; }
.ak-books--grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 56px 40px; padding: 56px 0 40px; }
.ak-book { display: grid; gap: 3px; align-content: start; }
.ak-book[hidden] { display: none; }
.ak-book a { text-decoration: none; display: grid; gap: 10px; }
.ak-book__cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; background: var(--rule); transition: transform .2s; }
.ak-book a:hover .ak-book__cover { transform: translateY(-3px); }
.ak-book__title { font: 400 16px/21px var(--serif); color: var(--ink); }
.ak-book__author { font: 400 13px/1.45 var(--ui); color: var(--muted); }
.ak-book .ak-stars { margin-top: 2px; }
.ak-more { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--rule); padding: 28px 0 0; }
.ak-more .ak-footnote { margin: 0; }
.ak-shelf-grid { padding-bottom: 112px; }

/* ---------- About teaser / split ---------- */
.ak-about-teaser { padding: 104px 0 112px; }
.ak-split { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: var(--gap); align-items: center; }
.ak-portrait { width: 100%; aspect-ratio: 390 / 500; object-fit: cover; border-radius: 3px; }
.ak-split__text { display: grid; gap: 24px; justify-items: start; max-width: 750px; }
.ak-split__text h2 { font: 400 46px/1.17 var(--display); letter-spacing: -.015em; max-width: 720px; }
.ak-split__text > p:not(.ak-label):not(.ak-links) { font: 400 19px/1.6 var(--serif); color: var(--soft); max-width: 640px; }

/* ---------- Footer ---------- */
.ak-footer { background: var(--dark); color: var(--cream); padding: 96px 0 40px; }
.ak-footer a { color: var(--cream); text-decoration: none; }
.ak-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ak-footer .ak-label { color: var(--d-muted); }
.ak-newsletter {
	display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 500px); justify-content: space-between; align-items: center; gap: 40px 80px;
	padding-bottom: 96px; border-bottom: 1px solid var(--d-rule); margin-bottom: 32px;
}
.ak-newsletter__copy { display: grid; gap: 16px; }
.ak-newsletter h2 { font: 400 56px/1.08 var(--display); letter-spacing: -.015em; color: var(--cream); }
.ak-newsletter__copy > p:last-child { font: 400 19px/1.6 var(--serif); color: var(--d-muted); max-width: 520px; }
.ak-newsletter form { display: flex; gap: 10px; }
.ak-newsletter label { flex: 1; }
.ak-newsletter input[type="email"] {
	width: 100%; height: 52px; padding: 0 18px; border: 1px solid var(--d-rule); border-radius: 4px;
	background: transparent; color: var(--cream); font: 400 15px var(--ui);
}
.ak-newsletter input::placeholder { color: var(--d-muted); }
.ak-newsletter button, .ak-newsletter .wp-block-jetpack-subscriptions button {
	flex: 0 0 130px; height: 52px; border: 0; border-radius: 4px; background: var(--red); color: var(--cream);
	font: 500 14px var(--ui); cursor: pointer;
}
.ak-newsletter button:hover { background: #A5242C; }
.ak-newsletter__small { font: 400 12px/1.5 var(--ui); color: var(--d-muted); margin-top: 12px; }
.ak-newsletter__rss .ak-button { padding: 16px 28px; font-size: 14px; border-radius: 4px; }
.ak-footer__main { display: flex; justify-content: space-between; gap: 28px 72px; flex-wrap: wrap; }
.ak-footer__brand { display: grid; gap: 10px; align-content: start; }
.ak-footer__name { font: 500 20px/24px var(--display); }
.ak-footer__tagline { font: italic 15px/1.5 var(--serif); color: var(--d-muted); }
.ak-footer__cols { display: flex; gap: 72px; }
.ak-footer__cols > div { display: grid; gap: 10px; align-content: start; }
.ak-footer__cols ul { list-style: none; display: grid; gap: 10px; }
.ak-footer__cols li { font: 400 14px/20px var(--ui); }
.ak-footer__legal { margin-top: 40px; font: 400 12px/1.5 var(--ui); color: var(--d-muted); }

/* ==========================================================================
   Essay
   ========================================================================== */
.ak-entry-header { padding-top: 80px; }
.ak-entry-header .ak-margin { padding-top: 14px; }
.ak-margin__lang { margin-top: 12px; }
.ak-margin__lang .ak-link { font-size: 13px; }
.ak-entry-header__main { display: grid; gap: 28px; justify-items: start; padding-bottom: 48px; }
.ak-entry-header h1 { font: 400 76px/1.05 var(--display); letter-spacing: -.02em; max-width: 860px; }
.ak-entry-header .ak-dek { font-size: 26px; line-height: 1.46; }
.ak-byline--small .ak-byline__name { font-size: 15px; }

/* the reading grid: margin | text | contents */
.ak-essay {
	display: grid;
	grid-template-columns: var(--margin) minmax(0, var(--measure)) minmax(0, 1fr);
	column-gap: var(--gap);
	padding-top: 40px;
	padding-bottom: 96px;
}
.ak-essay > .ak-prose { grid-column: 2; }
.ak-essay > .ak-toc { grid-column: 3; justify-self: end; width: 100%; max-width: var(--rail); }

/* Prose — every paragraph in Charter, under ~70 characters a line */
.ak-prose { font: 400 20px/1.65 var(--serif); color: var(--text); }
.ak-prose > * { margin-block: 0; }
.ak-prose > * + * { margin-top: 24px; }
.ak-prose > h2 { font: 400 34px/1.24 var(--display); letter-spacing: -.005em; color: var(--ink); margin-top: 56px; }
.ak-prose > h2 + * { margin-top: 16px; }
.ak-prose > h3 { font: 400 26px/1.3 var(--display); color: var(--ink); margin-top: 40px; }
.ak-prose a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ak-prose ul, .ak-prose ol { padding-left: 1.2em; }
.ak-prose li + li { margin-top: 8px; }
.ak-prose li::marker { color: var(--red); }
.ak-prose strong { font-weight: 700; color: var(--ink); }
.ak-prose figure img { border-radius: 3px; }
.ak-prose figcaption { font: 400 13px/1.45 var(--ui); color: var(--muted); margin-top: 10px; }
.ak-prose hr { border: 0; height: 1px; background: var(--rule); margin-block: 48px; }

/* Drop cap: one red Canela capital */
.ak-prose .has-drop-cap:not(:focus)::first-letter {
	float: left;
	font: 400 104px/.82 var(--display);
	color: var(--red);
	margin: 6px 14px 0 0;
	text-transform: none;
}

/* An essay that opens with a paragraph gets the drop cap without asking. */
.ak-essay .ak-prose > p:first-child:not(.has-drop-cap)::first-letter {
	float: left;
	font: 400 104px/.82 var(--display);
	color: var(--red);
	margin: 6px 14px 0 0;
}

/* Margin notes: hang in the left margin on wide screens, sit inline on narrow ones */
.ak-prose .is-style-margin-note {
	float: left; clear: left;
	width: var(--margin);
	margin: 30px 0 16px calc(-1 * (var(--margin) + var(--gap)));
	padding-top: 14px;
	font: 400 14px/1.5 var(--serif); color: var(--soft);
	position: relative;
}
.ak-prose .is-style-margin-note::before { content: ""; position: absolute; top: 0; left: 0; width: 40px; height: 2px; background: var(--red); }
.ak-prose .is-style-margin-note:has(+ h2) { margin-top: 62px; }
.ak-prose .is-style-margin-note > * + * { margin-top: 6px; }
.ak-prose .is-style-margin-note strong:first-child,
.ak-prose .is-style-margin-note .ak-label {
	display: block; font: 500 11px/16px var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--red); margin-bottom: 6px;
}

/* Pull quote: hangs into the margin, a red rule above */
.ak-prose .wp-block-pullquote, .ak-prose blockquote.is-style-large {
	margin: 64px 0 64px calc(-1 * (var(--margin) + var(--gap)));
	width: calc(100% + var(--margin) + var(--gap) + 0px);
	max-width: 960px;
	padding: 22px 0 0;
	border: 0; border-top: 3px solid var(--red);
	text-align: left;
}
.ak-prose .wp-block-pullquote blockquote { margin: 0; }
.ak-prose .wp-block-pullquote p, .ak-prose blockquote.is-style-large p {
	font: italic 400 44px/1.23 var(--display); letter-spacing: -.01em; color: var(--ink);
}
.ak-prose .wp-block-pullquote cite { display: block; margin-top: 16px; font: 500 11px/16px var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-style: normal; }
.ak-prose > blockquote:not(.is-style-large) { border-left: 2px solid var(--red); padding-left: 24px; font-style: italic; color: var(--soft); }

/* Contents (right rail) */
.ak-toc { position: sticky; top: 32px; }
.ak-toc ol { list-style: none; margin-top: 12px; }
.ak-toc li { padding: 7px 0; }
.ak-toc a {
	display: block; padding-left: 10px; border-left: 2px solid var(--rule);
	font: 400 13px/20px var(--ui); color: var(--muted); text-decoration: none;
}
.ak-toc a:hover { color: var(--ink); }
.ak-toc a[aria-current] { border-color: var(--red); color: var(--ink); font-weight: 500; }

/* End matter */
.ak-end { padding-bottom: 112px; }
.ak-end__author { border-top: 1px solid var(--ink); padding: 40px 0; align-items: center; }
.ak-byline--large { gap: 20px; }
.ak-end__name { font: 400 24px/30px var(--display); }
.ak-end__bio { font: 400 15px/23px var(--serif); color: var(--muted); max-width: 620px; margin-top: 4px; }
.ak-end__next { border-top: 1px solid var(--rule); padding-top: 48px; }
.ak-end__next-title { font: 400 64px/1.1 var(--display); letter-spacing: -.015em; margin-bottom: 10px; }
.ak-end__next-title a { text-decoration: none; }
.ak-end__next-title a:hover { color: var(--red); }

/* ---------- Single note ---------- */
.ak-note-single { padding: 96px 0 104px; }
.ak-note-single .ak-margin { padding-top: 14px; }
.ak-note-single__main { display: grid; gap: 28px; max-width: var(--measure); }
.ak-note-single h1 { font: 400 64px/1.06 var(--display); letter-spacing: -.02em; }
.ak-prose--note { font-size: 22px; line-height: 1.64; }
.ak-note-single .ak-source { font-size: 14px; }
.ak-neighbours { padding-bottom: 112px; }
.ak-neighbours .ak-row { border-top: 1px solid var(--ink); padding-top: 36px; }
.ak-neighbours__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: var(--gap); }
.ak-neighbours__pair > div { display: grid; gap: 8px; align-content: start; }
.ak-neighbours__title { font: 400 28px/1.25 var(--display); }
.ak-neighbours__title a { text-decoration: none; }
.ak-neighbours__title a:hover { color: var(--red); }

/* ---------- Single book ---------- */
.ak-book-single { padding: 88px 0 112px; }
.ak-book-single .ak-margin { padding-top: 14px; }
.ak-book-single__main { display: grid; gap: 48px; max-width: 900px; }
.ak-book-single__head { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 40px; align-items: end; }
.ak-book-single h1 { font: 400 76px/1.04 var(--display); letter-spacing: -.02em; margin-bottom: 14px; }
.ak-book-single .ak-prose { max-width: var(--measure); }

/* ---------- Pages ---------- */
/* Plain blocks in page content sit in the reading column; theme sections (section.*) bring their own wrap. */
.ak-page__content > :not(section):not(.alignfull) {
	width: calc(100% - 2 * var(--gutter));
	max-width: var(--measure);
	margin-left: calc(max(var(--gutter), (100% - var(--wrap)) / 2) + var(--margin) + var(--gap)) !important;
}
.ak-page__content > :not(section) + :not(section) { margin-top: 24px; }
.ak-page__content > p:not([class]) { font: 400 20px/1.65 var(--serif); color: var(--text); }
.ak-page__content > :last-child:not(section) { margin-bottom: 104px; }

/* About body: portrait + long text */
.ak-about-body { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: var(--gap); align-items: start; padding-top: 56px; padding-bottom: 104px; }
.ak-about-body .wp-block-image img { width: 100%; aspect-ratio: 390 / 500; object-fit: cover; border-radius: 3px; }
.ak-about-body .wp-block-image { margin: 0; }
.ak-about-body .ak-prose { max-width: 690px; }
.ak-about-body .ak-prose > h2:first-child { margin-top: 0; font-size: 40px; line-height: 1.2; }

/* This website (About) */
.ak-site-sections { padding: 88px 0 104px; }
.ak-site-sections .ak-label { padding-top: 12px; }
.ak-site-sections h2 { font: 400 44px/1.2 var(--display); letter-spacing: -.01em; max-width: 860px; margin-bottom: 36px; }
.ak-ruled { list-style: none; }
.ak-ruled li { border-top: 1px solid var(--rule); padding: 12px 0; font: 400 15px/22px var(--serif); color: var(--soft); }
.ak-ruled li:last-child { border-bottom: 1px solid var(--rule); }
.ak-ruled--table { max-width: 900px; }
.ak-ruled--table li { padding: 0; }
.ak-ruled--table a { display: grid; grid-template-columns: 330px minmax(0, 1fr) 100px; align-items: center; padding: 20px 0; text-decoration: none; }
.ak-ruled__name { font: 400 28px/34px var(--display); color: var(--ink); }
.ak-ruled__desc { font: 400 17px/26px var(--serif); color: var(--muted); }
.ak-ruled__count { font: 400 13px var(--ui); color: var(--ink); text-align: right; }
.ak-ruled--table a:hover .ak-ruled__name { color: var(--red); }

/* ---------- Contact ---------- */
.ak-contact { padding: 56px 0 112px; }
.ak-contact .ak-ruled { margin-top: 14px; }
.ak-margin__aside { margin-top: 28px; font: italic 14px/1.5 var(--serif); color: var(--muted); max-width: 220px; }
.ak-contact__main { display: grid; gap: 40px; max-width: var(--measure); }
.ak-contact__main h2 { font: 400 40px/1.2 var(--display); }
.ak-form { display: grid; gap: 40px; }
.ak-form__trap { position: absolute; left: -9999px; }
.ak-form__two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.ak-field { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.ak-field input {
	border: 0; border-bottom: 1px solid var(--ink); background: transparent;
	padding: 4px 0 10px; font: 400 19px/28px var(--serif); color: var(--ink); border-radius: 0;
}
.ak-field textarea {
	border: 1px solid var(--rule); border-radius: 3px; background: #FAF6EE;
	padding: 16px; font: 400 17px/26px var(--serif); color: var(--ink); resize: vertical; min-height: 220px;
}
.ak-field input::placeholder, .ak-field textarea::placeholder { color: var(--muted); }
.ak-field input:focus, .ak-field textarea:focus { outline: none; border-color: var(--red); }
.ak-chips legend { margin-bottom: 14px; padding: 0; }
.ak-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ak-chips label { cursor: pointer; }
.ak-chips input { position: absolute; opacity: 0; }
.ak-chips span {
	display: inline-block; padding: 9px 16px; border: 1px solid var(--rule); border-radius: 999px;
	font: 400 14px/18px var(--ui); color: var(--soft);
}
.ak-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--cream); font-weight: 500; }
.ak-chips input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.ak-form__send { display: flex; align-items: center; gap: 24px; }
.ak-form__send .ak-meta { max-width: 420px; }
.ak-notice { padding: 16px 20px; border-left: 3px solid var(--red); background: var(--paper-2); font: 400 17px/1.5 var(--serif); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1240px) {
	:root { --margin: 200px; --gap: 48px; }
	.ak-hero__title, .ak-hero--m .ak-hero__title { font-size: 112px; }
	.ak-hero--xl .ak-hero__title { font-size: 136px; }
	.ak-entry-header h1 { font-size: 64px; }
	.ak-nav { gap: 28px; }
	.ak-books--strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.ak-books--strip .ak-book:nth-child(n+6) { display: none; }
}

@media (max-width: 1080px) {
	:root { --margin: 170px; --gap: 40px; }
	/* the right rail folds away; contents stay in the essay's flow */
	.ak-essay { grid-template-columns: var(--margin) minmax(0, 1fr); }
	.ak-essay > .ak-toc { display: none; }
	.ak-row--rail { grid-template-columns: var(--margin) minmax(0, 1fr); }
	.ak-row--rail > .ak-rail { grid-column: 2; justify-self: start; max-width: 600px; margin-top: 40px; }
	.ak-entry { grid-template-columns: var(--margin) minmax(0, 1fr) 120px 48px; }
	.ak-hero__title, .ak-hero--m .ak-hero__title { font-size: 96px; }
	.ak-hero--s .ak-hero__title { font-size: 76px; }
	.ak-hero--xl .ak-hero__title { font-size: 116px; }
	.ak-split, .ak-about-body { grid-template-columns: 300px minmax(0, 1fr); }
	.ak-books--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.ak-newsletter { grid-template-columns: 1fr; }
}

/* Header collapses to a menu */
@media (max-width: 960px) {
	.ak-header__bar { min-height: 64px; flex-wrap: wrap; }
	.ak-brand img { width: 26px; height: 26px; }
	.ak-brand span { font-size: 21px; }
	.ak-menu-toggle { display: block; }
	.ak-header__panel {
		display: none; flex-basis: 100%;
		padding: 8px 0 24px; border-top: 1px solid var(--rule);
	}
	.ak-header.is-open .ak-header__panel { display: grid; gap: 20px; }
	.ak-nav { flex-direction: column; gap: 0; }
	.ak-nav a { font: 400 28px/1.5 var(--display); color: var(--ink); }
	.ak-nav a[aria-current] { color: var(--red); text-decoration: none; font-weight: 400; }
	.ak-header__actions { flex-wrap: wrap; gap: 16px 24px; }
	.ak-header__search input, .ak-header__search input:focus { width: 100%; border-bottom-color: var(--rule); font-size: 16px; }
	.ak-header__search { flex-basis: 100%; }
}

/* One column: the margin becomes a line of meta above the text */
@media (max-width: 760px) {
	body { font-size: 18px; }
	.ak-row, .ak-row--rail, .ak-essay { grid-template-columns: minmax(0, 1fr); }
	.ak-row--rail > .ak-rail { grid-column: 1; }
	.ak-margin { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding-top: 0 !important; margin-bottom: 16px; }
	.ak-margin .ak-label { flex-basis: 100%; }
	.ak-margin__lang { margin-top: 0; }

	.ak-hero { padding-top: 44px; }
	.ak-hero:not(:has(.ak-hero__pulse)) { padding-bottom: 40px; }
	.ak-hero__main { gap: 22px; }
	.ak-hero__title, .ak-hero--xl .ak-hero__title, .ak-hero--m .ak-hero__title { font-size: clamp(52px, 17vw, 70px); line-height: .98; }
	.ak-hero--s .ak-hero__title { font-size: 44px; line-height: 1.05; }
	.ak-hero__lede { font-size: 19px; line-height: 1.58; }
	.ak-hero__pulse { margin-top: 28px; }
	.ak-search { flex-direction: column; }
	.ak-search button { flex-basis: 52px; }

	.ak-latest { padding: 20px 0 48px; }
	.ak-latest__title { font-size: 34px; line-height: 1.18; }
	.ak-dek, .ak-latest .ak-dek { font-size: 18px; }
	.ak-latest__opening { display: none; }
	.ak-row--rail > .ak-rail { display: none; }

	.ak-section-head { padding: 18px 0; }
	.ak-section-head h2 { font-size: 28px; }
	.ak-section-head__title p { display: none; }
	.ak-index, .ak-notes { padding-bottom: 48px; }
	.ak-entry { grid-template-columns: minmax(0, 1fr); padding: 18px 0; }
	.ak-entry__date { order: -2; line-height: 1.4; margin-bottom: 6px; font-size: 12px; }
	.ak-entry__topic, .ak-entry__mins { display: none; }
	.ak-entry h3 { font-size: 24px; line-height: 30px; }
	.ak-entry__main p { font-size: 15px; line-height: 23px; }

	.ak-notes--columns .ak-notes__list { grid-template-columns: 1fr; gap: 0; border-bottom: 1px solid var(--rule); }
	.ak-notes--columns .ak-note { padding: 18px 0; gap: 6px; }
	.ak-notes--columns .ak-note:nth-child(n+3) { display: none; }
	.ak-note h3 { font-size: 22px; line-height: 28px; }
	.ak-notes--columns .ak-note__body { font-size: 15px; line-height: 23px; }
	.ak-notes--stream .ak-note { grid-template-columns: 1fr; padding: 28px 0; }
	.ak-notes--stream .ak-note__margin { display: flex; gap: 12px; padding: 0 0 8px; align-items: baseline; }
	.ak-notes--stream h3 { font-size: 26px; line-height: 32px; }
	.ak-notes--stream .ak-note__body { font-size: 18px; line-height: 30px; }

	.ak-shelf { padding: 48px 0 56px; overflow: hidden; }
	.ak-shelf__title { font-size: 34px; }
	.ak-section-head--plain { flex-direction: column; align-items: flex-start; padding-bottom: 24px; gap: 14px; }
	.ak-section-head--plain .ak-link { order: 2; }
	.ak-books--strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
	.ak-books--strip .ak-book { flex: 0 0 148px; scroll-snap-align: start; }
	.ak-books--strip .ak-book:nth-child(n+6) { display: grid; }
	.ak-books--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; padding-top: 32px; }

	.ak-about-teaser { padding: 56px 0; }
	.ak-split, .ak-about-body { grid-template-columns: 1fr; gap: 28px; }
	.ak-split .ak-portrait { max-width: 320px; }
	.ak-split__text h2 { font-size: 32px; }

	.ak-footer { padding: 72px 0 40px; }
	.ak-newsletter { padding-bottom: 64px; }
	.ak-newsletter h2 { font-size: 40px; }
	.ak-newsletter__copy > p:last-child { font-size: 17px; }
	.ak-newsletter form { flex-direction: column; }
	.ak-newsletter button { flex-basis: 52px; }
	.ak-footer__main { flex-direction: column; }
	.ak-footer__cols { gap: 40px; flex-wrap: wrap; }

	/* essay */
	.ak-entry-header { padding-top: 36px; }
	.ak-entry-header h1 { font-size: 40px; line-height: 1.12; }
	.ak-entry-header .ak-dek { font-size: 19px; }
	.ak-entry-header__main { gap: 16px; padding-bottom: 28px; }
	.ak-essay { padding-top: 8px; padding-bottom: 56px; }
	.ak-essay > .ak-prose { grid-column: 1; }
	.ak-prose { font-size: 18px; line-height: 1.67; }
	.ak-prose > * + * { margin-top: 22px; }
	.ak-prose > h2 { font-size: 26px; line-height: 1.23; margin-top: 40px; }
	.ak-prose .has-drop-cap:not(:focus)::first-letter,
	.ak-essay .ak-prose > p:first-child:not(.has-drop-cap)::first-letter { font-size: 88px; margin-right: 10px; }
	.ak-prose .is-style-margin-note {
		float: none; width: auto; margin: 22px 0 0; padding: 14px 16px; background: var(--paper-2); border-radius: 3px;
	}
	.ak-prose .is-style-margin-note::before { display: none; }
	.ak-prose .is-style-margin-note:has(+ h2) { margin-top: 22px; }
	.ak-prose .wp-block-pullquote, .ak-prose blockquote.is-style-large { margin: 40px 0; width: auto; padding-top: 16px; }
	.ak-prose .wp-block-pullquote p, .ak-prose blockquote.is-style-large p { font-size: 27px; line-height: 1.3; }
	.ak-end { padding-bottom: 56px; }
	.ak-end__author .ak-label { margin-bottom: 16px; }
	.ak-end__next { padding-top: 24px; }
	.ak-end__next .ak-label { margin-bottom: 10px; }
	.ak-end__next-title { font-size: 34px; }

	.ak-note-single { padding: 40px 0 56px; }
	.ak-note-single h1 { font-size: 40px; }
	.ak-prose--note { font-size: 19px; }
	.ak-neighbours__pair { grid-template-columns: 1fr; gap: 28px; }
	.ak-neighbours .ak-label:first-child { margin-bottom: 20px; }
	.ak-book-single { padding: 40px 0 56px; }
	.ak-book-single__head { grid-template-columns: 120px minmax(0, 1fr); gap: 20px; }
	.ak-book-single h1 { font-size: 36px; }

	.ak-page__content > :not(section):not(.alignfull) { margin-left: var(--gutter) !important; }
	.ak-site-sections { padding: 56px 0; }
	.ak-site-sections h2 { font-size: 30px; }
	.ak-ruled--table a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
	.ak-ruled__desc { grid-column: 1; grid-row: 2; font-size: 15px; }
	.ak-ruled__name { font-size: 24px; }

	.ak-contact { padding: 32px 0 56px; }
	.ak-contact .ak-margin { display: block; margin-bottom: 40px; }
	.ak-form__two { grid-template-columns: 1fr; }
	.ak-form__send { flex-direction: column; align-items: flex-start; }
	.ak-more { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

@media print {
	.ak-header, .ak-footer, .ak-toc, .ak-end__next, .ak-progress { display: none !important; }
	body { background: #fff; }
}
