/*
Theme Name: Chalkline
Theme URI: https://dgsli.org/
Author: dgsli.org
Description: A chalkboard-and-index-card editorial theme built for dgsli.org: education, careers, college and K-12 resources. Random Popular Topics under every article, a Header widget area for analytics/ad code printed right after the header, and clean link markup.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chalkline
Tags: blog, news, education, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--board: #173a31;
	--board-deep: #10231e;
	--board-soft: #20493e;
	--chalk: #f5f0e6;
	--chalk-dim: #c9d6cf;
	--paper: #f5f0e6;
	--card: #fffdf8;
	--ink: #10231e;
	--ink-soft: #3c4d47;
	--muted: #5b6b64;
	--line: #e3dac8;
	--rule: #dfe6ee;
	--marker: #f4c430;
	--marker-soft: #fbe7a1;
	--coral: #d9503a;
	--slate: #1f3b5b;

	--f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
	--f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	--r-sm: 6px;
	--r-md: 14px;
	--r-lg: 22px;
	--gutter: clamp(16px, 4vw, 40px);
	--max: 1240px;
	--narrow: 760px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
	margin: 0;
	font-family: var(--f-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--ink);
	background-color: var(--paper);
	background-image:
		linear-gradient(rgba(23, 58, 49, .045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(23, 58, 49, .045) 1px, transparent 1px);
	background-size: 28px 28px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video, iframe { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 3px solid var(--marker); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; font-optical-sizing: auto; }

p { margin: 0 0 1em; }

button { font: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; margin: 0; z-index: 100;
	top: 12px; left: 12px; padding: 10px 16px; background: var(--marker); color: var(--ink); font-weight: 700;
}

/* ---------- Bits ---------- */
.eyebrow {
	display: inline-flex; align-items: center; gap: 10px;
	font-family: var(--f-mono); font-size: .75rem; font-weight: 600;
	letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
.eyebrow-mark { width: 22px; height: 8px; background: var(--marker); border-radius: 2px; transform: skewX(-18deg); }

.chip {
	display: inline-block; font-family: var(--f-mono); font-size: .7rem; font-weight: 600;
	letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
	background: var(--marker-soft); padding: 5px 9px; border-radius: 4px; margin-bottom: 12px;
	transition: background-color .2s var(--ease);
}
.chip:hover { background: var(--marker); }

.meta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .75rem; color: var(--muted); }
.meta-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
	padding: 10px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--chalk);
	font-weight: 700; font-size: .95rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--marker); }
.btn--chalk { background: var(--marker); color: var(--ink); border-color: var(--marker); }
.btn--chalk:hover { box-shadow: 4px 4px 0 var(--chalk); }

.section-head { margin-bottom: 28px; }
.section-head--row { display: flex; align-items: center; gap: 20px; margin-top: 64px; }
.section-head--row .section-title { margin: 0; white-space: nowrap; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.ruler {
	flex: 1; height: 12px;
	background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px) bottom / 100% 6px no-repeat,
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 60px) bottom / 100% 12px no-repeat;
	opacity: .35;
}

