/*
Theme Name: Craptastic TV
Theme URI: https://craptastictv.com/
Description: Child theme of Twenty Twenty-Five. Dark "late-night cable" treatment: Anton display type, signal orange, hairline rules, typographic poster tiles. Ships block patterns for the front page.
Author: Thomas Whitelock
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: craptastic-tv
Tags: blog, dark, one-column, wide-blocks, block-patterns
*/

/* ============================================================
   1. Tokens
   theme.json owns the palette; these are the shorthand the
   component rules below read. Keep them in sync.
   ============================================================ */
:root {
	--noir: #0c0a09;
	--coal: #131110;
	--panel: #1a1715;
	--panel-2: #221e1a;
	--line: #2e2823;
	--line-2: #3a332c;
	--bone: #f5f0e6;
	--bone-2: #c6bcab;
	--muted: #8e8477;
	--orange: #ff5a2b;
	--orange-d: #c93f17;
	--amber: #ffc24b;
	--mint: #7ed0a8;
	--r: 3px;
}

/* ============================================================
   2. Container model
   Every front-end section is a group with layout "default" plus
   the .ctv-section class. Core's constrained layout is deliberately
   NOT used: it hard-caps everything at contentSize (720px) and the
   late-night-cable look needs a 1240px canvas. One rule owns the
   width, so sections can never disagree about the measure.
   ============================================================ */
.ctv-section {
	--ctv-canvas: 1240px;
	padding-inline: clamp(16px, 4vw, 44px);
}

.ctv-section > * {
	width: 100%;
	max-width: var(--ctv-canvas);
	margin-inline: auto;
}

/* Full-bleed bands break out on purpose: the ticker runs edge to edge. */
.ctv-bleed {
	width: 100%;
	max-width: none;
}

/* ============================================================
   3. Base
   ============================================================ */
html {
	background-color: var(--noir);
}

/* Short pages used to leave the footer floating mid-screen. */
body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

body > main,
body > .wp-block-group:has(> main) {
	flex: 1 0 auto;
}

body {
	background-color: var(--noir);
	color: var(--bone);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--orange);
	color: #160a05;
}

/* A single visible focus ring everywhere. Never remove it. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--amber);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ============================================================
   4. Masthead
   ============================================================ */
.ctv-masthead {
	border-bottom: 1px solid var(--line);
	background: var(--noir);
}

.ctv-masthead .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: -0.015em;
	line-height: 0.86;
	color: var(--bone);
	text-decoration: none;
}

.ctv-masthead .wp-block-site-title a:hover {
	color: var(--orange);
}

.ctv-masthead .wp-block-site-tagline {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0;
}

.ctv-nav .wp-block-navigation__container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-nav .wp-block-navigation-item {
	margin: 0;
}

/* Primary nav: mono, uppercase, generous hit area */
.ctv-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bone-2);
	padding: 8px 0;
	text-decoration: none;
}

.ctv-nav .wp-block-navigation-item__content:hover,
.ctv-nav .current-menu-item .wp-block-navigation-item__content {
	color: var(--orange);
}

/* The button face above is drawn with a heavier selector than core's own
   `.responsive-container-open:not(.always-shown){display:none}`, so it would
   otherwise survive at desktop width and sit next to the visible inline links.
   Restore core's hiding rule inside a matching media query. */
@media (min-width: 600px) {
	.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: none;
	}
}

/* The core responsive toggle ships as a bare 24px glyph — at phone width it
   reads as a stray dash floating in the masthead. Give it a real button face
   and a label so it looks like navigation. The class is doubled because core
   ships `.wp-block-navigation__responsive-container-open&.wp-block-navigation__
   responsive-container-open { font: inherit }` and that beats a single class. */
.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--bone);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	line-height: 1;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
}

.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open::after {
	content: "Menu";
}

.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open:hover {
	border-color: var(--orange);
	color: var(--orange);
}

