/* ==========================================================================
   Tack N Mount – main stylesheet (v2.1: "Night Stable" – dark, classic, brass)

   Almost every colour, font, radius and size below is a CSS variable. The
   values are printed into <head> from Appearance > Customize > Tack N Mount
   (see inc/design.php) AFTER this file, so they always win. The defaults in
   :where(:root) have zero specificity and only apply if that output is
   missing. Nothing here needs editing to restyle the site.

   The palette is bottle-green and ivory with brass as the single signature
   colour. Link / badge colours are derived per colour scheme (body.scheme-dark
   or body.scheme-light, chosen automatically from the page background), so a
   light palette picked in the Customizer stays readable too.
   ========================================================================== */

:where(:root) {
	--primary: #c9a35b;
	--accent: #e0c58c;
	--bg: #121e18;
	--surface: #1a2a22;
	--ink: #ebe5d5;
	--muted: #a9b1a4;
	--line: #2c4036;
	--header-bg: #0d1612;
	--ticker-bg: #080f0b;
	--live: #b8453c;
	--footer-bg: #0a120e;
	--on-primary: #1d2420;
	--on-accent: #1d2420;
	--on-header: #ebe5d5;
	--on-ticker: #ebe5d5;
	--on-live: #ffffff;
	--on-footer: #ebe5d5;

	--font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-article: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
	--fs-base: 16px;
	--fs-article: 19px;
	--head-weight: 700;

	--radius: 10px;
	--btn-radius: 6px;
	--wrap: 1240px;
	--narrow: 740px;
	--logo-h: 48px;
	--hero-h: 640px;
	--card-ratio: 3 / 2;
	--section-y: clamp(3.5rem, 8vw, 6.5rem);
	--shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 12px 30px rgba(0, 0, 0, .26);
	--gap: clamp(1rem, 2.4vw, 2rem);

	/* Fallbacks for browsers without color-mix(); replaced just below. */
	--primary-deep: #8a6f3f;
	--primary-soft: #28372b;
	--accent-soft: #3a3a2b;
	--primary-text: #d4b57c;
	--primary-hover: #e6d2a6;
	--hover-b: 1.1;
	--on-primary-dim: rgba(29, 36, 32, .8);
	--on-footer-dim: rgba(235, 229, 213, .74);
	--on-footer-line: rgba(235, 229, 213, .14);
	--glass: rgba(13, 22, 18, .86);
	--focus: rgba(201, 163, 91, .5);
	--tint: #15231c;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	:where(:root) {
		--primary-deep: color-mix(in srgb, var(--primary) 55%, #000);
		--primary-soft: color-mix(in srgb, var(--primary) 9%, var(--surface));
		--accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
		--on-primary-dim: color-mix(in srgb, var(--on-primary) 80%, transparent);
		--on-footer-dim: color-mix(in srgb, var(--on-footer) 74%, transparent);
		--on-footer-line: color-mix(in srgb, var(--on-footer) 14%, transparent);
		--glass: color-mix(in srgb, var(--header-bg) 86%, transparent);
		--focus: color-mix(in srgb, var(--primary) 55%, transparent);
		--tint: color-mix(in srgb, var(--primary) 5%, var(--bg));
	}
	/* Readable brand colour for text on the page background. */
	body.scheme-dark {
		--primary-text: color-mix(in srgb, var(--primary) 80%, #fff);
		--primary-hover: color-mix(in srgb, var(--primary) 60%, #fff);
	}
	body.scheme-light {
		--primary-text: color-mix(in srgb, var(--primary) 82%, #000);
		--primary-hover: color-mix(in srgb, var(--primary) 60%, #000);
		--hover-b: .9;
	}
}
body.scheme-dark { color-scheme: dark; }
body.scheme-light { --hover-b: .9; }

:where(:root) {
	--radius-sm: calc(var(--radius) * .6);
	--radius-lg: calc(var(--radius) * 1.4);
}

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

html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 104px; }

body {
	margin: 0;
	background-color: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.65 var(--font-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	/* A faint pool of brass light at the top of the page. */
	body {
		background-image: radial-gradient(70% 560px at 50% 0, color-mix(in srgb, var(--primary) 8%, transparent), transparent);
		background-repeat: no-repeat;
	}
	::selection { background: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--ink); }
}

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

a { color: var(--primary-text); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; font-weight: var(--head-weight); letter-spacing: -.012em; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }

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

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; margin: 0;
	clip: auto; clip-path: none; padding: .75rem 1.1rem; background: var(--surface); color: var(--primary-text); font-weight: 700; border-radius: var(--btn-radius); box-shadow: var(--shadow);
}
.tm-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gap), var(--narrow)); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 48px; padding: .75rem 1.65rem; border: 1.5px solid var(--primary); border-radius: var(--btn-radius);
	background: var(--primary); color: var(--on-primary); font: 650 .95rem/1 var(--font-body); letter-spacing: .015em;
	text-decoration: none; cursor: pointer;
	transition: filter .2s, background-color .2s, color .2s, border-color .2s;
}
.btn:hover { filter: brightness(var(--hover-b)); color: var(--on-primary); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--accent:hover { color: var(--on-accent); }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); color: inherit; border-color: currentColor; filter: none; }
.btn--small { min-height: 40px; padding: .55rem 1.1rem; font-size: .88rem; }