/* ---------- Progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 60; pointer-events: none; }
.progress-bar { display: block; height: 100%; width: 100%; background: var(--marker); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50; color: var(--chalk);
	background:
		radial-gradient(120% 140% at 10% 0%, rgba(255, 255, 255, .06), transparent 60%),
		radial-gradient(80% 120% at 90% 100%, rgba(244, 196, 48, .07), transparent 60%),
		var(--board);
	border-bottom: 3px solid var(--board-deep);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand-wrap { flex: none; }
.brand, .custom-logo-link { display: inline-flex; align-items: center; }
.brand-logo, .custom-logo { height: 42px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav .menu { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.main-nav .menu > li { position: relative; }
.main-nav a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px;
	font-weight: 600; font-size: .95rem; color: var(--chalk);
	background-image: linear-gradient(transparent 62%, rgba(244, 196, 48, .55) 62%, rgba(244, 196, 48, .55) 88%, transparent 88%);
	background-size: 0% 100%; background-repeat: no-repeat; background-position: 14px 0;
	transition: background-size .3s var(--ease), color .2s;
}
.main-nav a:hover, .main-nav .current-menu-item > a { background-size: calc(100% - 28px) 100%; }
.main-nav .sub-menu {
	list-style: none; position: absolute; top: 100%; left: 0; min-width: 220px; margin: 0; padding: 8px;
	background: var(--board-deep); border-radius: var(--r-md); box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s var(--ease);
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { width: 100%; border-radius: var(--r-sm); }

.header-tools { display: flex; gap: 8px; }
.icon-btn {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	border: 1.5px solid rgba(245, 240, 230, .28); background: transparent; color: var(--chalk);
	transition: background-color .2s, border-color .2s, color .2s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.menu-toggle { display: none; }

.search-panel { border-top: 1px solid rgba(245, 240, 230, .12); padding: 18px 0 22px; }
.search-form { display: flex; gap: 10px; }
.search-field {
	flex: 1; min-width: 0; min-height: 48px; padding: 10px 18px; font: inherit; color: var(--ink);
	background: var(--card); border: 2px solid var(--line); border-radius: 999px;
}
.search-field:focus { outline: none; border-color: var(--marker); box-shadow: 0 0 0 4px rgba(244, 196, 48, .3); }
.search-panel .btn { background: var(--marker); border-color: var(--marker); color: var(--ink); }

/* ---------- Intro ---------- */
.intro { padding: clamp(40px, 7vw, 84px) 0 12px; }
.intro-kicker { font-family: var(--f-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); font-weight: 600; }
.intro-line {
	font-family: var(--f-display); font-size: clamp(1.9rem, 4.6vw, 3.6rem); line-height: 1.08; font-weight: 600;
	letter-spacing: -.025em; max-width: 20ch; margin: 0; font-variation-settings: "SOFT" 60;
}

/* ---------- Lead ---------- */
.listing { padding-top: 32px; padding-bottom: 72px; }
.lead {
	display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center;
	padding: clamp(18px, 3vw, 32px); border-radius: var(--r-lg); color: var(--chalk);
	background:
		radial-gradient(100% 120% at 0% 0%, rgba(255, 255, 255, .07), transparent 55%),
		var(--board);
	box-shadow: 0 30px 60px -30px rgba(16, 35, 30, .55);
}
.lead-media { display: block; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 10px 10px 0 var(--marker); }
.lead-media img, .lead-media .cover { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.lead:hover .lead-media img { transform: scale(1.03); }
.lead-body { padding-right: clamp(0px, 2vw, 16px); }
.lead .eyebrow { color: var(--chalk-dim); }
.lead-title { font-size: clamp(1.8rem, 3.6vw, 3rem); margin-bottom: 16px; font-variation-settings: "SOFT" 40; }
.lead-title a { background-image: linear-gradient(var(--marker), var(--marker)); background-size: 0 3px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .35s var(--ease); }
.lead-title a:hover { background-size: 100% 3px; }
.lead-excerpt { color: var(--chalk-dim); font-size: 1.08rem; }
.lead-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 18px 0 24px; }
.lead-foot .chip { margin: 0; }
.lead .meta { color: var(--chalk-dim); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card {
	display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
	border-radius: var(--r-md); overflow: hidden;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: 6px 8px 0 var(--board); }
.card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.card-media img, .card-media .cover { width: 100%; height: 100%; object-fit: cover; }
.card-body {
	flex: 1; display: flex; flex-direction: column; padding: 20px 22px 22px; border-top: 2px solid var(--coral);
	background-image: repeating-linear-gradient(transparent 0 27px, var(--rule) 27px 28px);
	background-position: 0 14px;
}
.card-body .chip { align-self: flex-start; }
.card-title { font-size: 1.3rem; line-height: 1.22; margin-bottom: 10px; }
.card-title a:hover { color: var(--board-soft); text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card-excerpt { color: var(--ink-soft); font-size: .97rem; margin-bottom: 16px; }
.card .meta { margin-top: auto; }

/* Drawn covers for posts without a featured image */
.cover { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 100%; overflow: hidden; }
.cover-letter { font-family: var(--f-display); font-style: italic; font-weight: 700; font-size: clamp(4rem, 9vw, 7rem); line-height: 1; transform: rotate(-6deg); font-variation-settings: "SOFT" 100, "WONK" 1; }
.cover--0 { background: linear-gradient(rgba(245, 240, 230, .08) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(245, 240, 230, .08) 1px, transparent 1px) 0 0 / 22px 22px, var(--board); color: var(--chalk); }
.cover--1 { background: repeating-linear-gradient(transparent 0 23px, rgba(16, 35, 30, .14) 23px 24px), var(--marker); color: var(--ink); }
.cover--2 { background: radial-gradient(rgba(255, 255, 255, .28) 1.5px, transparent 1.6px) 0 0 / 16px 16px, var(--coral); color: var(--card); }
.cover--3 { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .07) 0 10px, transparent 10px 20px), var(--slate); color: var(--marker); }

