/* ==========================================================================
   Naugatuck River Review - independent general news
   1. Tokens  2. Base  3. Layout  4. Utilities  5. Brand  7. Header & nav
   8. Search  9. Buttons & forms  10. Archive basics  11. Footer  14. Ticker
   15. Cards  16. Section heads  17. Feed  18. Breadcrumbs  20. Desk sidebar
   12. Motion & print (kept last)
   ========================================================================== */

/* 1. Tokens ----------------------------------------------------------------- */
:root {
	/* Palette: navy primary, antique gold accent (rules and marks only - never small text on
	   white), warm paper background, white surfaces, ink text. */
	--color-primary: #17324D;
	--color-secondary: #17324D;
	--color-gold: #B48A45;
	--color-gold-soft: #E9DCC4;
	--color-breaking: #17324D;
	--color-accent: #B48A45;
	--color-text: #202B36;
	--color-body: #33404D;
	--color-muted: #5A6672;
	--color-bg: #FAF8F3;
	--color-paper: #FAF8F3;
	--color-surface: #FFFFFF;
	--color-surface-alt: #F2EEE5;
	--color-border: #E2DCD0;
	--color-rule-strong: #202B36;
	--color-dark-panel: #17324D;
	--color-on-dark: #FFFFFF;
	--color-on-dark-muted: #C3CEDA;
	--color-focus: #17324D;

	--font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

	/* Fluid type scale (320px → 1440px). */
	--fs-xs: 0.75rem;
	--fs-sm: 0.875rem;
	--fs-base: 1rem;
	--fs-md: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	--fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	--fs-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
	--fs-2xl: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
	--fs-3xl: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);

	--container: 1240px;
	--gutter: clamp(16px, 3vw, 32px);
	--gap: clamp(16px, 2vw, 24px);
	--gap-lg: clamp(24px, 3.5vw, 48px);
	--radius: 2px;
	--rule: 1px solid var(--color-border);
	--shadow-sm: 0 1px 2px rgb(23 50 77 / 0.06);
	--header-h: 64px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 2. Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-body);
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: 1.6;
	overflow-x: clip; /* clip, not hidden - keeps position: sticky working */
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	color: var(--color-text);
	font-family: var(--font-serif);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

p { margin: 0 0 1em; }

/* Visual headings that are not document headings (widgets, sidebars, search, list items). */
.card__title, .rail__title, .side-box__title, .rank__title, .search-box__title {
	color: var(--color-text);
	font-family: var(--font-serif);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
p, li { text-wrap: pretty; }

a { color: var(--color-primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-text); }

img, svg, video { display: block; max-width: 100%; height: auto; }
svg.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }

figure { margin: 0; }
ul, ol { padding-left: 1.25em; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: var(--rule); margin: var(--gap-lg) 0; }

:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
	border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--color-gold-soft); color: var(--color-text); }

time, .meta { font-variant-numeric: tabular-nums; }

/* 3. Layout & 12-column grid ------------------------------------------------- */
.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.page-pad { padding-block: var(--gap-lg); }

/*
 * 12-column grid. Children span via custom properties:
 *   <div style="--span:12; --span-md:6; --span-lg:4">
 * Mobile < 768, tablet 768–1023, desktop ≥ 1024.
 */
.grid-12 {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--gap);
}
.grid-12 > * { grid-column: span var(--span, 12); min-width: 0; }

@media (min-width: 768px) {
	.grid-12 > * { grid-column: span var(--span-md, var(--span, 12)); }
}
@media (min-width: 1024px) {
	.grid-12 > * { grid-column: span var(--span-lg, var(--span-md, var(--span, 12))); }
}

.site-main { display: block; min-height: 50vh; }
.site-main:focus { outline: none; }

/* 4. Utilities --------------------------------------------------------------- */
.sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 8px; left: 8px;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--color-primary);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--radius);
	transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: #fff; }

.kicker {
	display: inline-block;
	font-family: var(--font-sans);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cat, var(--color-secondary));
}

.meta {
	color: var(--color-muted);
	font-size: var(--fs-sm);
	margin: 0;
}

.mono { font-family: var(--font-mono); }

/* Fine editorial rule - the visual motif (precise grid lines). */
.rule-top { border-top: 2px solid var(--color-text); padding-top: 12px; }