.ctv-nav .wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open:focus-visible {
	border-color: var(--orange);
	outline: 2px solid var(--orange);
	outline-offset: 2px;
}

/* Overlay menu: same display type as the headlines, hairline dividers.
   The header uses a Page List block, so target both its list classes and the
   generic navigation ones — the block's own right-justification must be
   neutralised or the panel collapses into a narrow right-hand column. */
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 20px 22px 28px;
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: stretch;
	justify-content: flex-start;
	width: 100%;
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-pages-list__list {
	width: 100%;
	max-width: none;
	margin: 0;
	gap: 0;
	align-items: stretch;
	justify-content: flex-start;
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-pages-list__item {
	width: 100%;
	border-bottom: 1px solid var(--line);
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-pages-list__item__link {
	display: block;
	width: 100%;
	padding: 16px 0;
	border: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 28px;
	line-height: 1.05;
	letter-spacing: -0.01em;
	text-align: left;
	text-transform: uppercase;
	color: var(--bone);
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-pages-list__item__link:hover {
	color: var(--orange);
}

/* The overlay focuses its first link on open, so a UA/core ring lands on a full
   width row and reads like a selection box. Match plain :focus too — core puts
   `outline: 2px solid currentColor` on :focus, and :focus-visible alone misses it. */
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus,
.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-pages-list__item__link:focus {
	outline: 2px solid var(--orange);
	outline-offset: -2px;
}

.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	color: var(--bone);
}

@media (max-width: 781px) {
	.ctv-masthead {
		padding-bottom: var(--wp--preset--spacing--30);
	}

	/* Below 781px the header row wraps, which drops the MENU toggle onto its
	   own line under the tagline — a button floating in the middle of the
	   masthead. Grid instead: wordmark and toggle share row one, the tagline
	   takes the full width beneath. display:contents lifts the title and
	   tagline out of their wrapper so they become grid items themselves. */
	.ctv-masthead > .wp-block-group.is-layout-flex {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		column-gap: 16px;
		row-gap: 10px;
	}

	.ctv-masthead > .wp-block-group.is-layout-flex > .wp-block-group {
		display: contents;
	}

	.ctv-masthead .wp-block-site-title {
		grid-column: 1;
		grid-row: 1;
	}

	.ctv-masthead .ctv-nav {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
		margin-left: 0;
	}

	.ctv-masthead .ctv-tagline {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	/* Menu links are full-width rows (a large, easy tap target) — correct —
	   but a 2px rectangle around that row reads like a stray panel floating
	   over the menu. Swap it for a tint plus a left bar; the transparent
	   outline keeps the focus indicator intact in forced-colors mode. */
	.ctv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
		outline: 2px solid transparent;
		outline-offset: -2px;
		background: rgba(255, 90, 43, 0.12);
		box-shadow: inset 3px 0 0 var(--orange);
	}

	/* The desktop clamp tops out at a phone-hostile size: at 390px the
	   headline ran to four stacked lines with "TO." alone at the bottom.
	   Measured on the live page, 38px sets it in two even lines. */
	.ctv-hero__title {
		font-size: clamp(30px, 9.6vw, 44px) !important;
	}
}

/* ============================================================
   5. Kicker / eyebrow label
   ============================================================ */
.ctv-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.ctv-kicker::before {
	content: "";
	width: 6px;
	height: 6px;
	background: var(--orange);
	border-radius: 50%;
	flex: 0 0 auto;
}

.ctv-kicker--bare::before {
	display: none;
}

/* ============================================================
   6. Ticker
   The track is duplicated at runtime by ticker.js. With JS off it
   is simply a readable static row, so nothing is lost.
   ============================================================ */
.ctv-ticker {
	display: flex;
	align-items: stretch;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: var(--coal);
	overflow: hidden;
}

.ctv-ticker__label {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 18px;
	background: var(--orange);
	color: #160a05;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	position: relative;
	z-index: 2;
	/* Cast the band's own background over the marquee so headlines read as
	   sliding out from behind it rather than through it. */
	box-shadow: 18px 0 22px -6px var(--coal);
}

.ctv-ticker__view {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	position: relative;
	/* The track scrolls right-to-left, so the LEFT edge is where headlines
	   leave the frame and the right edge is where they arrive. Fade both: a
	   short fade at the exit edge reads as a mid-word chop, so it is wide
	   enough (~110px) to dissolve a word; the entry edge stays at 84px. */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 110px, #000 calc(100% - 84px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 110px, #000 calc(100% - 84px), transparent 100%);
}

.ctv-ticker__track {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 14px 20px 14px 30px;
	width: max-content;
	will-change: transform;
}

.ctv-ticker.is-running .ctv-ticker__track {
	animation: ctv-marquee var(--ctv-ticker-duration, 52s) linear infinite;
}

.ctv-ticker:hover .ctv-ticker__track,
.ctv-ticker:focus-within .ctv-ticker__track {
	animation-play-state: paused;
}

@keyframes ctv-marquee {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(-50%, 0, 0); }
}

/* The track is a core/query rendering a post-template list. Both the
   list and its items have to be flattened into one flex row, otherwise
   the marquee measure is wrong and the clone jump is visible. */
.ctv-ticker__track .wp-block-post-template {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-ticker__track li {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
}

.ctv-ticker__track li::after {
	content: "•";
	color: var(--orange);
	font-size: 10px;
	line-height: 1;
}

.ctv-ticker__track .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.ctv-ticker__track .wp-block-post-title a {
	color: var(--bone-2);
	text-decoration: none;
}

.ctv-ticker__track .wp-block-post-title a:hover {
	color: var(--amber);
}

@media (prefers-reduced-motion: reduce) {
	.ctv-ticker.is-running .ctv-ticker__track {
		animation: none;
		transform: none;
	}
	.ctv-ticker__view {
		overflow-x: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}
}

/* ============================================================
   7. Hero
   ============================================================ */
.ctv-hero {
	border-bottom: 1px solid var(--line);
}

.ctv-hero__title {
	font-family: var(--wp--preset--font-family--display);
	/* theme.json's display preset floors at 48px, which turns a five-word
	   headline into five phone-height lines. Two things are needed to win:
	   the heading also carries wp's generated .has-display-font-size class,
	   whose font-size is declared !important in the global-styles block — so
	   this rule has to be !important too, and the selector is doubled up for
	   specificity. Verified on the live site: 390px viewport now sets two
	   balanced lines instead of four with "TO." orphaned on its own. */
	font-size: clamp(36px, 8.4vw, 104px) !important;
	text-transform: uppercase;
	letter-spacing: -0.02em;
	line-height: 0.88;
	text-wrap: balance;
	/* 0.88 line-height pulls the caps above their box: give the kicker air. */
	margin: clamp(14px, 2vw, 26px) 0 0;
}

.ctv-hero__dek {
	font-family: var(--wp--preset--font-family--body);
	font-size: clamp(18px, 2vw, 21px);
	line-height: 1.5;
	color: var(--bone-2);
	max-width: 46ch;
	margin: clamp(16px, 1.6vw, 22px) 0 0;
}

/* Stat rail under the hero */
.ctv-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	border-top: 1px solid var(--line);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-stats > * {
	margin: 0;
	padding: 20px 24px 20px 0;
	border-right: 1px solid var(--line);
}

.ctv-stats > * + * {
	padding-left: 24px;
}

.ctv-stats > *:last-child {
	border-right: 0;
}

.ctv-stats > * > * {
	margin: 0;
}

.ctv-stats__n {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: 38px;
	line-height: 1;
	color: var(--bone);
	font-variant-numeric: tabular-nums;
}

.ctv-stats__l {
	display: block;
	margin-top: 4px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ============================================================
   8. Post cards — typographic poster tiles
   No featured images exist on this site, so the headline is the
   artwork. Cards stay legible without any imagery.
   ============================================================ */
.ctv-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 260px;
	padding: 20px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--r);
	overflow: hidden;
	isolation: isolate;
	transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

/* Auto-number the tiles 01, 02, 03… so grids never look repetitive.
   A card can override its numeral with data-channel="07". */
.wp-block-post-template,
.ctv-grid {
	counter-reset: ctv-tile;
}

.wp-block-post-template > li,
.ctv-grid > li {
	counter-increment: ctv-tile;
}

.ctv-tile::before {
	content: counter(ctv-tile, decimal-leading-zero);
	position: absolute;
	top: -0.16em;
	right: 0.04em;
	font-family: var(--wp--preset--font-family--display);
	font-size: 150px;
	line-height: 1;
	color: var(--bone);
	opacity: 0.055;
	z-index: -1;
	pointer-events: none;
}

.ctv-tile[data-channel]::before {
	content: attr(data-channel);
}

.ctv-tile:hover {
	border-color: var(--line-2);
	background: var(--panel-2);
	transform: translateY(-2px);
}

.ctv-tile .wp-block-post-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(19px, 1.6vw, 24px);
	line-height: 1.02;
	text-transform: uppercase;
	letter-spacing: -0.005em;
	margin: 0;
}

.ctv-tile .wp-block-post-title a {
	color: var(--bone);
	text-decoration: none;
}

/* Whole card is one click target — no nested anchors. */
.ctv-tile .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.ctv-tile .wp-block-post-title a:hover {
	color: var(--orange);
}

.ctv-tile .wp-block-post-terms {
	margin: 0;
	min-width: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/* Terms sit one step brighter than the date so the kicker reads as
	   content and the date reads as a stamp. */
	color: var(--bone-2);
}

.ctv-tile .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
	position: relative;
	z-index: 3;
}