/* ---- Ticker ------------------------------------------------------------ */
.ticker { background: var(--ticker-bg); color: var(--on-ticker); font-size: .875rem; border-bottom: 1px solid var(--line); }
.ticker__inner { display: flex; align-items: center; gap: 1rem; min-height: 42px; }
.ticker__label { display: inline-flex; align-items: center; gap: .5rem; padding: .22rem .75rem; background: var(--live); color: var(--on-live); font-weight: 700; font-size: .78rem; letter-spacing: .03em; border-radius: 4px; flex: none; }
.ticker__dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.8s ease-in-out infinite; }
.ticker__list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; position: relative; height: 42px; overflow: hidden; }
.ticker__list li { position: absolute; inset: 0; display: flex; align-items: center; gap: .75rem; white-space: nowrap; opacity: 0; transform: translateY(60%); transition: opacity .5s, transform .5s; pointer-events: none; }
.ticker__list li.is-active { opacity: 1; transform: none; pointer-events: auto; }
.ticker__list a { color: inherit; text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.ticker__list a:hover { text-decoration: underline; text-decoration-color: var(--primary); }
.ticker__ago, .ticker__date { opacity: .62; flex: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* ---- Header ------------------------------------------------------------ */
.site-header { position: relative; z-index: 50; background: var(--header-bg); color: var(--on-header); border-bottom: 1px solid var(--line); }
.header-sticky .site-header { position: sticky; top: 0; }
.header-blur .site-header { background: var(--glass); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); }
.admin-bar.header-sticky .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--on-header); text-decoration: none; }
.brand:hover { color: var(--on-header); }
.brand__mark { width: calc(var(--logo-h) * .8); height: calc(var(--logo-h) * .8); color: var(--primary); }
.brand__name { font: var(--head-weight) 1.55rem/1 var(--font-head); letter-spacing: -.015em; }
.custom-logo { max-height: var(--logo-h); width: auto; }