/* ---------- Pagination ---------- */
.pagination { margin-top: 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px;
	border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-family: var(--f-mono); font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.page-numbers.current { background: var(--ink); color: var(--chalk); border-color: var(--ink); }
a.page-numbers:hover { border-color: var(--ink); background: var(--marker-soft); }
.page-numbers.dots { border: 0; background: none; }

/* ---------- Popular Topics ---------- */
.popular {
	position: relative; padding: clamp(56px, 8vw, 96px) 0; color: var(--chalk);
	background:
		radial-gradient(60% 80% at 100% 0%, rgba(244, 196, 48, .08), transparent 60%),
		radial-gradient(70% 90% at 0% 100%, rgba(255, 255, 255, .05), transparent 60%),
		var(--board);
	border-top: 6px solid var(--board-deep);
}
.popular::before {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
	background: linear-gradient(var(--board-deep), #0b1915);
}
.popular .section-head { display: flex; flex-direction: column; }
.popular .eyebrow { color: var(--chalk-dim); }
.popular .section-title { font-size: clamp(2rem, 4.4vw, 3.25rem); margin: 0; }
.pop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 22px; }
.pop-item { display: flex; }
.pop-item:nth-child(odd) .pop-card { transform: rotate(-.6deg); }
.pop-item:nth-child(even) .pop-card { transform: rotate(.5deg); }
.pop-card {
	position: relative; display: flex; flex-direction: column; width: 100%; color: var(--ink);
	background: var(--card); border-radius: 10px;
	box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 18px 30px -18px rgba(0, 0, 0, .55);
	transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pop-card::after { content: ""; position: absolute; z-index: 2; top: -7px; left: 50%; width: 54px; height: 18px; transform: translateX(-50%) rotate(-2deg); background: rgba(244, 196, 48, .75); border-radius: 2px; }
.pop-item .pop-card:hover, .pop-item .pop-card:focus-visible { transform: translateY(-6px) rotate(0); box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 26px 40px -18px rgba(0, 0, 0, .7); }
.pop-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px 10px 0 0; }
.pop-media img, .pop-media .cover { width: 100%; height: 100%; object-fit: cover; }
.pop-media .cover-letter { font-size: 3.6rem; }
.pop-num {
	position: absolute; top: 12px; left: 12px; font-family: var(--f-mono); font-weight: 600; font-size: .78rem;
	background: var(--ink); color: var(--marker); padding: 4px 8px; border-radius: 4px;
}
.pop-title {
	flex: 1 0 auto; padding: 16px 18px 0; margin-bottom: 8px; font-family: var(--f-display); font-weight: 600; font-size: 1.08rem; line-height: 1.28;
	border-top: 2px solid var(--coral); max-height: calc(3 * 1.28em + 18px);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pop-meta { padding: 0 18px 16px; font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }

/* ---------- Page heads ---------- */
.page-head { padding: clamp(40px, 6vw, 72px) 0 8px; }
.page-title { font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 0 0 12px; }
.page-dek { color: var(--ink-soft); font-size: 1.1rem; max-width: 60ch; }
.page-search { max-width: 560px; margin-top: 20px; }

/* ---------- Single ---------- */
.entry { padding-bottom: 64px; }
.entry-head { padding: clamp(40px, 6vw, 80px) 0 32px; text-align: center; }
.entry-title { font-size: clamp(2.1rem, 5.2vw, 3.9rem); line-height: 1.06; letter-spacing: -.025em; margin-bottom: 18px; font-variation-settings: "SOFT" 30; }
.entry-dek { font-size: 1.22rem; color: var(--ink-soft); max-width: 58ch; margin-inline: auto; }
.byline { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; text-align: left; }
.byline-avatar img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--marker); }
.byline-text { display: flex; flex-direction: column; gap: 2px; }
.byline-name { font-weight: 700; font-size: .95rem; }