/* 5. Brand ------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand picture { display: block; }
.brand__img { width: auto; height: 34px; } /* wordmark ≈ 5.1:1 */
.brand--footer .brand__img { height: 44px; }
@media (min-width: 1024px) { .brand--header .brand__img { height: 52px; } }
@media (max-width: 359.98px) { .brand--header .brand__img { height: 28px; } }
.custom-logo { width: auto; max-height: 52px; }

/* 7. Header: masthead row + light section navigation ------------------------------ */
.site-header {
	position: relative;
	z-index: 100;
	background: var(--color-bg);
}
.masthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: var(--header-h);
	padding-block: 10px;
}
.site-header__brand { display: flex; flex-shrink: 1; min-width: 0; }
.masthead__tools { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.masthead__date {
	display: none;
	padding-right: 16px;
	margin-right: 8px;
	border-right: var(--rule);
	color: var(--color-muted);
	font-size: var(--fs-sm);
	white-space: nowrap;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 44px; height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	color: var(--color-text);
	cursor: pointer;
	transition: background-color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--color-surface-alt); }
.icon-btn[aria-expanded="true"] { background: var(--color-surface-alt); color: var(--color-primary); }

.menu-toggle__close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__close { display: block; }

/* Section bar: text links between two fine rules (no solid bar). */
.section-bar { border-top: 1px solid var(--color-rule-strong); border-bottom: var(--rule); }
.nav-list { display: flex; margin: 0; padding: 0; list-style: none; }
.nav-list a {
	position: relative;
	display: block;
	color: var(--color-text);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

@media (max-width: 1023.98px) {
	.section-bar { border-bottom: 0; }
	.primary-nav {
		position: fixed;
		inset: var(--header-h) 0 0 0;
		z-index: 99;
		overflow-y: auto;
		overscroll-behavior: contain;
		max-width: none;
		padding: 8px var(--gutter) 32px;
		background: var(--color-bg);
		border-top: 1px solid var(--color-rule-strong);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-8px);
		transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
	}
	.admin-bar .primary-nav { top: calc(var(--header-h) + 46px); }
	.menu-open .primary-nav {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
	}
	.menu-open { overflow: hidden; }
	.nav-list { flex-direction: column; }
	.nav-list a {
		padding: 14px 0 14px 16px;
		font-family: var(--font-serif);
		font-size: var(--fs-lg);
		font-weight: 600;
		border-bottom: var(--rule);
	}
	.nav-list a::before {
		content: "";
		position: absolute;
		left: 0; top: 50%;
		width: 3px; height: 20px;
		margin-top: -10px;
		background: var(--color-gold);
		opacity: 0;
	}
	.nav-list a[aria-current]::before { opacity: 1; }

	/* Without JS the panel is unreachable - show the list statically instead. */
	.no-js .primary-nav { position: static; visibility: visible; opacity: 1; transform: none; padding: 0 var(--gutter); border: 0; }
	.no-js .menu-toggle { display: none; }
	.no-js .nav-list { flex-direction: row; flex-wrap: wrap; gap: 0 16px; }
	.no-js .nav-list a { padding: 10px 0; font-family: var(--font-sans); font-size: var(--fs-sm); border: 0; }
}

@media (min-width: 1024px) {
	:root { --header-h: 92px; }
	.masthead__date { display: block; }
	.menu-toggle { display: none; }
	.nav-list { justify-content: space-between; gap: 4px 20px; }
	.nav-list a { padding: 13px 0 12px; letter-spacing: 0.01em; }
	.nav-list a::after {
		content: "";
		position: absolute;
		left: 0; right: 0; bottom: -1px;
		height: 2px;
		background: var(--color-gold);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.2s var(--ease);
	}
	.nav-list a:hover::after,
	.nav-list a[aria-current]::after { transform: scaleX(1); }
	.nav-list a:hover, .nav-list a[aria-current] { color: var(--color-primary); }
}

/* 8. Search: trigger + full-screen overlay ------------------------------------- */
.search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	color: var(--color-text);
	font-size: var(--fs-sm);
	font-weight: 600;
	cursor: pointer;
}
.search-trigger:hover { color: var(--color-primary); background: var(--color-surface-alt); }
.search-trigger__label { display: none; }
@media (min-width: 1024px) {
	.search-trigger { width: auto; height: 40px; padding: 0 14px; border: 1px solid var(--color-border); background: var(--color-surface); }
	.search-trigger__label { display: inline; }
}