.primary-nav { display: flex; align-items: center; gap: .75rem; }
.primary-nav .menu { display: flex; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.primary-nav .menu a { position: relative; display: block; padding: .6rem .95rem; color: var(--on-header); font-weight: 500; font-size: .95rem; letter-spacing: .01em; text-decoration: none; transition: color .2s; }
.primary-nav .menu a::after { content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .25rem; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.primary-nav .menu a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a { color: var(--primary-text); }
.primary-nav .menu a:hover::after,
.primary-nav .current-menu-item > a::after,
.primary-nav .current-menu-ancestor > a::after { transform: scaleX(1); }
.primary-nav .menu-item { position: relative; }
.primary-nav .sub-menu { display: none; position: absolute; left: 0; top: calc(100% + 6px); min-width: 220px; margin: 0; padding: .5rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--primary); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 5; }
.primary-nav .sub-menu a { color: var(--ink); border-radius: 4px; }
.primary-nav .sub-menu a::after { display: none; }
.primary-nav .sub-menu a:hover { background: var(--primary-soft); color: var(--primary-text); }
.primary-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.primary-nav .menu-item:hover > .sub-menu,
.primary-nav .menu-item:focus-within > .sub-menu { display: block; }
.search-toggle { padding: .5rem 1.05rem; background: transparent; border: 1.5px solid var(--line); border-radius: var(--btn-radius); font: 500 .9rem var(--font-body); color: var(--on-header); cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.search-toggle:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.site-search { padding: 1rem 0 1.25rem; border-top: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.site-search[hidden] { display: none; }

.header-center .site-header__inner { flex-direction: column; justify-content: center; gap: .35rem; padding-block: 1.1rem .6rem; }
.header-center .primary-nav { flex-wrap: wrap; justify-content: center; }

.nav-toggle { display: none; width: 46px; height: 46px; border: 1.5px solid var(--line); background: none; border-radius: var(--btn-radius); cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--on-header); margin: auto; position: relative; transition: transform .2s; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---- Search form + fields ------------------------------------------------ */
.search-form { display: flex; gap: .5rem; max-width: 640px; }
.search-form__field,
.newsletter__form input[type="email"], .newsletter__form input[type="text"],
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	min-height: 48px; padding: .65rem 1.1rem; border: 1.5px solid var(--line); border-radius: var(--btn-radius); background: var(--bg); font: inherit; color: var(--ink);
	transition: border-color .2s, box-shadow .2s;
}
.search-form__field::placeholder, .newsletter__form input::placeholder, .comment-form textarea::placeholder { color: var(--muted); opacity: 1; }
.search-form__field { flex: 1; min-width: 0; }
.search-form__field:focus, .comment-form input:focus, .comment-form textarea:focus, .newsletter__form input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--focus); }