.entry-figure { margin: 0 auto 48px; }
.entry-img { width: 100%; border-radius: var(--r-lg); aspect-ratio: 16 / 9; object-fit: cover; box-shadow: 12px 12px 0 var(--board); }
.entry-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 20px; text-align: center; }

.entry-layout { display: grid; grid-template-columns: 1fr minmax(0, var(--narrow)) 1fr; gap: 0; }
.entry-rail { grid-column: 1; justify-self: end; padding-right: 28px; margin-right: 32px; border-right: 2px solid rgba(217, 80, 58, .55); }
.rail-sticky { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rail-label { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; writing-mode: vertical-rl; transform: rotate(180deg); }
.share-btn {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line);
	background: var(--card); color: var(--ink); font-family: var(--f-mono); font-size: .8rem; font-weight: 600;
	transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.share-btn:hover { background: var(--marker); border-color: var(--marker); transform: translateY(-2px); }
.share-btn.is-copied { background: var(--board); color: var(--marker); border-color: var(--board); }
.entry-content { grid-column: 2; min-width: 0; }

.entry-content { font-size: 1.14rem; line-height: 1.78; }
.entry-content > * { margin-block: 0 1.35em; }
.entry-content > p:first-child::first-letter {
	float: left; font-family: var(--f-display); font-weight: 700; font-size: 4.4em; line-height: .82;
	margin: .06em .1em 0 0; padding: .06em .14em; background: var(--board); color: var(--marker); border-radius: 8px;
}
.entry-content h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 2em; }
.entry-content h2::after { content: ""; display: block; width: 56px; height: 8px; margin-top: 12px; background: var(--marker); border-radius: 2px; transform: skewX(-18deg); }
.entry-content h3 { font-size: 1.45rem; margin-top: 1.8em; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; text-underline-offset: 3px; font-weight: 600; transition: background-color .2s; }
.entry-content a:hover { background: var(--marker-soft); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--coral); font-weight: 700; }
.entry-content blockquote {
	margin-inline: 0; padding: 28px 32px; border-radius: var(--r-md); color: var(--chalk); background: var(--board);
	font-family: var(--f-display); font-size: 1.35rem; line-height: 1.45; font-style: italic; position: relative;
}
.entry-content blockquote::before { content: "\201C"; position: absolute; top: -18px; left: 20px; font-size: 4.5rem; line-height: 1; color: var(--marker); font-style: normal; }
.entry-content blockquote p:last-child { margin: 0; }
.entry-content blockquote cite { display: block; margin-top: 12px; font-family: var(--f-mono); font-size: .8rem; font-style: normal; color: var(--chalk-dim); }
.entry-content img { border-radius: var(--r-md); }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.entry-content pre { overflow-x: auto; padding: 20px; background: var(--board-deep); color: var(--chalk); border-radius: var(--r-md); font-family: var(--f-mono); font-size: .9rem; }
.entry-content code { font-family: var(--f-mono); font-size: .9em; background: var(--marker-soft); padding: .1em .35em; border-radius: 4px; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content th { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.entry-content hr { border: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 16px); opacity: .25; }
.entry-content .alignwide { width: min(1100px, 100vw - 32px); margin-inline: calc((min(1100px, 100vw - 32px) - 100%) / -2); max-width: none; }
.entry-content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.entry-content .aligncenter { margin-inline: auto; }
.wp-caption, .gallery-caption { font-size: .88rem; }
.sticky, .bypostauthor { position: relative; }
.page-links { display: flex; gap: 8px; font-family: var(--f-mono); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px; }
.post-nav-link {
	display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line);
	border-radius: var(--r-md); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.post-nav-link:hover { transform: translateY(-3px); box-shadow: 5px 6px 0 var(--marker); }
.post-nav-link--next { grid-column: 2; text-align: right; }
.post-nav-label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--coral); font-weight: 600; }
.post-nav-title { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }

/* ---------- Comments ---------- */
.comments { padding-top: 64px; padding-bottom: 72px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment-list .children { list-style: none; padding-left: clamp(16px, 4vw, 40px); }
.comment-body { padding: 20px 22px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); margin: 4px 0 10px; }
.reply a { font-family: var(--f-mono); font-size: .78rem; font-weight: 600; color: var(--coral); }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; font: inherit; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-sm);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--marker); }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form .comment-form-cookies-consent label { font-weight: 400; }