.ctv-tile__meta {
	/* Stacked, not a row: a row wraps the moment a long term list meets a
	   date, and the "/" divider is then orphaned at the head of line two —
	   reads as a typo. Two lines, every card, no divider. */
	display: grid;
	gap: 3px;
	justify-items: start;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 8px;
}

.ctv-tile__meta > * + *::before {
	content: none;
}

.ctv-tile__meta .wp-block-post-date {
	white-space: nowrap;
	font-size: 10px;
	letter-spacing: 0.16em;
}

/* Lead card: bigger, orange wash */
.ctv-tile--lead {
	min-height: 420px;
	background: linear-gradient(150deg, #24140d 0%, var(--panel) 62%);
	border-color: #3b241a;
}

.ctv-tile--lead .wp-block-post-title {
	font-size: clamp(30px, 3.4vw, 46px);
}

.ctv-tile--lead .wp-block-post-excerpt {
	color: var(--bone-2);
	font-size: 15px;
	line-height: 1.55;
	max-width: 44ch;
	margin-top: 10px;
}

.ctv-tile--lead::before {
	font-size: 260px;
	opacity: 0.07;
	color: var(--orange);
}

/* ============================================================
   9. Crap Scale badge
   Empty until a score exists, then it styles itself.
   ============================================================ */
.ctv-score {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 26px;
	line-height: 1;
	color: var(--orange);
	font-variant-numeric: tabular-nums;
}

.ctv-score:empty {
	display: none;
}

.ctv-score small {
	font-size: 13px;
	color: var(--muted);
	font-family: var(--wp--preset--font-family--mono);
}

/* ============================================================
  10. Diary strip — compact single-row items
   ============================================================ */
.ctv-diary {
	display: grid;
	gap: 0;
	border-top: 1px solid var(--line);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-diary > li {
	border-bottom: 1px solid var(--line);
}

.ctv-diary__row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 20px;
	padding: 16px 0;
	text-decoration: none;
	position: relative;
}

.ctv-diary__row::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ctv-diary__date {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.ctv-diary__title {
	font-family: var(--wp--preset--font-family--body);
	font-size: 17px;
	font-weight: 700;
	color: var(--bone);
	text-decoration: none;
	min-width: 0;
	overflow-wrap: anywhere;
}

li:hover .ctv-diary__title {
	color: var(--orange);
}

/* ============================================================
  11. Editorial prose
   ============================================================ */
.ctv-prose > p {
	font-size: clamp(17px, 1.35vw, 19px);
	line-height: 1.72;
	color: #e6ddcc;
}

.ctv-prose > p + p {
	margin-top: 1.15em;
}

.ctv-prose a {
	color: var(--orange);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.ctv-prose blockquote {
	margin: 2em 0;
	padding: 4px 0 4px 24px;
	border-left: 3px solid var(--orange);
	font-family: var(--wp--preset--font-family--body);
	font-style: italic;
	font-size: clamp(19px, 1.8vw, 23px);
	color: var(--bone);
}

.ctv-prose h2,
.ctv-prose h3 {
	margin-top: 1.8em;
	margin-bottom: 0.5em;
}

/* ============================================================
  12. Single post header
   ============================================================ */
.ctv-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0;
}

.ctv-post-meta > * + *::before {
	content: "/";
	margin-right: 12px;
	color: var(--line-2);
}

.ctv-post-header .wp-block-post-title {
	font-size: clamp(34px, 5.6vw, 78px);
	margin: 10px 0 0;
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	line-height: 0.9;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

/* ============================================================
  13. Query pagination + footer
   ============================================================ */
.wp-block-query-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: clamp(24px, 3vw, 40px);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-top: 1px solid var(--line);
	padding-top: 20px;
}

.wp-block-query-pagination a {
	color: var(--orange);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 2px;
}

.wp-block-query-pagination a:hover {
	border-bottom-color: currentColor;
}

.wp-block-query-pagination-previous::before {
	content: "\2190\00a0";
}

.wp-block-query-pagination-next::after {
	content: "\00a0\2192";
}

.wp-block-query-pagination-numbers {
	color: var(--muted);
}

.ctv-footer {
	border-top: 1px solid var(--line);
	background: var(--coal);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.ctv-footer a {
	color: var(--bone-2);
	text-decoration: none;
}

.ctv-footer a:hover {
	color: var(--orange);
}

/* ============================================================
  17. Small screens
   ============================================================ */
@media (max-width: 700px) {
	/* Cards are bottom-justified, so min-height is pure air on top. At 210px
	   a ten-result search list opened every card with a 76px empty band; the
	   content itself only needs ~120px. */
	.ctv-tile {
		min-height: 150px;
		padding: 16px;
	}
	/* A 150px poster numeral is atmosphere on a 403px card and a void on a
	   358px one. Halve it so the ghost still anchors the corner. */
	.ctv-tile::before {
		font-size: 92px;
		top: -0.1em;
	}
	.ctv-tile--lead {
		min-height: 320px;
	}
	.ctv-diary__row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
	/* 110px of fade is right on a 900px strip, but the view is only ~262px
	   wide on a phone, so the same fade eats 42% of it and the readable band
	   turns into a postage stamp. Scale the fade to the strip: this rule has
	   to live after the base .ctv-ticker__view declaration to win the
	   cascade — inside the 781px block it lost to it. */
	.ctv-ticker__view {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34px, #000 calc(100% - 26px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 34px, #000 calc(100% - 26px), transparent 100%);
	}

	/* Side by side, the 128px label claims a third of a 390px bar and the
	   marquee gets a 262px letterbox. Stack them instead: label as a full
	   width tab on top, the strip gets the whole width. */
	.ctv-ticker {
		flex-direction: column;
	}

	.ctv-ticker__label {
		justify-content: flex-start;
		padding: 8px 16px;
		box-shadow: none;
	}

	.ctv-ticker__view {
		height: 44px;
	}
}

/* ============================================================
  14. Pattern: latest grid
   The first card runs double-width so the page opens with one
   dominant headline instead of a uniform matrix.
   ============================================================ */
.ctv-latest .wp-block-post-template,
.ctv-archive .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-latest .wp-block-post-template > li,
/* The archive's page title has to outrank the tile titles below it. */
.ctv-archive-title {
	font-size: clamp(38px, 7vw, 92px);
	line-height: 0.9;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	margin: 10px 0 0;
}

.ctv-archive .wp-block-post-template > li {
	display: flex;
	margin: 0;
	min-width: 0;
}

.ctv-latest .wp-block-post-template > li > .ctv-tile,
.ctv-archive .wp-block-post-template > li > .ctv-tile {
	flex: 1 1 auto;
}

.ctv-latest li:first-child {
	grid-column: span 2;
}

.ctv-latest li:first-child .ctv-tile {
	min-height: 420px;
	background: linear-gradient(150deg, #24140d 0%, var(--panel) 62%);
	border-color: #3b241a;
}

.ctv-latest li:first-child .ctv-tile .wp-block-post-title {
	font-size: clamp(30px, 3.4vw, 46px);
}

.ctv-latest li:first-child .ctv-tile::before {
	font-size: 250px;
	opacity: 0.07;
	color: var(--orange);
}

/* Two lines of real copy on every tile. Hiding the excerpt left a 150px void
   in each card — the poster numeral is atmosphere, not content. */
.ctv-latest .ctv-tile__excerpt,
.ctv-archive .ctv-tile__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 10px 0 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--muted);
}

.ctv-latest li:first-child .ctv-tile__excerpt {
	display: block;
	margin: 12px 0 0;
	max-width: 46ch;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15.5px;
	line-height: 1.55;
	color: var(--bone-2);
}

/* ============================================================
  15. Pattern: rundown rows
   ============================================================ */
.ctv-rows .wp-block-post-template {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctv-rows li {
	border-bottom: 1px solid var(--line);
	margin: 0;
}

.ctv-rows li:first-child {
	border-top: 1px solid var(--line);
}

.ctv-rows .ctv-diary__row {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	align-items: baseline;
	gap: 20px;
	padding: 15px 0;
	margin: 0;
}

.ctv-rows .ctv-diary__row > * {
	margin: 0;
}

/* ============================================================
  16. Pattern: Crap Scale explainer
   ============================================================ */
.ctv-scale {
	display: grid;
	gap: 0;
	border-top: 1px solid var(--line);
}

.ctv-scale__row {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	align-items: baseline;
	gap: 24px;
	padding: 18px 0;
	border-bottom: 1px solid var(--line);
	margin: 0;
}

.ctv-scale__row > * {
	margin: 0;
}

.ctv-scale__n {
	font-family: var(--wp--preset--font-family--display);
	font-size: 34px;
	color: var(--bone);
	font-variant-numeric: tabular-nums;
}

.ctv-scale__d {
	font-size: 16.5px;
	line-height: 1.5;
	color: var(--bone-2);
}

/* Standalone lede paragraph (not inside .ctv-prose) */
.ctv-lede {
	font-size: clamp(17px, 1.4vw, 19.5px);
	line-height: 1.6;
	color: var(--bone-2);
	max-width: 62ch;
}

/* ============================================================
  17. Single + page article shell
   ============================================================ */
/* The masthead centres a 1240px column inside 44px of padding, so at
   1440px its content edge sits at 92px. Sections that only pad 44px park
   their content to the left of the logo above them; the archive kicker
   and the single-post headline both drifted that way. Same formula here,
   for every section including archives, so the page shares one edge. */
.ctv-section {
	padding-inline: max(clamp(16px, 4vw, 44px), calc((100% - 1240px) / 2));
}

.ctv-article {
	/* Prose keeps a reading measure even though the shell is 1240px.
	   76ch lands near 620px at the 17px body size: ~66-70 characters. */
	--ctv-canvas: 76ch;
}

.ctv-article > .wp-block-post-content {
	max-width: var(--ctv-canvas);
	/* Flush left with the headline, not centred in the shell: the eye
	   follows one vertical line from title to last paragraph. */
	margin-inline: 0;
}

.ctv-article .wp-block-post-content > p:first-of-type {
	font-size: clamp(18px, 1.5vw, 20px);
	color: #efe7d7;
}

@media (max-width: 1040px) {
	.ctv-latest .wp-block-post-template,
	.ctv-archive .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.ctv-latest li:first-child {
		grid-column: span 2;
	}
	.ctv-latest li:first-child .ctv-tile {
		min-height: 300px;
	}
	.ctv-rows .ctv-diary__row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

@media (max-width: 620px) {
	.ctv-latest .wp-block-post-template,
	.ctv-archive .wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
	}
	.ctv-latest li:first-child {
		grid-column: span 1;
	}
	.ctv-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ctv-stats > *:nth-child(2) {
		border-right: 0;
	}
	.ctv-hero__dek {
		font-size: 17px;
	}
}

/* ------------------------------------------------------------
   Card excerpts: sentence case, body type
   ------------------------------------------------------------
   The tile sets uppercase for its metadata; the excerpt inherits it and
   turns three lines of real review copy into shouting. Body face, body case.
   ------------------------------------------------------------ */
.ctv-latest .ctv-tile__excerpt,
.ctv-archive .ctv-tile__excerpt {
	text-transform: none;
	letter-spacing: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--muted);
	margin: 10px 0 0;
}
/* The clamp has to live on the element that holds the text, not the wrapper. */
.ctv-latest .ctv-tile__excerpt p,
.ctv-archive .ctv-tile__excerpt p {
	margin: 0;
	font: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
	color: inherit;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Lead card has room for a third line. */
.ctv-latest .wp-block-post-template > li:first-child .ctv-tile__excerpt p {
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

/* ------------------------------------------------------------
   Search form
   ------------------------------------------------------------
   The core search block inherits a UA-white input on a noir page —
   the single brightest element on the site, and it sits directly
   under the H1. Same treatment as the comment fields so the two
   forms read as one family: panel fill, hairline, bone text.
   The button keeps its theme.json orange; the field just needs to
   stop shouting. 16px again, for the iOS zoom.
   ------------------------------------------------------------ */
.wp-block-search {
	display: flex;
	gap: 10px;
	align-items: stretch;
	margin: 26px 0 0;
	max-width: 780px;
}

.wp-block-search__inside-wrapper {
	display: flex;
	gap: 10px;
	width: 100%;
	border: 0;
	padding: 0;
	background: none;
}

.wp-block-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.wp-block-search__input {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--panel);
	color: var(--bone);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 12px 16px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
}

.wp-block-search__input::placeholder {
	color: var(--muted);
	opacity: 0.7;
}

.wp-block-search__input:focus {
	border-color: var(--amber);
	outline: 1px solid var(--amber);
	outline-offset: -1px;
}

.wp-block-search__button {
	flex: 0 0 auto;
	margin: 0;
	border: 0;
	cursor: pointer;
}

/* ------------------------------------------------------------
   Comment form
   ------------------------------------------------------------
   Core ships the fields with their UA defaults: a white textarea,
   black 14px serif text, on a noir page. Every other surface here is
   a panel with a hairline; the form has to match or it reads as a
   foreign object. 16px stops iOS from zooming the viewport on focus
   (anything under 16px triggers auto-zoom, and the zoom never resets).
   ------------------------------------------------------------ */
.wp-block-post-comments-form p,
.wp-block-post-comments-form .comment-form-comment,
.wp-block-post-comments-form .comment-form-author,
.wp-block-post-comments-form .comment-form-email,
.wp-block-post-comments-form .comment-form-url {
	margin: 0 0 18px;
}

.wp-block-post-comments-form label {
	display: block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 6px;
}

.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"],
.wp-block-post-comments-form textarea {
	width: 100%;
	background: var(--panel);
	color: var(--bone);
	border: 1px solid var(--line);
	border-radius: 0;
	padding: 12px 14px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
}

.wp-block-post-comments-form textarea {
	min-height: 140px;
	resize: vertical;
}

.wp-block-post-comments-form input[type="text"]:focus,
.wp-block-post-comments-form input[type="email"]:focus,
.wp-block-post-comments-form input[type="url"]:focus,
.wp-block-post-comments-form textarea:focus {
	border-color: var(--amber);
	outline: 1px solid var(--amber);
	outline-offset: -1px;
}

.wp-block-post-comments-form ::placeholder {
	color: var(--muted);
	opacity: 0.7;
}

/* Core checkboxes render as OS-white squares, which punch holes in a dark
   form. accent-color only tints the checked state, so the unchecked box
   stays white — strip the native control and draw it from the palette.
   Something on the page (core's form normalization) writes
   style="width:auto; -webkit-appearance:checkbox" inline on the input, so
   these declarations have to be !important to beat it. */
.wp-block-post-comments-form input[type="checkbox"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	width: 16px !important;
	height: 16px !important;
	margin: 0 9px 0 0;
	border: 1px solid var(--line-2) !important;
	background: var(--panel) !important;
	border-radius: 0;
	cursor: pointer;
	position: relative;
	top: 3px;
	flex: none;
}

.wp-block-post-comments-form input[type="checkbox"]:checked {
	background: var(--orange) !important;
	border-color: var(--orange) !important;
}

.wp-block-post-comments-form input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3 3 6.6-7' fill='none' stroke='%23120f0d' stroke-width='2.2' stroke-linecap='square'/%3E%3C/svg%3E") center/12px no-repeat;
}

.wp-block-post-comments-form input[type="checkbox"]:focus-visible {
	outline: 1px solid var(--amber);
	outline-offset: 2px;
}

/* The submit button already carries the orange; just give it the mono
   label treatment so it stops looking like a default form control. */
.wp-block-post-comments-form input[type="submit"],
.wp-block-post-comments-form .submit {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border: 1px solid var(--orange);
	border-radius: 0;
	padding: 14px 26px;
	cursor: pointer;
}

.wp-block-post-comments-form input[type="submit"]:hover,
.wp-block-post-comments-form .submit:hover {
	background: var(--amber);
	color: #160a05;
}

/* "Logged in as Tom" — a line of admin chatter above a form should not
   compete with the form; step it down. */
.wp-block-post-comments-form .logged-in-as,
.comment-notes {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	color: var(--muted);
}

/* ------------------------------------------------------------
   Core preset shim
   ------------------------------------------------------------
   Several core block stylesheets reference accent slots we do not
   declare (the comments form does `border-color:
   var(--wp--preset--color--accent-6) !important`, quotes use accent-4).
   An undefined var there is not a no-op: it invalidates the declaration
   and the border falls back to currentColor, i.e. a bone-white box on a
   noir page. Declaring the slots costs nothing and keeps core's intent.
   ------------------------------------------------------------ */
:root {
	--wp--preset--color--accent-4: #8e8477;
	--wp--preset--color--accent-6: #2e2823;
}

.wp-block-post-comments-form p:has(> input[type="checkbox"]) {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.wp-block-post-comments-form input[type="checkbox"] {
	accent-color: var(--orange);
	margin: 2px 0 0;
	flex: 0 0 auto;
}

/* Consent lines sit next to their box, not under it, and they are prose
   not field labels — so no uppercase mono treatment here. */
.wp-block-post-comments-form p:has(> input[type="checkbox"]) label {
	display: inline;
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	line-height: 1.45;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--muted);
}

/* Tag list under a review: the template puts it in its own section with
   --spacing-60 on top. At 390px that is a third of a screen of nothing
   between the last sentence and the tag row. */
@media (max-width: 620px) {
	.single .ctv-section:has(.wp-block-post-terms) {
		padding-top: var(--wp--preset--spacing--40);
	}
}