/* ---- Badges + part chip ---------------------------------------------------- */
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.badge { display: inline-block; padding: .22rem .7rem; border-radius: 4px; border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary-text); font-size: .76rem; font-weight: 600; letter-spacing: .02em; text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.badge:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge--series { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge--series:hover { filter: brightness(var(--hover-b)); background: var(--primary); color: var(--on-primary); }

.ribbon { position: absolute; top: .85rem; left: .85rem; display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem .8rem; border-radius: 4px; background: rgba(8, 14, 11, .8); color: #fff; line-height: 1; border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ribbon__label { font-size: .75rem; font-weight: 500; letter-spacing: .03em; color: rgba(255, 255, 255, .72); }
.ribbon__num { font: 700 1.1rem/1 var(--font-head); color: var(--accent); }

/* ---- Placeholder image --------------------------------------------------------- */
.ph { display: grid; place-items: center; width: 100%; height: 100%; min-height: 160px; background: linear-gradient(135deg, var(--footer-bg) 0%, var(--surface) 100%); }
.ph__mark { width: 26%; max-width: 100px; color: var(--primary); opacity: .35; }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; background: var(--footer-bg); color: #fff; isolation: isolate; }
.hero__track { position: relative; }
.hero__slide { position: relative; min-height: var(--hero-h); display: flex; align-items: flex-end; }
.js .hero__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s, visibility .8s; }
.js .hero__slide.is-active { position: relative; opacity: 1; visibility: visible; }
.js .hero__track { min-height: var(--hero-h); }
.js .hero__slide.is-active { z-index: 1; }
.js .hero__track .hero__slide:not(.is-active) { z-index: 0; }
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media .ph { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 14, 11, .45) 0%, rgba(8, 14, 11, 0) 28%, rgba(8, 14, 11, .9) 100%), linear-gradient(90deg, rgba(8, 14, 11, .72) 0%, rgba(8, 14, 11, 0) 65%); }
.hero__inner { position: relative; z-index: 2; padding-bottom: 6.25rem; }
.hero__panel { max-width: 780px; }
.hero__title { font-size: clamp(2.2rem, 5.4vw, 4.1rem); line-height: 1.07; letter-spacing: -.02em; color: #fff; margin-bottom: .4em; text-shadow: 0 2px 28px rgba(0, 0, 0, .4); }
.hero__title a { color: inherit; text-decoration: none; }
.hero__title a:hover { text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.hero__excerpt { font-size: 1.12rem; color: rgba(255, 255, 255, .88); max-width: 58ch; }
.hero__meta { color: rgba(255, 255, 255, .72); font-size: .9rem; margin-bottom: 1.4rem; }
.hero .badge { background: rgba(8, 14, 11, .55); border-color: rgba(255, 255, 255, .3); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero .badge:hover { background: #fff; border-color: #fff; color: #14201a; }
.hero .badge--series { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.hero__controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: 1.6rem; margin-inline: auto; display: flex; align-items: center; gap: .6rem; }
.hero__dots { display: flex; gap: .4rem; }
.hero__dots button { width: 26px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: rgba(255, 255, 255, .35); cursor: pointer; transition: width .25s, background-color .25s; }
.hero__dots button[aria-selected="true"] { width: 46px; background: var(--primary); }
.hero__btn { width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(8, 14, 11, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.hero__btn:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---- Sections ---------------------------------------------------------- */
.section { padding-block: var(--section-y); }
.section--series { padding-bottom: 0; }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 2rem; }
.section__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.018em; margin-bottom: 1.3rem; }
.section__head .section__title { margin-bottom: .45rem; }
.section__lede { color: var(--muted); font-size: 1.08rem; max-width: 62ch; margin: 0; }
.section__foot { padding-block: 2rem; text-align: left; margin-block: 0; }
.section--series .section__foot { padding-block: 2.5rem 0; }

/* ---- Series cover -------------------------------------------------------- */
.series-cover, .series-hero { position: relative; display: flex; align-items: center; min-height: clamp(440px, 64vh, 640px); background: var(--footer-bg); color: var(--ink); isolation: isolate; }
.series-cover__media { position: absolute; inset: 0; z-index: -1; }
.series-cover__media img, .series-cover__media .ph { width: 100%; height: 100%; object-fit: cover; }
.series-cover__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 14, 11, .8), rgba(8, 14, 11, .12) 72%); }
.series-cover--right .series-cover__media::after { background: linear-gradient(270deg, rgba(8, 14, 11, .8), rgba(8, 14, 11, .12) 72%); }
.series-cover__inner, .series-hero__inner { padding-block: 3.5rem; }
.series-cover--right .series-cover__inner { display: flex; justify-content: flex-end; }
.series-cover__panel { position: relative; max-width: 560px; padding: clamp(1.6rem, 3.2vw, 2.7rem); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--primary); border-radius: var(--radius); box-shadow: 0 28px 70px rgba(0, 0, 0, .55); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.series-cover__panel { background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.series-cover__count { margin-bottom: .6rem; color: var(--primary-text); font-weight: 600; font-size: .88rem; letter-spacing: .03em; }
.series-cover__title, .series-hero__title { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin-bottom: .35em; }
.series-cover__title a { color: inherit; text-decoration: none; }
.series-cover__title a:hover { color: var(--primary-text); }
.series-cover__tagline { font-size: 1.1rem; line-height: 1.55; color: var(--muted); }
.series-cover__latest { font-size: .92rem; color: var(--muted); }
.series-cover__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.series-cover__actions .btn--ghost { color: var(--ink); border-color: var(--line); }
.series-cover__actions .btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.series-cover__panel .crumbs { margin-bottom: 1rem; }
.series-hero { min-height: clamp(480px, 66vh, 660px); }
.series-intro { margin-block: 2.5rem; max-width: var(--narrow); }
.series-parts { padding-block: 1rem 3rem; }

/* Contained (rounded) covers - optional, Customizer > Shape & style */
.layout-contained .hero,
.layout-contained .series-cover,
.layout-contained .series-hero { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; border-radius: var(--radius-lg); overflow: hidden; }
.layout-contained .hero { margin-top: 1.25rem; }
.layout-contained .series-cover { margin-bottom: 1.5rem; }
.layout-contained .series-hero { margin-top: 1.25rem; }
.layout-contained .hero .wrap,
.layout-contained .series-cover .wrap,
.layout-contained .series-hero .wrap { width: calc(100% - 2 * clamp(1.25rem, 3.2vw, 3rem)); }
.layout-contained .series-list { padding-top: .5rem; }

/* Edge-to-edge covers (default): a hairline of brass between stacked covers */
.layout-full .series-cover + .series-cover { border-top: 1px solid var(--line); }

/* ---- Layout ------------------------------------------------------------ */
.layout { display: grid; gap: clamp(1.5rem, 4vw, 3.25rem); grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
.layout--full { grid-template-columns: minmax(0, 1fr); }
.layout__side { display: grid; gap: 1.25rem; position: sticky; top: 112px; }
.layout--full .layout__side { position: static; }
.grid { display: grid; gap: var(--gap); }
.grid--1 { grid-template-columns: minmax(0, 1fr); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- Cards ------------------------------------------------------------- */
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.cards-bordered .card { border: 1px solid var(--line); }
.cards-lift .card:hover { transform: translateY(-3px); border-color: var(--primary); }
.card__media { position: relative; display: block; aspect-ratio: var(--card-ratio); background: var(--footer-bg); overflow: hidden; }
.card__media img, .card__media .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .7s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.3rem 1.4rem 1.45rem; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.3rem; line-height: 1.26; margin-bottom: .55rem; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--primary-text); }
.card__excerpt { color: var(--muted); font-size: .96rem; }
.card__meta { margin: auto 0 0; padding-top: .6rem; color: var(--muted); font-size: .82rem; }
.card__sep { margin-inline: .5em; color: var(--primary); font-weight: 700; }
.card--compact, .cards-bordered .card--compact { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; transform: none; }
.cards-lift .card--compact:hover { border-color: var(--line); }
.card--compact .card__body { padding: 1.05rem 0; }
.card--compact .card__title { font-size: 1.1rem; margin-bottom: .3rem; }

/* ---- Side panels -------------------------------------------------------- */
.panel { position: relative; padding: 1.5rem 1.5rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.cards-bordered .panel { border: 1px solid var(--line); }
.panel__title, .widget__title { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; margin-bottom: .9rem; }
.panel--live .ticker__dot { color: var(--live); }
.feed, .rank, .plain { list-style: none; margin: 0; padding: 0; }
.feed li, .plain li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child, .plain li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed a, .rank a, .plain a { color: var(--ink); font-weight: 500; text-decoration: none; }
.feed a:hover, .rank a:hover, .plain a:hover { color: var(--primary-text); }
.feed__meta { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.feed__status { margin: .6rem 0 0; color: var(--muted); font-size: .78rem; min-height: 1em; }
.rank { counter-reset: r; }
.rank li { counter-increment: r; display: flex; align-items: center; gap: .85rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.rank li::before { content: counter(r); flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary-text); font: 700 .9rem var(--font-head); }

/* ---- Standalone columns ------------------------------------------------- */
.cols { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.cols--1 { grid-template-columns: 1fr; }
.cols--2 { grid-template-columns: repeat(2, 1fr); }
.cols--3 { grid-template-columns: repeat(3, 1fr); }
.col__title { position: relative; font-size: 1.45rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.col__title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px; border-radius: 3px; background: var(--primary); }
.col__title a { color: inherit; text-decoration: none; }
.col__more { margin: 1rem 0 0; font-weight: 600; font-size: .95rem; }
.col__more a { text-decoration: none; }
.col__more a::after { content: " \2192"; }

/* ---- Newsletter ---------------------------------------------------------- */
.newsletter { background: var(--surface); color: var(--ink); border-block: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.newsletter { background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--primary) 17%, var(--surface)) 100%); }
}
.newsletter__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.newsletter__title { color: inherit; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.newsletter__inner p { margin: 0; color: var(--muted); }
.newsletter__form { display: flex; gap: .5rem; }
.newsletter__form input[type="email"], .newsletter__form input[type="text"] { flex: 1; min-width: 0; min-height: 52px; }
.layout-contained .newsletter { width: min(100% - 2 * var(--gap), var(--wrap)); margin: 0 auto var(--section-y); border: 1px solid var(--line); border-radius: var(--radius-lg); padding-inline: clamp(1.25rem, 4vw, 3.5rem); }
.layout-contained .newsletter .wrap { width: 100%; }

.layout-contained .section--tint { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); padding-inline: clamp(1.25rem, 4vw, 3rem); }
.layout-contained .section--tint .wrap { width: 100%; }

/* ---- Page heads / breadcrumbs -------------------------------------------- */
.page-head { padding-block: 3rem 2rem; }
.page-head__title { font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
.page-head__desc { max-width: 62ch; color: var(--muted); font-size: 1.1rem; }
.crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem; font-size: .82rem; color: var(--muted); }
.crumbs li + li::before { content: "\203A"; margin-right: .4rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary-text); }

/* ---- Single post --------------------------------------------------------- */
.entry__head { width: min(100% - 2 * var(--gap), calc(var(--narrow) + 180px)); margin-inline: auto; padding-block: 3rem 1.75rem; text-align: center; }
.entry__head .crumbs ol, .entry__head .badges { justify-content: center; }
.entry__title { font-size: clamp(2.2rem, 5.2vw, 3.7rem); line-height: 1.07; letter-spacing: -.02em; margin-bottom: .45em; }
.entry__dek { font: 400 1.3rem/1.5 var(--font-article); color: var(--muted); max-width: 56ch; margin-inline: auto; }
.entry__meta { color: var(--muted); font-size: .92rem; }
.entry__by { font-weight: 600; color: var(--ink); }
.entry__series { display: inline-block; margin: .7rem 0 0; padding: .45rem 1.05rem; background: var(--primary-soft); border: 1px solid var(--line); border-radius: var(--btn-radius); font-weight: 500; font-size: .92rem; }
.entry__figure { margin-block: .5rem 2.8rem; }
.entry__figure img { width: 100%; border-radius: var(--radius-lg); max-height: 680px; object-fit: cover; box-shadow: var(--shadow); }
.entry__figure figcaption { padding-top: .6rem; color: var(--muted); font-size: .85rem; text-align: center; }
.entry--page { max-width: var(--narrow); margin: 0 auto 3rem; }

.entry__content { font: 400 var(--fs-article)/1.8 var(--font-article); }
.entry__content > * + * { margin-top: 1.3em; }
.entry__content h2 { font-size: 1.95rem; margin-top: 2.2em; }
.entry__content h3 { font-size: 1.5rem; margin-top: 1.9em; }
.entry__content a { color: var(--primary-text); text-decoration-color: var(--primary); text-decoration-thickness: 1px; }
.entry__content a:hover { color: var(--primary-hover); text-decoration-thickness: 2px; }
.entry__content blockquote { margin-inline: 0; padding: 1.1rem 1.6rem; border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--primary-soft); font: italic 500 1.22em/1.5 var(--font-head); color: var(--ink); }
.entry__content blockquote p:last-child { margin-bottom: 0; }
.entry__content img { border-radius: var(--radius-sm); }
.entry__content figure { margin-inline: 0; }
.entry__content figcaption { font: .85rem var(--font-body); color: var(--muted); padding-top: .4rem; }
.entry__content table { width: 100%; border-collapse: collapse; font: .95rem var(--font-body); display: block; overflow-x: auto; }
.entry__content th, .entry__content td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; }
.entry__content th { background: var(--primary-soft); color: var(--ink); }
.entry__content pre { overflow-x: auto; padding: 1.1rem 1.25rem; background: var(--footer-bg); color: var(--on-footer); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .9rem; }
.entry__content :not(pre) > code { padding: .1em .4em; background: var(--primary-soft); border-radius: 4px; font-size: .9em; }
.alignwide { width: min(100vw - 2 * var(--gap), 1100px); margin-left: 50%; transform: translateX(-50%); }
.alignleft { float: left; margin: .3em 1.2em .6em 0; }
.alignright { float: right; margin: .3em 0 .6em 1.2em; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }

.toc { padding: 1.25rem 1.5rem; background: var(--primary-soft); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); font: 400 .98rem/1.5 var(--font-body); }
.toc__title { margin: 0 0 .5rem; font: 700 1.1rem var(--font-head); }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { padding: .1rem 0; }
.toc .toc__l3 { margin-left: 1em; list-style: circle; }
.toc a { text-decoration: none; color: var(--primary-text); }
.toc a:hover { text-decoration: underline; color: var(--primary-hover); }

.entry__tags { margin-top: 2rem; font-size: .9rem; }
.entry__tags a { display: inline-block; margin: 0 .3rem .3rem 0; padding: .22rem .8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--primary-soft); color: var(--primary-text); text-decoration: none; }
.entry__tags a:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.entry__tags-label { font-weight: 600; margin-right: .4rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-block: 2rem; padding-block: 1.2rem; border-block: 1px solid var(--line); }
.share__label { font-weight: 600; }
.share ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.share a, .share__copy { display: inline-block; padding: .4rem .95rem; border: 1.5px solid var(--line); border-radius: var(--btn-radius); background: var(--surface); color: var(--ink); font: 500 .85rem var(--font-body); text-decoration: none; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.share a:hover, .share__copy:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.author-box { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.5rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.cards-bordered .author-box { border: 1px solid var(--line); }
.author-box img { border-radius: 50%; flex: none; }
.author-box__name { font: 700 1.15rem var(--font-head); margin-bottom: .2rem; }
.author-box p:last-child { margin: 0; color: var(--muted); }

/* ---- Series box on posts ---------------------------------------------------- */
.series-box { position: relative; margin-block: 2.6rem; padding: clamp(1.4rem, 3vw, 2rem); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); }
.series-box__head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; position: relative; }
.series-box__kicker { margin: 0; flex-basis: 100%; color: var(--primary-text); font-weight: 600; font-size: .88rem; letter-spacing: .03em; }
.series-box__title { flex: 1; margin: 0; font-size: 1.55rem; color: inherit; }
.series-box__title a { color: inherit; text-decoration: none; }
.series-box__title a:hover { color: var(--primary-text); }
.series-box .btn { background: transparent; color: var(--primary-text); border-color: var(--primary); }
.series-box .btn:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); filter: none; }
.series-box__list { margin: 0 0 1.2rem; padding-left: 1.5em; position: relative; }
.series-box__list li { padding: .28rem 0; }
.series-box__list a { color: var(--muted); }
.series-box__list a:hover { color: var(--ink); }
.series-box__list .is-current span { color: var(--primary-text); font-weight: 700; }
.series-box__nav { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; position: relative; }
.series-box__nav a { display: block; padding: .9rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 600; transition: background-color .2s, border-color .2s; }
.series-box__nav a:hover { background: var(--primary-soft); border-color: var(--primary); }
.series-box__nav span { display: block; color: var(--primary-text); font-size: .8rem; margin-bottom: .15rem; }
.series-box__next { grid-column: 2; text-align: right; }
.series-box__prev:only-child { grid-column: 1; }
.related { padding-block: 1rem 3.5rem; }