.search-panel { padding: 24px 0; background: var(--color-surface); border-top: var(--rule); }
.js .search-panel {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 400;
	padding: clamp(24px, 10vh, 120px) 0 32px;
	background: rgb(23 50 77 / 0.78);
	border: 0;
	overflow-y: auto;
}
.js .search-panel.is-open { display: block; animation: wpt-fade 0.18s var(--ease); }
@keyframes wpt-fade { from { opacity: 0; } }
.search-open { overflow: hidden; }

.search-box {
	position: relative;
	max-width: 760px;
	margin-inline: auto;
	padding: clamp(20px, 4vw, 36px);
	background: var(--color-bg);
	border-top: 3px solid var(--color-gold);
	border-radius: var(--radius);
	box-shadow: 0 24px 64px rgb(9 20 33 / 0.35);
}
.search-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search-box__title { margin: 0; font-size: var(--fs-lg); }
.search-box__close { flex-shrink: 0; }
.search-box__hint { margin: 18px 0 8px; color: var(--color-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.search-form { display: flex; gap: 8px; max-width: 760px; margin-inline: auto; }
.search-form__field { position: relative; flex: 1 1 auto; min-width: 0; }
.search-form__field .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.search-form__input {
	width: 100%;
	height: 56px;
	padding: 0 16px 0 48px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	color: var(--color-text);
	font-size: var(--fs-md);
	transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.search-form__input::placeholder { color: #8A94A3; }
.search-form__input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.search-form__submit { min-height: 56px; padding: 0 22px; }
@media (max-width: 479.98px) {
	.search-form { flex-direction: column; }
	.search-form__submit { min-height: 48px; }
}

/* 9. Buttons & forms --------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: #10243A; color: #fff; }
.btn--ghost { background: transparent; color: var(--color-primary); border-color: #CBD2DA; }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.search-form__submit { min-height: 48px; }

/* Shared component states. */
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--color-surface) 25%, #EBEEF2 50%, var(--color-surface) 75%) 0 0 / 200% 100%;
	border-radius: var(--radius);
	animation: wpt-shimmer 1.2s linear infinite;
}
@keyframes wpt-shimmer { to { background-position: -200% 0; } }

.empty-state, .error-state {
	padding: 24px;
	background: var(--color-surface);
	border: 1px dashed #CBD2DA;
	border-radius: var(--radius);
	color: var(--color-muted);
	font-size: var(--fs-sm);
}
.error-state { border-style: solid; border-color: #FECACA; background: #FEF2F2; color: #991B1B; }

/* 10. Archive basics (refined in later stages) -------------------------------- */
.archive-head { margin-bottom: var(--gap-lg); padding-bottom: 16px; border-bottom: 1px solid var(--color-rule-strong); }
.archive-head__title { font-size: var(--fs-2xl); margin: 0; }

.simple-list { display: grid; gap: 0; }
.simple-list__item { padding: 16px 0; border-bottom: var(--rule); }
.simple-list__title { font-size: var(--fs-lg); margin: 0 0 4px; }
.simple-list__title a { color: var(--color-text); text-decoration: none; }
.simple-list__title a:hover { color: var(--color-primary); text-decoration: underline; }

.pagination { margin-top: var(--gap-lg); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px; height: 44px;
	padding: 0 12px;
	border: var(--rule);
	border-radius: var(--radius);
	color: var(--color-text);
	font-weight: 600;
	text-decoration: none;
}
.pagination .page-numbers:hover { border-color: var(--color-primary); }
.pagination .page-numbers.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination .page-numbers.dots { border-color: transparent; }

/* 11. Footer: statement band + ruled index ------------------------------------- */
.site-footer {
	margin-top: var(--gap-lg);
	background: var(--color-dark-panel);
	color: var(--color-on-dark-muted);
	font-size: var(--fs-sm);
}
.site-footer__band { border-top: 4px solid var(--color-gold); }
.site-footer__statement {
	display: grid;
	gap: 16px;
	align-items: center;
	padding-block: clamp(28px, 4vw, 44px);
	border-bottom: 1px solid rgb(255 255 255 / 0.14);
}
.site-footer__line {
	max-width: 34ch;
	margin: 0;
	color: var(--color-on-dark);
	font-family: var(--font-serif);
	font-size: var(--fs-lg);
	font-style: italic;
	line-height: 1.35;
}
@media (min-width: 900px) {
	.site-footer__statement { grid-template-columns: auto 1fr; gap: 48px; }
	.site-footer__line { justify-self: end; text-align: right; }
}
.site-footer__index {
	display: grid;
	gap: 28px var(--gap-lg);
	grid-template-columns: 1fr 1fr;
	padding-block: clamp(28px, 4vw, 40px);
}
.site-footer__col--sections { grid-column: 1 / -1; }
@media (min-width: 900px) {
	.site-footer__index { grid-template-columns: 2fr 1fr 1fr; }
	.site-footer__col--sections { grid-column: auto; }
	.site-footer__col + .site-footer__col { padding-left: var(--gap-lg); border-left: 1px solid rgb(255 255 255 / 0.14); }
}
.site-footer__title {
	margin: 0 0 12px;
	color: var(--color-on-dark);
	font-family: var(--font-sans);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer__col--sections ul { columns: 2; column-gap: 24px; }
@media (min-width: 600px) { .site-footer__col--sections ul { columns: 3; } }
.site-footer li { padding: 5px 0; break-inside: avoid; }
.site-footer a { color: var(--color-on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--color-gold); text-underline-offset: 4px; }
.site-footer :focus-visible { outline-color: #fff; }
.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 24px;
	padding-block: 16px;
	border-top: 1px solid rgb(255 255 255 / 0.14);
	font-size: var(--fs-xs);
}
.site-footer__bottom p { margin: 0; }

/* 14. Breaking ticker ------------------------------------------------------- */
.ticker { background: var(--color-surface); border-bottom: var(--rule); font-size: var(--fs-sm); }
.ticker__inner { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ticker__label {
	flex-shrink: 0;
	padding: 3px 8px;
	background: var(--color-primary);
	border-radius: 2px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.ticker__list {
	display: flex;
	flex: 1 1 auto;
	gap: 32px;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}
.ticker__item { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.ticker__item a { overflow: hidden; color: var(--color-text); font-weight: 600; text-decoration: none; text-overflow: ellipsis; }
.ticker__item a:hover { text-decoration: underline; }
.ticker__item time { flex-shrink: 0; color: var(--color-muted); font-size: 12px; }
.ticker__viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
	mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker.is-marquee .ticker__list { width: max-content; gap: 0; overflow: visible; animation: wpt-marquee var(--ticker-dur, 30s) linear infinite; }
.ticker.is-marquee .ticker__item { padding-right: 28px; }
.ticker.is-marquee .ticker__item::after { content: ""; align-self: center; width: 6px; height: 6px; margin-left: 18px; background: var(--color-gold); border-radius: 50%; }
.ticker.is-marquee .ticker__item a { overflow: visible; }
.ticker.is-paused .ticker__list,
.ticker.is-marquee:hover .ticker__list,
.ticker.is-marquee:focus-within .ticker__list { animation-play-state: paused; }
@keyframes wpt-marquee { to { transform: translateX(-50%); } }
.ticker__pause {
	flex-shrink: 0;
	min-height: 32px;
	padding: 0 10px;
	background: none;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	color: var(--color-muted);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.ticker__pause:hover { color: var(--color-text); border-color: #CBD2DA; }
.no-js .ticker__pause { display: none; }
@media (max-width: 767.98px) {
	.ticker__item time { display: none; }
	.ticker__inner { gap: 8px; }
	/* Icon-only pause button: ❚❚ while running, ▶ when paused. */
	.ticker__pause { width: 32px; padding: 0; font-size: 0; }
	.ticker__pause::before { content: "½A½A"; font-size: 9px; letter-spacing: -1px; }
	.ticker__pause[aria-pressed="true"]::before { content: "B6"; font-size: 11px; letter-spacing: 0; }
	.ticker__pause-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* 15. Cards ------------------------------------------------------------------ */
.card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--color-surface);
	border-radius: var(--radius);
}
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-1x1 { aspect-ratio: 1 / 1; }
.ratio-4x5 { aspect-ratio: 4 / 5; }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card__img { transform: scale(1.03); }
.card__ph {
	display: block;
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(0deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 32px),
		repeating-linear-gradient(90deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 32px),
		linear-gradient(135deg, var(--cat, var(--color-primary)), var(--color-dark-panel));
}
.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card__badge { position: relative; z-index: 2; align-self: flex-start; text-decoration: none; }
.card__badge:hover { text-decoration: underline; }
.card__title { margin: 0; font-size: var(--fs-md); line-height: 1.25; }
.card__link { color: var(--color-text); text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.card:hover .card__link { text-decoration: underline; text-decoration-color: var(--color-gold); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
.card__link:focus-visible { outline: none; }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: 2px; }
.card__excerpt { margin: 0; color: var(--color-body); font-size: 15px; line-height: 1.55; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; }
.card__read::before { content: "\00B7"; margin-right: 12px; }
.card__num { font-family: var(--font-serif); font-size: 28px; font-weight: 700; line-height: 1; color: var(--color-gold); }
.badge-demo {
	position: relative;
	z-index: 2;
	padding: 0 6px;
	background: var(--color-surface-alt);
	border: 1px solid var(--color-gold);
	border-radius: 2px;
	color: #6B4E1E;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.6;
	text-transform: uppercase;
}

/* Overlay: headline over the image. */
/* Media and body share one grid cell: the card grows with long (Bulgarian) headlines instead of
   clipping them; the media's aspect ratio is the minimum height. */
.card--overlay { display: grid; overflow: hidden; isolation: isolate; background: var(--color-dark-panel); border-radius: var(--radius); }
.card--overlay > .card__media, .card--overlay > .card__body { grid-area: 1 / 1; }
.card--overlay .card__media { align-self: stretch; justify-self: stretch; border-radius: 0; }
.card--overlay .ratio-fill { position: absolute; inset: 0; aspect-ratio: auto; }
.card--overlay .card__body {
	position: relative;
	align-self: end;
	padding: 56px 20px 18px;
	background: linear-gradient(to top, rgb(9 20 33 / 0.94) 0%, rgb(9 20 33 / 0.62) 55%, transparent 100%);
}
.card--overlay .card__link, .card--overlay .card__excerpt { color: #fff; }
.card--overlay .card__meta { color: rgb(255 255 255 / 0.82); }
.card--overlay .card__title { font-size: var(--fs-lg); }
.card--overlay:hover .card__link { text-decoration-color: #fff; }

/* Row: thumbnail left. */
.card--row { flex-direction: row; align-items: flex-start; gap: 14px; }
.card--row .card__media { flex: 0 0 112px; }
.card--row .card__title { font-size: var(--fs-base); }

/* Text-only and mini. */
.card--text .card__title { font-size: var(--fs-md); }
.card--mini { gap: 0; }
.card--mini .card__title { font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.card--mini .card__meta { order: -1; font-size: 12px; font-family: var(--font-mono); }
.card--mini:has(.card__num) .card__body { display: grid; grid-template-columns: 36px 1fr; column-gap: 8px; row-gap: 2px; }
.card--mini:has(.card__num) .card__num { grid-row: 1 / span 3; font-size: 24px; }
.card--mini:has(.card__num) .card__body > :not(.card__num) { grid-column: 2; }

/* Lists of mini cards. */
.mini-list, .headline-list, .rank__list, .rank-row, .timeline { margin: 0; padding: 0; list-style: none; }
.mini-list > li, .headline-list > li, .rank__list > li { padding: 12px 0; border-bottom: var(--rule); }
.mini-list > li:first-child, .rank__list > li:first-child { padding-top: 4px; }
.mini-list > li:last-child, .headline-list > li:last-child, .rank__list > li:last-child { border-bottom: 0; }

/* Ranking panels (Trending / Most Read). */
.rank { padding: 16px 18px; background: var(--color-surface); border-top: 3px solid var(--color-text); }
.rank__title { margin: 0 0 2px; font-size: var(--fs-lg); }
.rank__note { margin: 0 0 12px; color: var(--color-muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; margin: 8px 0 12px; border-bottom: var(--rule); }
.tabs__btn {
	padding: 8px 10px;
	margin-bottom: -1px;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	color: var(--color-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.tabs__btn[aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-primary); }
.tabs__btn:hover { color: var(--color-text); }
.no-js .tabs { display: none; }
.no-js .tabs__panel + .tabs__panel { margin-top: 16px; }

/* 16. Shared section heading + chips --------------------------------------- */
.sec-head {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 16px;
	margin-bottom: clamp(16px, 2vw, 24px);
	padding-top: 12px;
	border-top: 1px solid var(--color-rule-strong);
}
.sec-head::before {
	content: "";
	position: absolute;
	top: -2px;
	left: 0;
	width: 48px;
	height: 3px;
	background: var(--color-gold);
}
.sec-head__kicker { flex-basis: 100%; }
.sec-head__title { margin: 0; font-size: var(--fs-xl); }
.sec-head__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	color: var(--color-text);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-decoration: none;
}
.sec-head__more:hover { color: var(--color-primary); text-decoration: underline; text-decoration-color: var(--color-gold); }


.chip {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	color: var(--color-text);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.chip:hover { border-color: var(--color-gold); color: var(--color-primary); }


/* 17. Feed rows (Latest, list archives) -------------------------------------------------------------------------- */
.feed > .card { padding-block: 16px; border-bottom: var(--rule); }
.feed > .card:first-child { padding-top: 0; }
.card--feed .card__media { flex-basis: 112px; }
.card--feed .card__excerpt { display: none; }
@container (min-width: 560px) {
	.card--feed { gap: var(--gap); }
	.card--feed .card__media { flex-basis: 200px; }
	.card--feed .card__title { font-size: var(--fs-lg); }
	.card--feed .card__excerpt { display: block; }
}

/* 18. Breadcrumbs ------------------------------------------------------------- */
.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	color: var(--color-muted);
	font-size: 13px;
}
.breadcrumbs li { min-width: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--color-gold); }
.breadcrumbs a { color: var(--color-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-text); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--color-text); }
.breadcrumbs li:last-child {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 19. Chip rows */
.chips { margin: 0; }
.home-sec .chips { margin: -8px 0 20px; }
.chips ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip[aria-current] { background: var(--cat, var(--color-primary)); border-color: var(--cat, var(--color-primary)); color: #fff; }

/* 20. Rail titles + "From the desk" sidebar ----------------------------------------------- */
.rail__title {
	margin: 0 0 8px;
	padding-top: 10px;
	border-top: 1px solid var(--color-rule-strong);
	font-size: var(--fs-md);
}
.rail-widgets .rail-box + .rail-box, .desk + .rail-widgets, .desk + .rail-box { margin-top: 32px; }

.desk {
	padding: 18px 20px 20px;
	background: var(--color-surface);
	border: var(--rule);
	border-top: 3px solid var(--color-gold);
}
.desk__title {
	margin: 0;
	color: var(--color-text);
	font-family: var(--font-serif);
	font-size: var(--fs-lg);
	font-style: italic;
	font-weight: 700;
	line-height: 1.2;
}
.desk__note { margin: 2px 0 12px; color: var(--color-muted); font-size: 13px; }
.desk__list { margin: 0; padding: 0; list-style: none; counter-reset: desk; }
.desk__list > li { position: relative; padding: 12px 0 12px 30px; border-top: var(--rule); counter-increment: desk; }
.desk__list > li::before {
	content: counter(desk);
	position: absolute;
	left: 0; top: 12px;
	color: var(--color-gold);
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
}
.card--desk .card__title { font-size: 1.0625rem; line-height: 1.3; }
.card--desk .card__badge { color: var(--color-muted); }
.desk__sub { margin: 16px 0 8px; color: var(--color-muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.desk__title + .desk__topics .desk__sub { margin-top: 10px; }
.desk__topics ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.desk__topics a { color: var(--color-primary); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--color-gold-soft); }
.desk__topics a:hover, .desk__topics a[aria-current] { border-bottom-color: var(--color-gold); }

.more-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--color-primary);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-decoration: none;
}
.more-link:hover { text-decoration: underline; text-decoration-color: var(--color-gold); }

/* 12. Motion & print --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.masthead__tools, .section-bar, .search-panel, .site-footer__sections { display: none !important; }
	.site-header { position: static; border: 0; }
	a { color: inherit; }
}