/* ---------- 404 / empty ---------- */
.notfound { padding: clamp(56px, 9vw, 120px) 0; text-align: center; }
.notfound-inner { max-width: 680px; }
.notfound-code { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: clamp(6rem, 22vw, 12rem); line-height: .9; margin: 0; color: var(--board); text-shadow: 8px 8px 0 var(--marker); }
.notfound .page-dek { margin-inline: auto; }
.empty { padding: 48px 0; max-width: 560px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--board-deep); color: var(--chalk-dim); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 40px; align-items: start; padding-bottom: 40px; border-bottom: 1px solid rgba(245, 240, 230, .1); }
.footer-blurb { margin-top: 16px; max-width: 42ch; font-size: .98rem; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-nav a { display: inline-flex; min-height: 36px; align-items: center; color: var(--chalk); font-weight: 500; transition: color .2s; }
.footer-nav a:hover { color: var(--marker); }
.to-top {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
	border: 1.5px solid rgba(245, 240, 230, .25); background: transparent; color: var(--chalk); font-weight: 600; font-size: .88rem;
	transition: background-color .2s, color .2s, border-color .2s;
}
.to-top:hover { background: var(--marker); color: var(--ink); border-color: var(--marker); }
.footer-base { padding-block: 22px 28px; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; }
.footer-base p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.pop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.entry-layout { grid-template-columns: minmax(0, var(--narrow)); justify-content: center; }
	.entry-rail { grid-column: 1; grid-row: 2; justify-self: start; border: 0; padding: 0; margin: 40px 0 0; }
	.rail-sticky { position: static; flex-direction: row; }
	.rail-label { writing-mode: horizontal-tb; transform: none; margin: 0 6px 0 0; }
	.entry-content { grid-column: 1; grid-row: 1; }
}
@media (max-width: 960px) {
	.lead { grid-template-columns: 1fr; }
	.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.to-top { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 860px) {
	.menu-toggle { display: grid; }
	.header-inner { flex-wrap: wrap; }
	.header-tools { margin-left: auto; }
	.main-nav { order: 3; flex-basis: 100%; margin: 0; display: none; padding-bottom: 14px; }
	.main-nav.is-open { display: block; }
	.main-nav .menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.main-nav a { width: 100%; }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; padding: 0 0 0 16px; }
}
@media (max-width: 760px) {
	.pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
	.pop-title { font-size: .98rem; padding: 12px 12px 0; }
	.pop-meta { padding: 0 12px 12px; }
	.pop-media .cover-letter { font-size: 2.8rem; }
}
@media (max-width: 600px) {
	body { font-size: 1rem; }
	.card-grid { grid-template-columns: 1fr; gap: 20px; }
	.section-head--row .ruler { display: none; }
	.section-head--row .section-title { white-space: normal; }
	.lead-media { box-shadow: 6px 6px 0 var(--marker); }
	.entry-head { text-align: left; }
	.entry-img { box-shadow: 6px 6px 0 var(--board); }
	.entry-content { font-size: 1.06rem; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav-link--next { grid-column: 1; }
	.footer-grid { grid-template-columns: 1fr; }
	.search-form { flex-direction: column; }
	.brand-logo, .custom-logo { height: 36px; }
}
@media (max-width: 420px) {
	.pop-grid { grid-template-columns: 1fr; }
	.pop-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: 1fr auto; min-height: 120px; }
	.pop-media { grid-row: 1 / 3; aspect-ratio: auto; border-radius: 10px 0 0 10px; }
	.pop-media img, .pop-media .cover { position: absolute; inset: 0; }
	.pop-media .cover-letter { font-size: 2.6rem; }
	.pop-title { border-top: 0; padding: 14px 14px 0; }
	.pop-meta { padding: 0 14px 12px; }
	.pop-card::after { left: auto; right: 18px; transform: rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
	.pop-item .pop-card { transform: none !important; }
}

@media print {
	.site-header, .popular, .site-footer, .entry-rail, .post-nav, .comments, .progress { display: none !important; }
	body { background: #fff; }
}

/* Placeholder tone while lazy images load */
.card-media, .lead-media, .pop-media {
	background:
		linear-gradient(rgba(245, 240, 230, .07) 1px, transparent 1px) 0 0 / 20px 20px,
		linear-gradient(90deg, rgba(245, 240, 230, .07) 1px, transparent 1px) 0 0 / 20px 20px,
		var(--board-soft);
}