/* ---- Comments --------------------------------------------------------------- */
.comments { margin-block: 3rem; font-size: .98rem; }
.comments__title, .comment-reply-title { font-size: 1.5rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.comment-author img { float: left; margin-right: .8rem; border-radius: 50%; }
.comment-metadata { font-size: .8rem; }
.comment-metadata a { color: var(--muted); }
.comment-form label { display: block; font-weight: 600; margin-bottom: .25rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; }
.comment-form textarea { min-height: 150px; border-radius: var(--radius-sm); padding: .9rem 1.1rem; }

/* ---- Pagination ---------------------------------------------------------------- */
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers { min-width: 46px; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: var(--btn-radius); background: var(--surface); color: var(--ink); font-weight: 600; text-align: center; text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---- 404 ------------------------------------------------------------------------- */
.notfound { padding-block: 5rem; text-align: center; }
.notfound .search-form { margin: 1.5rem auto; }
.notfound__mark { width: 90px; margin: 0 auto 1rem; color: var(--primary); opacity: .8; transform: rotate(-12deg); }

/* ---- Footer ------------------------------------------------------------------------ */
.site-footer { margin-top: 0; background: var(--footer-bg); color: var(--on-footer-dim); border-top: 1px solid var(--line); }
.layout-contained .site-footer { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.site-footer a { color: var(--on-footer); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--primary); color: var(--on-footer); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; padding-block: 4rem; }
.site-footer .widget__title { color: var(--on-footer); font-size: 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: .3rem 0; }
.footer-brand { display: flex; align-items: center; gap: .6rem; font: var(--head-weight) 1.45rem var(--font-head); color: var(--on-footer); }
.footer-brand .brand__mark { color: var(--primary); width: 32px; height: 32px; }
.social { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.site-footer__base { border-top: 1px solid var(--on-footer-line); font-size: .86rem; }
.site-footer__base-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; padding-block: 1.2rem; }
.site-footer__base p { margin: 0; }
.footer-menu { display: flex; gap: 1rem; }

/* ---- Reading progress ---------------------------------------------------------------- */
.progress { position: fixed; z-index: 60; left: 0; top: 0; width: 100%; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 0 3px 3px 0; }

/* ---- Optional: original saddle-stitch details --------------------------------------- */
.has-stitch .series-cover__panel::before { content: ""; position: absolute; inset: 7px; border: 1.5px dashed var(--primary); border-radius: calc(var(--radius) - 4px); opacity: .45; pointer-events: none; }
.has-stitch .series-box::before { content: ""; position: absolute; inset: 6px; border: 1.5px dashed var(--primary); border-radius: calc(var(--radius) - 4px); opacity: .4; pointer-events: none; }
.has-stitch .panel__title, .has-stitch .widget__title { padding-bottom: .6rem; border-bottom: 1.5px dashed var(--line); }
.has-stitch .card--compact { border-bottom-style: dashed; }
.has-stitch .toc { border: 1.5px dashed var(--primary); }

/* ---- Responsive ------------------------------------------------------------------------- */
@media (max-width: 980px) {
	.layout { grid-template-columns: 1fr; }
	.layout__side { position: static; }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cols--3 { grid-template-columns: 1fr 1fr; }
	.newsletter__inner { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
	.nav-toggle { display: inline-grid; place-items: center; }
	.site-header__inner, .header-center .site-header__inner { flex-direction: row; justify-content: space-between; padding-block: 0; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: .6rem var(--gap) 1.2rem; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); border-top: 2px solid var(--primary); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
	.primary-nav.is-open { display: flex; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .menu a { color: var(--ink); border-radius: var(--radius-sm); }
	.primary-nav .menu a::after { display: none; }
	.primary-nav .menu a:hover,
	.primary-nav .current-menu-item > a,
	.primary-nav .current-menu-ancestor > a { background: var(--primary-soft); color: var(--primary-text); }
	.primary-nav .sub-menu { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 1rem; background: transparent; }
	.search-toggle, .header-cta { margin-top: .6rem; }
	.ticker__date { display: none; }
}

@media (max-width: 640px) {
	.grid--2, .grid--3, .cols--2, .cols--3 { grid-template-columns: 1fr; }
	.hero__slide, .js .hero__track { min-height: min(var(--hero-h), 560px); }
	.series-cover, .series-hero { align-items: flex-end; min-height: 560px; }
	.series-cover__media::after, .series-cover--right .series-cover__media::after { background: linear-gradient(180deg, rgba(8, 14, 11, .1) 15%, rgba(8, 14, 11, .72) 100%); }
	.series-cover--right .series-cover__inner { justify-content: flex-start; }
	.ticker__ago { display: none; }
	.hero__inner { padding-bottom: 5.75rem; }
	.series-box__nav { grid-template-columns: 1fr; }
	.series-box__next { grid-column: 1; text-align: left; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.newsletter__form { flex-direction: column; }
	.entry__content { font-size: max(1.0625rem, calc(var(--fs-article) - 1px)); }
	.admin-bar.header-sticky .site-header { top: 46px; }
}

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

@media print {
	.ticker, .site-header, .site-footer, .hero__controls, .share, .progress, .series-box__nav, .related, .comments { display: none !important; }
	body { background: #fff !important; color: #000 !important; }
	h1, h2, h3, h4, .entry__content, .entry__dek { color: #000 !important; }
	a { color: #000 !important; }
}
