/**
 * The Dark Side — component styles.
 *
 * All content is core blocks (Group, Paragraph, Heading, Post Title, Query
 * Loop, Navigation, Image…); this file only styles them through the classes
 * set in the templates and patterns. Purely decorative pieces (orbit rings,
 * glows, arrows, cursors) are drawn here so editors never have
 * to manage them.
 *
 * Sections: tokens · base · layout · header/nav · hero · marquee · topics ·
 * cards · about · subscribe · band · footer · archive · issue page · prose ·
 * motion · responsive · editor.
 */

/* ---------- Tokens ---------- */

:root {
	--tds-bg: var(--wp--preset--color--background, #0b0d10);
	--tds-surface: var(--wp--preset--color--surface, #13161b);
	--tds-border: var(--wp--preset--color--border, #1e232b);
	--tds-border-strong: var(--wp--preset--color--border-strong, #2a303a);
	--tds-text: var(--wp--preset--color--text, #edeff2);
	--tds-muted: var(--wp--preset--color--text-muted, #a0a8b3);
	--tds-dim: var(--wp--preset--color--text-dim, #7d8794);
	--tds-body: var(--wp--preset--color--body-copy, #d3d7dd);
	--tds-accent: var(--wp--preset--color--accent, #ff5a4e);
	--tds-accent-soft: var(--wp--preset--color--accent-soft, #ff8a80);
	--tds-featured-border: #3a2326;
	--tds-ghost: #232832;

	--tds-display: var(--wp--preset--font-family--display, "Inter Tight", sans-serif);
	--tds-sans: var(--wp--preset--font-family--body, Inter, system-ui, sans-serif);
	--tds-mono: var(--wp--preset--font-family--mono, "JetBrains Mono", monospace);

	--tds-gutter: 32px;
	--tds-wide: 1240px;
	--tds-dots: radial-gradient(var(--tds-border) 1px, transparent 1px) 0 0 / 28px 28px;

	/* Logo mark as a watermark on the red bands. */
	--tds-mark-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12' fill='none' stroke='%230B0D10' stroke-width='1'/%3E%3Cpath d='M14 2 A12 12 0 0 0 14 26 Z' fill='%230B0D10'/%3E%3C/svg%3E");
}

/*
 * Topic colours: text (--topic), dot/icon (--topic-dot), icon tile (--topic-bg).
 * Neutral here; each category's colour (Posts → Categories) is added as
 * inline CSS by inc/topics.php for "is-topic-<slug>" classes, posts in
 * Query Loops (category-<slug>) and terms in Terms Query lists (term-<id>).
 */
[class*="is-topic-"],
.wp-block-post,
.wp-block-term {
	--topic: var(--tds-muted);
	--topic-dot: var(--tds-dim);
	--topic-bg: rgba(160, 168, 179, 0.12);
}
.is-topic-all { --topic-dot: var(--tds-accent); }

/* ---------- Base ---------- */

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: var(--tds-accent); color: var(--tds-bg); }
input::placeholder { color: var(--tds-dim); opacity: 1; }
:focus-visible { outline: 2px solid var(--tds-accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* Inside theme components spacing comes from flex/grid gaps, not browser margins. */
:where([class*="tds-"], [class*="is-style-"], .wp-block-post, .wp-block-query, .wp-block-pullquote blockquote) > :where(p, h1, h2, h3, h4, h5, h6, figure, ul, ol, blockquote) { margin-block: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tds-accent { color: var(--tds-accent); }

/* Outlined text (format "Outlined" in the editor toolbar), solid where unsupported. */
.tds-outline { color: var(--tds-muted); }
@supports (-webkit-text-stroke: 1px) {
	.tds-outline { color: transparent; -webkit-text-stroke: 2px var(--tds-text); }
}

.is-style-eyebrow {
	font-family: var(--tds-mono);
	font-size: 13px;
	line-height: 1.5;
	color: var(--tds-accent);
}

.tds-terminal { font: inherit; color: inherit; background: none; }

.tds-lede {
	max-width: 580px;
	font-size: 20px;
	line-height: 1.6;
	color: var(--tds-muted);
}

.tds-badge {
	flex-shrink: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--tds-accent);
	color: var(--tds-bg);
	font-family: var(--tds-sans);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
}

/* Chip with a coloured dot ("#ai"). */
.tds-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 13px;
	line-height: 1.4;
	color: var(--tds-body);
}
.tds-chip::before {
	content: "";
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--topic-dot, var(--tds-dim));
}

/* Meta line: a Group with Post Terms, Time to Read and Post Date, dot-separated. */
.tds-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	font-family: var(--tds-mono);
	font-size: 12px;
	line-height: 1.5;
	color: var(--topic, var(--tds-muted));
}
.tds-meta > * + *::before { content: "·" / ""; margin-right: 8px; }
.tds-meta a { position: relative; z-index: 2; color: inherit; text-transform: lowercase; }
.tds-meta a:hover { color: var(--tds-text); }

/* Issue number: a Paragraph bound to the "issue_number" post meta. */
.tds-issue-no::before { content: "#"; }
.tds-issue-no:empty { display: none; }

/* Whole-card links: the title link stretches over its card. */
:is(.tds-card, .tds-row, .tds-topic, .tds-new-pill, .tds-reply-card) { position: relative; isolation: isolate; }
:is(.tds-card__title, .tds-row__title, .tds-topic__title, .tds-new-pill__title, .tds-reply-card__title) a { color: inherit; }
:is(.tds-card__title, .tds-row__title, .tds-topic__title, .tds-new-pill__title, .tds-reply-card__title) a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}
:is(.tds-card__title, .tds-row__title, .tds-topic__title, .tds-new-pill__title, .tds-reply-card__title) a:focus-visible { outline: none; }
:is(.tds-card__title, .tds-row__title, .tds-topic__title, .tds-new-pill__title, .tds-reply-card__title) a:focus-visible::after {
	outline: 2px solid var(--tds-accent);
	outline-offset: 3px;
}
:is(.tds-card, .tds-row, .tds-topic, .tds-new-pill, .tds-reply-card) { border-radius: var(--tds-radius, 0); }

/* Buttons (core/button). Filled = red pill, outline = bordered pill. */
.wp-block-buttons { gap: 10px; }
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	box-sizing: border-box;
	padding: 12px 22px;
	border-radius: 999px;
	font-size: 15px;
	line-height: 1.2;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.wp-block-button.is-style-outline .wp-block-button__link {
	padding: 12px 20px;
	border: 1px solid var(--tds-border-strong);
	background: transparent;
	color: var(--tds-text);
	font-weight: 400;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--tds-dim);
	background: var(--tds-surface);
	color: var(--tds-text);
}

/* ---------- Layout ---------- */

.wp-site-blocks {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: clip;
	background: var(--tds-dots), var(--tds-bg);
}

.tds-main { display: flex; flex-direction: column; flex: 1 0 auto; }

/* The dot grid shows only behind the header and the first ("hero zone") section. */
.tds-main > :not(.tds-hero-zone, .tds-home-content),
.tds-home-content > :not(.tds-hero-zone),
.tds-site-footer {
	position: relative;
	background-color: var(--tds-bg);
}
.tds-hero-zone { position: relative; }

/* Home: the sections are the Home page's own content (Pages → Home). */
.tds-home-content { display: flex; flex-direction: column; }

.tds-container {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--tds-wide) + 2 * var(--tds-gutter));
	margin-inline: auto;
	padding-inline: var(--tds-gutter);
}

.tds-section { display: flex; flex-direction: column; gap: 40px; padding-block: 72px 40px; }
.tds-section--latest { padding-bottom: 96px; }
.tds-section--about { padding-top: 0; padding-bottom: 112px; }
.tds-section--related { gap: 32px; padding-bottom: 112px; }

.tds-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}
.tds-section-head__titles { display: flex; flex-direction: column; gap: 12px; }
.tds-section-title {
	font-family: var(--tds-display);
	font-size: clamp(36px, 4.5vw, 56px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
}
.tds-section-title--sm { font-size: clamp(32px, 4vw, 48px); }

/* ---------- Header & navigation ---------- */

.tds-site-header { position: relative; z-index: 20; }
.tds-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 22px;
}

/* Logo: an Icon block (the mark) and the Site Title, plus a blinking cursor. */
.tds-brand { position: relative; display: flex; align-items: center; gap: 10px; }
.tds-brand__mark svg { display: block; width: 30px; height: 30px; color: var(--tds-text); }
.tds-brand .tds-logo a::before { content: ""; position: absolute; inset: 0; }
.tds-logo {
	font-family: var(--tds-display);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}
.tds-logo a {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--tds-text);
	text-transform: lowercase;
	white-space: nowrap;
}
.tds-logo a:hover { color: var(--tds-text); }
.tds-logo a::after {
	content: "_";
	margin-left: -10px;
	color: var(--tds-accent);
	animation: tds-blink 1.1s step-end infinite;
}

.tds-nav .wp-block-navigation__container {
	gap: 6px;
	padding: 6px;
	border: 1px solid var(--tds-border);
	border-radius: 999px;
	background: rgba(19, 22, 27, 0.8);
	font-size: 15px;
}
.tds-nav .wp-block-navigation-item__content {
	display: block;
	padding: 10px 16px;
	border-radius: 999px;
	color: var(--tds-muted);
	line-height: 1.5;
	transition: color 0.15s, background-color 0.15s;
}
.tds-nav .wp-block-navigation-item__content:hover { color: var(--tds-text); }
.tds-nav .current-menu-item > .wp-block-navigation-item__content {
	background: var(--tds-border);
	color: var(--tds-text);
}
.tds-nav .tds-nav-cta > .wp-block-navigation-item__content {
	padding-inline: 18px;
	background: var(--tds-accent);
	box-shadow: 0 0 24px rgba(255, 90, 78, 0.45);
	color: var(--tds-bg);
	font-weight: 700;
}
.tds-nav .tds-nav-cta > .wp-block-navigation-item__content:hover { background: #ff6e63; color: var(--tds-bg); }

/* Mobile menu toggle + overlay (core/navigation). */
.tds-nav .wp-block-navigation__responsive-container-open,
.tds-nav .wp-block-navigation__responsive-container-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: rgba(19, 22, 27, 0.8);
	color: var(--tds-text);
}
.tds-nav .wp-block-navigation__responsive-container-close { position: static; margin-left: auto; }
.tds-nav .wp-block-navigation__responsive-container-open svg,
.tds-nav .wp-block-navigation__responsive-container-close svg { width: 22px; height: 22px; fill: currentColor; }
@media (min-width: 600px) {
	.tds-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; }
}

.tds-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 16px var(--tds-gutter) 32px;
	background: var(--tds-bg) var(--tds-dots);
	color: var(--tds-text);
}
.tds-nav .is-menu-open .wp-block-navigation__responsive-close { max-width: none; }
.tds-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 40px; }
.tds-nav .is-menu-open .wp-block-navigation__container {
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--tds-display);
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.03em;
}
.tds-nav .is-menu-open .wp-block-navigation-item { width: 100%; }
.tds-nav .is-menu-open .wp-block-navigation-item__content {
	padding: 14px 0;
	border-radius: 0;
	border-bottom: 1px solid var(--tds-border);
	color: var(--tds-text);
}
.tds-nav .is-menu-open .current-menu-item > .wp-block-navigation-item__content { background: none; color: var(--tds-accent); }
.tds-nav .is-menu-open .tds-nav-cta > .wp-block-navigation-item__content {
	margin-top: 24px;
	padding: 16px 22px;
	border: 0;
	border-radius: 12px;
	font-family: var(--tds-sans);
	font-size: 18px;
	letter-spacing: 0;
	text-align: center;
}

/* ---------- Hero ---------- */

.tds-hero { z-index: 1; }
.tds-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 48px;
	padding-block: 56px 112px;
}
.tds-hero__copy {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 999 1 600px;
	flex-direction: column;
	gap: 30px;
	min-width: 0;
}

/* "NEW Issue #08: <title> →" — a one-post Query Loop. */
.tds-latest-pill { align-self: flex-start; max-width: 100%; }
.tds-new-pill {
	display: flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	max-width: 100%;
	padding: 8px 14px 8px 8px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface);
	font-size: 14px;
	line-height: 1.4;
	color: var(--tds-body);
	transition: border-color 0.15s;
}
.tds-new-pill:hover { border-color: var(--tds-dim); }
.tds-new-pill .tds-badge { margin-right: 4px; }
.tds-new-pill__title {
	min-width: 0;
	overflow: hidden;
	font: inherit;
	letter-spacing: normal;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.tds-new-pill::after { content: "→" / ""; flex-shrink: 0; }

.tds-hero__title {
	font-family: var(--tds-display);
	font-size: clamp(48px, 7.4vw, 104px);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.045em;
}
.tds-hero__title .tds-outline { display: block; }
.tds-hero__title::after { content: "_"; color: var(--tds-accent); animation: tds-blink 1.1s step-end infinite; }

.tds-stats { display: flex; flex-wrap: wrap; gap: 36px; }
.tds-stat { display: flex; flex-direction: column; gap: 2px; }
.tds-stat__value {
	font-family: var(--tds-display);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.03em;
}
.tds-stat__label { font-size: 14px; color: var(--tds-dim); }

/*
 * Orbit visual: a Group with the logo (Icon block) and three chip
 * paragraphs. Rings, glow and the satellite dot are background layers.
 */
.tds-hero__visual { display: flex; flex: 1 1 380px; justify-content: center; min-width: 0; }
.tds-orbit {
	position: relative;
	width: 100%;
	max-width: 470px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background:
		radial-gradient(circle closest-side, var(--tds-bg) calc(56% - 1px), var(--tds-border-strong) calc(56% - 1px) 56%, transparent calc(56% + 0.5px)),
		radial-gradient(circle closest-side, rgba(255, 90, 78, 0.38), rgba(255, 90, 78, 0.14) 48%, transparent 76%);
}
.tds-orbit::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px dashed var(--tds-border-strong);
	border-radius: 50%;
	background:
		radial-gradient(circle 5px at 50% 11%, var(--tds-accent) 99%, transparent),
		radial-gradient(circle 16px at 50% 11%, rgba(255, 90, 78, 0.45), transparent),
		radial-gradient(circle closest-side, transparent calc(78% - 1px), var(--tds-border) calc(78% - 1px) 78%, transparent calc(78% + 0.5px));
	animation: tds-spin 70s linear infinite;
}
.tds-orbit .tds-orbit__logo {
	position: absolute;
	inset: 32.6%;
	margin: 0;
	color: var(--tds-text);
	animation: tds-float 6s ease-in-out infinite;
}
.tds-orbit__logo svg { display: block; width: 100%; height: 100%; }
/* Topic chips: a Terms Query; however many there are, they spread evenly around the ring. */
.tds-orbit .tds-orbit__topics { position: absolute; inset: 0; margin: 0; }
.tds-orbit__topics .wp-block-term-template { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; --n: 1; }
.tds-orbit__topics .wp-block-term {
	--i: 0;
	--a: calc(var(--i) / var(--n) * 360deg - 120deg);
	position: absolute;
	top: calc(50% + sin(var(--a)) * 46%);
	left: calc(50% + cos(var(--a)) * 46%);
	z-index: 1;
	margin: 0;
	transform: translate(-50%, -50%);
}
.tds-orbit__topics .wp-block-term:nth-child(2) { --i: 1; }
.tds-orbit__topics .wp-block-term:nth-child(3) { --i: 2; }
.tds-orbit__topics .wp-block-term:nth-child(4) { --i: 3; }
.tds-orbit__topics .wp-block-term:nth-child(5) { --i: 4; }
.tds-orbit__topics .wp-block-term:nth-child(6) { --i: 5; }
.tds-orbit__topics .wp-block-term:nth-child(7) { --i: 6; }
.tds-orbit__topics .wp-block-term:nth-child(8) { --i: 7; }
.tds-orbit__topics .wp-block-term:nth-child(9) { --i: 8; }
.tds-orbit__topics .wp-block-term:nth-child(10) { --i: 9; }
.tds-orbit__topics .wp-block-term:nth-child(11) { --i: 10; }
.tds-orbit__topics .wp-block-term:nth-child(12) { --i: 11; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(2):last-child) { --n: 2; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(3):last-child) { --n: 3; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(4):last-child) { --n: 4; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(5):last-child) { --n: 5; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(6):last-child) { --n: 6; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(7):last-child) { --n: 7; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(8):last-child) { --n: 8; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(9):last-child) { --n: 9; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(10):last-child) { --n: 10; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(11):last-child) { --n: 11; }
.tds-orbit__topics .wp-block-term-template:has(> :nth-child(12):last-child) { --n: 12; }
.tds-orbit__topics .tds-chip { padding: 9px 14px; white-space: nowrap; }
.tds-orbit__topics .tds-chip a { color: inherit; text-transform: lowercase; }
.tds-orbit__topics .tds-chip a::before { content: "#"; }
.tds-orbit__topics .tds-chip:hover { border-color: var(--tds-dim); color: var(--tds-text); }

/*
 * Black hole (theme.js adds .is-black-hole): the logo spits out a random
 * 2–4 chips, they orbit, then spiral back in. Chips rest hidden in the
 * centre; .is-out sends one into orbit, .is-in pulls it back.
 */
@property --tds-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --tds-r { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --tds-s { syntax: "<number>"; inherits: false; initial-value: 0; }
.tds-orbit__topics.is-black-hole .wp-block-term-template { animation: tds-spin 48s linear infinite; }
.tds-orbit__topics.is-black-hole .tds-chip { animation: tds-spin 48s linear infinite reverse; }
.tds-orbit__topics.is-black-hole .wp-block-term {
	--tds-a: calc(var(--a0, 0deg) - 240deg);
	--tds-r: 0%;
	--tds-s: 0;
	top: calc(50% + sin(var(--tds-a)) * var(--tds-r));
	left: calc(50% + cos(var(--tds-a)) * var(--tds-r));
	opacity: 0;
	filter: blur(3px);
	transform: translate(-50%, -50%) scale(var(--tds-s));
	pointer-events: none;
}
.tds-orbit__topics.is-black-hole .wp-block-term.is-out {
	--tds-a: var(--a0, 0deg);
	--tds-r: 46%;
	--tds-s: 1;
	opacity: 1;
	filter: none;
	pointer-events: auto;
	transition:
		--tds-a 1.5s cubic-bezier(0.16, 1, 0.3, 1),
		--tds-r 1.5s cubic-bezier(0.16, 1, 0.3, 1),
		--tds-s 1.5s cubic-bezier(0.16, 1, 0.3, 1),
		opacity 0.6s,
		filter 0.9s;
}
.tds-orbit__topics.is-black-hole .wp-block-term.is-in {
	--tds-a: calc(var(--a0, 0deg) + 280deg);
	--tds-r: 0%;
	--tds-s: 0.05;
	opacity: 0;
	filter: blur(4px);
	transition:
		--tds-a 1.3s cubic-bezier(0.55, 0, 0.85, 0.35),
		--tds-r 1.3s cubic-bezier(0.55, 0, 0.85, 0.35),
		--tds-s 1.3s cubic-bezier(0.6, 0, 0.9, 0.3),
		opacity 1.2s ease-in,
		filter 1.2s ease-in;
}
/* The logo gulps when it swallows or spits out topics. */
.tds-orbit__logo.is-feeding svg { animation: tds-gulp 0.8s cubic-bezier(0.3, 1.5, 0.5, 1); }

/* ---------- Subscribe form ---------- */

.tds-subscribe {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	margin: 0;
	padding: 8px;
	border-radius: 18px;
	background: var(--tds-bg);
	color: var(--tds-text);
}
.tds-subscribe--hero {
	border: 1px solid var(--tds-border-strong);
	background: var(--tds-surface);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.tds-subscribe:focus-within { box-shadow: 0 0 0 2px var(--tds-accent); }
.tds-subscribe--hero:focus-within { box-shadow: 0 0 0 2px var(--tds-accent), 0 20px 60px rgba(0, 0, 0, 0.5); }

.tds-subscribe__input,
.tds-subscribe--embed input:is([type="email"], [type="text"]) {
	flex: 1 1 240px;
	min-width: 0;
	height: 54px;
	box-sizing: border-box;
	padding: 0 16px;
	border: 0;
	background: transparent;
	color: var(--tds-text);
	font: inherit;
	font-size: 17px;
}
.tds-subscribe__input:focus,
.tds-subscribe--embed input:focus { outline: none; }

.tds-subscribe__button,
.tds-subscribe--embed :is(button, input[type="submit"]) {
	height: 54px;
	padding: 0 26px;
	border: 0;
	border-radius: 12px;
	background: var(--tds-accent);
	color: var(--tds-bg);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s;
}
.tds-subscribe--hero .tds-subscribe__button { box-shadow: 0 0 32px rgba(255, 90, 78, 0.4); }
.tds-subscribe__button:hover,
.tds-subscribe--embed :is(button, input[type="submit"]):hover { background: #ff6e63; }
.tds-subscribe__button:focus-visible { outline-color: var(--tds-text); outline-offset: 2px; }

/* Provider embeds: let their own markup flow inside the dark pill. */
.tds-subscribe--embed { display: block; }
.tds-subscribe--embed form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tds-subscribe--embed iframe { display: block; width: 100%; border: 0; border-radius: 12px; }

.tds-subscribe__status { margin: -12px 0 0; font-weight: 600; }
.tds-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Marquee ---------- */

.tds-marquee { height: 120px; overflow: hidden; }
.tds-marquee__band {
	position: absolute;
	top: 34px;
	right: -5%;
	left: -5%;
	padding: 14px 0;
	overflow: hidden;
	background: var(--tds-accent);
	color: var(--tds-bg);
	transform: rotate(-2deg);
}
.tds-marquee__track {
	display: flex;
	width: max-content;
	padding-left: 24px;
	font-family: var(--tds-mono);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}
/* theme.js duplicates the keywords into two spans for a seamless loop. */
.tds-marquee__track.is-looping { padding-left: 0; animation: tds-marquee 38s linear infinite; }
.tds-marquee__track > span { padding-right: 24px; }

/* ---------- Topic cards ---------- */

/* A Terms Query: one card per topic ticked "Show on home", numbered 01, 02… */
.tds-topics .wp-block-term-template { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: tds-topic; }
.tds-topics .wp-block-term { display: flex; flex: 1 1 300px; min-width: 0; margin: 0; counter-increment: tds-topic; }
.tds-topic {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	box-sizing: border-box;
	min-width: 0;
	min-height: 300px;
	padding: 32px;
	overflow: hidden;
	border: 1px solid var(--tds-border);
	--tds-radius: 24px;
	background: var(--tds-surface);
	transition: border-color 0.2s, transform 0.2s;
}
.tds-topic:hover { border-color: var(--tds-border-strong); transform: translateY(-2px); }
/* Icon tile: an Icon block, tinted with the topic colour. */
.tds-topic__icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: var(--topic-bg);
	color: var(--topic-dot);
}
.tds-topic__icon svg { width: 26px; height: 26px; }
/* Ghost number: the card's position (01, 02…) drawn as a huge outline behind it. */
.tds-topic::after {
	content: counter(tds-topic, decimal-leading-zero) / "";
	position: absolute;
	right: -8px;
	bottom: -40px;
	z-index: -1;
	font-family: var(--tds-display);
	font-size: 200px;
	font-weight: 900;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1px var(--tds-border-strong);
	pointer-events: none;
}
.tds-topic__title {
	margin-top: auto;
	font-family: var(--tds-display);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.025em;
}
.tds-topic__title a:hover { color: var(--tds-text); }
.tds-topic__desc { max-width: 300px; font-size: 16px; line-height: 1.6; color: var(--tds-muted); }
.tds-topic__desc p { margin: 0; }
.tds-topic__count { font-family: var(--tds-mono); font-size: 12px; color: var(--topic); }

/* ---------- Issue cards (Query Loop items) ---------- */

.tds-card {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 12px;
	box-sizing: border-box;
	padding: 28px;
	overflow: hidden;
	border: 1px solid var(--tds-border);
	--tds-radius: 24px;
	background: var(--tds-surface);
	color: var(--tds-text);
	transition: border-color 0.2s, transform 0.2s;
}
.tds-card:hover { border-color: var(--tds-border-strong); transform: translateY(-2px); }
.tds-card__title {
	font-family: var(--tds-display);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: -0.02em;
}
.tds-card__title a { transition: color 0.15s; }
.tds-card:hover .tds-card__title a { color: var(--tds-accent); }
.tds-card__title em,
.tds-row__title em,
.tds-new-pill__title em { font-style: normal; }
.tds-card__excerpt { font-size: 15px; line-height: 1.6; color: var(--tds-muted); }
.tds-card__foot { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 14px; color: var(--tds-dim); }
.tds-card__foot > * + *::before { content: "·" / ""; margin-right: 8px; }

.tds-card--card { min-height: 220px; }
.tds-card--card .tds-card__excerpt { flex-grow: 1; }
.tds-card--related { min-height: 200px; }
.tds-card--feature .tds-card__title { font-size: 24px; line-height: 1.2; }

.tds-card--latest {
	gap: 20px;
	padding: 40px;
	border-color: var(--tds-featured-border);
	--tds-radius: 28px;
	box-shadow: 0 0 80px rgba(255, 90, 78, 0.12);
}
.tds-card--latest:hover { border-color: #5a2f33; }
.tds-card--latest::before {
	content: "";
	position: absolute;
	top: -120px;
	right: -120px;
	z-index: -1;
	width: 340px;
	height: 340px;
	border-radius: 50%;
	background: var(--tds-accent);
	filter: blur(110px);
	opacity: 0.3;
	pointer-events: none;
}
.tds-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tds-card--latest .tds-badge { padding: 5px 10px; }
.tds-card--latest .tds-meta { font-size: 13px; color: var(--tds-muted); }
.tds-card--latest .tds-card__title {
	max-width: 620px;
	font-size: clamp(30px, 3.4vw, 44px);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.035em;
}
.tds-card--latest .tds-card__excerpt { max-width: 560px; font-size: 17px; }
.tds-card__code {
	margin-top: 8px;
	padding: 20px 22px;
	overflow: hidden;
	border: 1px solid var(--tds-border);
	border-radius: 16px;
	background: var(--tds-bg);
	font-family: var(--tds-mono);
	font-size: 14px;
	line-height: 1.75;
	color: var(--tds-muted);
	white-space: pre-wrap;
}
.tds-card__code:empty { display: none; }
.tds-card__code code { font: inherit; color: inherit; }
.tds-card__code::after,
.is-style-code-window pre code::after { content: "▋" / ""; color: var(--tds-accent); animation: tds-blink 1.1s step-end infinite; }
.tds-card__cta { font-size: 16px; font-weight: 700; color: var(--tds-accent); }
.tds-card__cta:hover { color: var(--tds-accent); }

/* Query Loop wrappers: let cards stretch to fill grid and bento cells. */
.tds-bento,
.tds-card-grid .wp-block-post-template { gap: 20px; }
.tds-bento { display: flex; flex-wrap: wrap; }
.tds-bento__main { flex: 2 1 560px; min-width: 0; }
.tds-bento__side { display: flex; flex: 1 1 320px; flex-direction: column; gap: 20px; min-width: 0; }
.tds-bento__feature { flex-grow: 1; }
.tds-bento .wp-block-query,
.tds-bento .wp-block-post-template,
.tds-bento .wp-block-post { display: flex; flex-direction: column; flex-grow: 1; margin: 0; }
.tds-card-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
	margin: 0;
}
.tds-card-grid .wp-block-post { display: flex; margin: 0; }

.tds-reply-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
	--tds-radius: 24px;
	background: var(--tds-accent);
	color: var(--tds-bg);
	transition: transform 0.2s;
}
.tds-reply-card:hover { transform: translateY(-2px); }
.tds-reply-card a,
.tds-reply-card a:hover { color: var(--tds-bg); }
.tds-reply-card :focus-visible::after { outline-color: var(--tds-text) !important; }
.tds-reply-card__cmd { font-family: var(--tds-mono); font-size: 12px; font-weight: 700; }
.tds-reply-card__title { font-family: var(--tds-display); font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.tds-reply-card__text { font-size: 15px; font-weight: 500; line-height: 1.55; }

/* ---------- Author box ---------- */

.tds-about {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 48px;
	padding: 56px;
	overflow: hidden;
	border: 1px solid var(--tds-border);
	border-radius: 32px;
	background: var(--tds-surface);
}
.tds-about > .tds-ghost {
	position: absolute;
	top: -30px;
	right: -20px;
	font-family: var(--tds-display);
	font-size: 220px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.05em;
	color: transparent;
	-webkit-text-stroke: 1px var(--tds-ghost);
	pointer-events: none;
}
.tds-ghost--term { margin: 0; text-transform: lowercase; }
.tds-ghost--term::before { content: "/"; }
.tds-about__body { position: relative; display: flex; flex: 1 1 420px; flex-direction: column; gap: 16px; min-width: 0; }
.tds-about__name {
	font-size: clamp(32px, 3.6vw, 48px);
	line-height: 1.02;
	letter-spacing: -0.035em;
}
.tds-about__bio { max-width: 640px; font-size: 18px; line-height: 1.65; color: var(--tds-muted); }
/* Social Icons block as outlined pills with labels. */
.wp-block-social-links.tds-socials { gap: 10px; margin: 0; padding: 0; }
.tds-socials .wp-social-link {
	margin: 0;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: transparent !important;
	color: var(--tds-body) !important;
	transition: border-color 0.15s, background-color 0.15s;
}
.tds-socials .wp-social-link:hover { border-color: var(--tds-dim); background: var(--tds-surface) !important; transform: none; }
.tds-socials .wp-block-social-link-anchor { gap: 8px; padding: 10px 16px; font-size: 15px; line-height: 1.2; color: inherit; }
.tds-socials .wp-block-social-link-anchor svg { width: 18px; height: 18px; fill: currentColor; }
.wp-block-social-links.tds-socials .wp-social-link span:not(.screen-reader-text) { margin: 0; font-size: 15px; }

/* Author photo: the Avatar block, showing the profile photo from Users → Profile. */
.tds-avatar { position: relative; flex-shrink: 0; margin: 0; line-height: 0; }
.tds-avatar img {
	display: block;
	box-sizing: border-box;
	border-radius: 50%;
	background: var(--tds-border);
	object-fit: cover;
}
.tds-avatar--lg::before {
	content: "";
	position: absolute;
	inset: -14px;
	border: 1px dashed var(--tds-accent);
	border-radius: 50%;
	opacity: 0.6;
	pointer-events: none;
}
.tds-avatar--lg img { box-shadow: 0 0 60px rgba(255, 90, 78, 0.25); }
.tds-avatar--sm img { border: 1px dashed var(--tds-accent); }

/* ---------- Subscribe band ---------- */

.tds-band {
	position: relative;
	overflow: hidden;
	background: var(--tds-accent);
	color: var(--tds-bg);
	--tds-mark-size: 620px;
}
.tds-band::before {
	content: "";
	position: absolute;
	top: -120px;
	right: -140px;
	width: var(--tds-mark-size);
	height: var(--tds-mark-size);
	background: var(--tds-mark-dark) center / contain no-repeat;
	opacity: 0.14;
	pointer-events: none;
}
.tds-band__inner { position: relative; display: flex; flex-direction: column; gap: 32px; padding-block: 112px; }
.tds-band .is-style-eyebrow { font-size: 14px; font-weight: 700; color: var(--tds-bg); }
.tds-band__title {
	max-width: 1000px;
	font-size: clamp(52px, 8vw, 124px);
	font-weight: 900;
	line-height: 0.92;
	letter-spacing: -0.05em;
	color: var(--tds-bg);
}
.tds-band__text { max-width: 520px; font-size: 20px; font-weight: 500; line-height: 1.5; }
.tds-band :focus-visible { outline-color: var(--tds-bg); }
.tds-band .tds-subscribe:focus-within { box-shadow: 0 0 0 2px var(--tds-bg); }

.tds-band--issue { --tds-mark-size: 520px; }
.tds-band--issue::before { top: -100px; right: -120px; }
.tds-band--issue .tds-band__inner { gap: 28px; padding-block: 96px; }
.tds-band--issue .tds-band__title { max-width: 900px; font-size: clamp(44px, 6.5vw, 96px); line-height: 0.94; }

.tds-band--compact { --tds-mark-size: 420px; }
.tds-band--compact::before { top: -90px; right: -90px; }
.tds-band--compact .tds-band__inner {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	padding-block: 72px;
}
.tds-band--compact .tds-band__title { max-width: 560px; font-size: clamp(36px, 5vw, 64px); line-height: 0.95; letter-spacing: -0.045em; }
.tds-band--compact .tds-subscribe { flex: 0 1 520px; }
.tds-band--compact .tds-subscribe__input { flex-basis: 220px; }
.tds-band--compact .tds-subscribe__button { padding-inline: 24px; }
.tds-band--compact .tds-subscribe__status { flex-basis: 100%; margin: 0; }

/* ---------- Footer ---------- */

.tds-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 36px;
	font-size: 14px;
	color: var(--tds-dim);
}
.tds-footer__brand { display: flex; align-items: center; gap: 10px; }
.tds-footer__mark svg { display: block; width: 20px; height: 20px; color: var(--tds-dim); }
.tds-footer-nav .wp-block-navigation__container { gap: 24px; }
.tds-footer-nav .wp-block-navigation-item__content { color: var(--tds-dim); }
.tds-footer-nav .wp-block-navigation-item__content:hover { color: var(--tds-text); }

/* ---------- Archive ---------- */

.tds-archive-zone::before,
.tds-issue-zone::before {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: var(--tds-accent);
	pointer-events: none;
}
.tds-archive-zone::before { top: -260px; right: -120px; width: 520px; height: 420px; filter: blur(140px); opacity: 0.2; }
/* Ghost word ("/issues", "/404"; the Term Name on topic pages): drawn as a huge outline. */
.tds-archive-zone > .tds-ghost {
	position: absolute;
	right: -30px;
	bottom: -60px;
	font-family: var(--tds-display);
	font-size: 300px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.06em;
	white-space: nowrap;
	color: transparent;
	-webkit-text-stroke: 1px var(--tds-ghost);
	pointer-events: none;
}

.tds-archive-hero {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding-block: 64px 72px;
}
.tds-archive-hero .is-style-eyebrow { font-size: 14px; }
.tds-archive-hero__title {
	font-family: var(--tds-display);
	font-size: clamp(52px, 8vw, 116px);
	font-weight: 800;
	line-height: 0.92;
	letter-spacing: -0.05em;
}
.tds-archive-hero__title .tds-outline { display: block; }

.tds-filterbar {
	border-block: 1px solid var(--tds-border);
	background-color: rgba(11, 13, 16, 0.92) !important;
}
.tds-filterbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 18px;
}

/* Topic pills: an "All issues" link and a Terms Query; the current one is highlighted. */
.tds-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tds-pills__topics { display: contents; }
.tds-pills .wp-block-term-template { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tds-pills :is(p, li) { flex-shrink: 0; margin: 0; }
.tds-pills a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var(--tds-muted);
	white-space: nowrap;
	transition: color 0.15s, border-color 0.15s;
}
.tds-pills a::before {
	content: "";
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--topic-dot, var(--tds-dim));
}
.tds-pills a:hover { border-color: var(--tds-dim); color: var(--tds-text); }
.tds-pills a.is-current,
.tds-pills a.is-current:hover {
	border-color: var(--tds-text);
	background: var(--tds-text);
	box-shadow: 0 0 24px rgba(237, 239, 242, 0.18);
	color: var(--tds-bg);
}

/* Search: the core Search block. */
.tds-search { flex: 0 1 340px; min-width: 220px; margin: 0; }
.tds-search .wp-block-search__inside-wrapper { padding: 0; border: 0; }
.tds-search .wp-block-search__input {
	width: 100%;
	height: 46px;
	box-sizing: border-box;
	padding: 0 16px 0 44px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D8794' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 16px center / 18px no-repeat;
	color: var(--tds-text);
	font-family: var(--tds-mono);
	font-size: 14px;
}
.tds-search .wp-block-search__input:focus { border-color: var(--tds-accent); outline: none; }

.tds-issue-list { padding-block: 40px 112px; }
.tds-issue-list .wp-block-post-template { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.tds-issue-list .wp-block-post { margin: 0; }

.tds-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 36px;
	padding: 28px 32px;
	overflow: hidden;
	border: 1px solid var(--tds-border);
	--tds-radius: 22px;
	background: var(--tds-surface);
	color: var(--tds-text);
	transition: border-color 0.2s;
}
.tds-row:hover { border-color: var(--tds-border-strong); }
.tds-row__num {
	flex: 0 0 auto;
	min-width: 2.1em;
	font-family: var(--tds-display);
	font-size: 56px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--topic);
}
@supports (-webkit-text-stroke: 1px) {
	.tds-row__num { color: transparent; -webkit-text-stroke: 1.5px var(--topic); }
}
.tds-row__body { display: flex; flex: 999 1 420px; flex-direction: column; gap: 8px; min-width: 0; }
.tds-row__title {
	font-family: var(--tds-display);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: -0.02em;
}
.tds-row__title a { transition: color 0.15s; }
.tds-row:hover .tds-row__title a { color: var(--tds-accent); }
.tds-row__excerpt { font-size: 15px; line-height: 1.55; color: var(--tds-muted); }
.tds-row::after {
	content: "→" / "";
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	box-sizing: border-box;
	border: 1px solid var(--tds-border-strong);
	border-radius: 50%;
	font-size: 20px;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.tds-row:hover::after { border-color: var(--tds-accent); background: var(--tds-accent); color: var(--tds-bg); }

.tds-pagination { gap: 12px; margin-top: 0; padding-top: 28px; }
.tds-pagination a {
	display: inline-flex;
	align-items: center;
	height: 52px;
	box-sizing: border-box;
	padding: 0 28px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 14px;
	color: var(--tds-text);
}
.tds-pagination a:hover { border-color: var(--tds-dim); color: var(--tds-text); }
.tds-empty { padding: 40px 0; font-family: var(--tds-mono); color: var(--tds-muted); }

/* ---------- Issue page ---------- */

.tds-issue-zone { border-bottom: 1px solid var(--tds-border); }
.tds-issue-zone::before { top: -300px; left: 50%; width: 640px; height: 420px; margin-left: -320px; filter: blur(140px); opacity: 0.22; }

.tds-issue-hero__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	box-sizing: border-box;
	max-width: calc(960px + 2 * var(--tds-gutter));
	margin-inline: auto;
	padding: 64px var(--tds-gutter) 72px;
	text-align: center;
}
/* Back pill: a Group with a link paragraph, the issue number and the date. */
.tds-back-pill {
	position: relative;
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 10px;
	padding: 8px 14px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 13px;
	line-height: 1.4;
	color: var(--tds-body);
	text-transform: uppercase;
	transition: border-color 0.15s;
}
.tds-back-pill:hover { border-color: var(--tds-dim); }
.tds-back-pill > * + *::before { content: "·" / ""; margin-right: 10px; }
.tds-back-pill > .tds-issue-no::before { content: "·\2003#"; margin-right: 0; }
.tds-back-pill a { color: inherit; }
.tds-back-pill a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tds-issue-hero__title {
	font-family: var(--tds-display);
	font-size: clamp(42px, 6vw, 80px);
	font-weight: 800;
	line-height: 0.98;
	letter-spacing: -0.045em;
	overflow-wrap: break-word;
}
.tds-issue-hero__title em { font-style: normal; color: var(--tds-muted); }
@supports (-webkit-text-stroke: 1px) {
	.tds-issue-hero__title em { color: transparent; -webkit-text-stroke: 2px var(--tds-text); }
}
.tds-issue-hero__dek { max-width: 700px; font-size: 21px; line-height: 1.55; color: var(--tds-muted); }
.tds-issue-hero__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.tds-issue-hero__time { font-family: var(--tds-mono); font-size: 13px; color: var(--tds-dim); }

/* Topic chips: the Post Terms block (categories) styled as "#ai" chips. */
.tds-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tds-chips .wp-block-post-terms__separator { display: none; }
.tds-chips a {
	--topic-dot: var(--tds-dim);
	display: inline-flex;
	align-items: center;
	padding: 8px 14px 8px 30px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 999px;
	background: radial-gradient(circle 4px at 18px 50%, var(--topic-dot) 99%, transparent) no-repeat, var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 13px;
	line-height: 1.4;
	color: var(--tds-body);
	text-transform: lowercase;
}
.tds-chips a::before { content: "#"; }
.tds-chips a:hover { border-color: var(--tds-dim); color: var(--tds-text); }

.tds-byline { display: flex; align-items: center; gap: 14px; padding-top: 8px; text-align: left; }
.tds-byline__text { display: flex; flex-direction: column; gap: 2px; }
.tds-byline__name { font-size: 15px; font-weight: 600; }
.tds-byline__role { font-size: 13px; color: var(--tds-dim); }
.tds-byline__role:empty { display: none; }

/* Reading progress (added by theme.js at the bottom of the issue hero). */
.tds-progress { position: relative; height: 3px; background: var(--tds-border); }
.tds-progress__bar {
	height: 3px;
	background: var(--tds-accent);
	box-shadow: 0 0 16px var(--tds-accent);
	transform: scaleX(0);
	transform-origin: left;
}

.tds-article {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 64px;
	padding-block: 72px 40px;
}
.tds-aside {
	position: sticky;
	top: 24px;
	display: flex;
	flex: 1 1 240px;
	flex-direction: column;
	align-self: flex-start;
	gap: 24px;
	min-width: 0;
	max-width: 280px;
}
.tds-toc-box {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid var(--tds-border);
	border-radius: 20px;
	background: var(--tds-surface);
}
/* No table of contents (fewer than two H2s): hide the empty box. */
.tds-toc-box:not(:has(.tds-toc)) { display: none; }
.editor-styles-wrapper .tds-toc-box:not(:has(.tds-toc)) { display: flex; }
.tds-toc__label { padding-bottom: 10px; font-family: var(--tds-mono); font-size: 12px; color: var(--tds-accent); }
.tds-toc ol { display: flex; flex-direction: column; gap: 4px; padding: 0; list-style: none; }
.tds-toc a {
	display: block;
	padding: 9px 0 9px 14px;
	border-left: 2px solid var(--tds-border);
	font-size: 15px;
	line-height: 1.4;
	color: var(--tds-muted);
	transition: color 0.15s, border-color 0.15s;
}
.tds-toc a:hover { color: var(--tds-text); }
.tds-toc a.is-active { border-left-color: var(--tds-accent); font-weight: 600; color: var(--tds-text); }

/* Share: a Buttons block (LinkedIn, X, Copy link). */
.tds-share { display: flex; flex-wrap: wrap; gap: 10px; }
.tds-share .wp-block-button .wp-block-button__link {
	min-height: 40px;
	padding: 8px 14px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--tds-muted);
}
.tds-share .is-copied .wp-block-button__link { border-color: var(--tds-accent); color: var(--tds-accent); }
.tds-share__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--tds-border-strong);
	border-radius: 12px;
	background: var(--tds-surface);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--tds-muted);
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
}
.tds-share__btn[hidden] { display: none; }
.tds-share__btn:hover { border-color: var(--tds-dim); color: var(--tds-text); }
.tds-share__btn.is-copied { border-color: var(--tds-accent); color: var(--tds-accent); }

.tds-article__body {
	display: flex;
	flex: 999 1 600px;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
	max-width: 720px;
}
.tds-signoff { font-family: var(--tds-mono); font-size: 16px; color: var(--tds-accent); }
.tds-signoff span { color: var(--tds-dim); }

.tds-page-hero { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; padding-block: 64px 48px; }
.tds-page-body { max-width: calc(720px + 2 * var(--tds-gutter)); padding-bottom: 112px; }

/* ---------- Prose (issue and page content) ---------- */

.tds-prose { font-size: 18px; line-height: 1.8; color: var(--tds-body); counter-reset: tds-h2; }
.tds-prose > * { margin-block: 0; }
.tds-prose > * + * { margin-block-start: 24px; }
.tds-prose > :is(h2, h3, h4) { margin-block-start: 48px; }
.tds-prose > :is(h2, h3, h4) + * { margin-block-start: 20px; }

.tds-prose h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; }
.tds-prose h3 { font-size: 26px; }
.tds-prose :is(h2, h3, h4) { color: var(--tds-text); }

/* Issue body: numbered H2s ("02 Where the boundary is") and a lead paragraph. */
.tds-article .tds-prose h2 { display: flex; align-items: baseline; gap: 14px; counter-increment: tds-h2; scroll-margin-top: 24px; }
.tds-article .tds-prose h2::before {
	content: counter(tds-h2, decimal-leading-zero);
	flex-shrink: 0;
	font-family: var(--tds-mono);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0;
	color: var(--tds-accent);
}
.tds-article .tds-prose > p:first-child,
.tds-prose .is-style-lead { font-size: 22px; line-height: 1.6; color: var(--tds-text); }
.tds-article .tds-prose > p:first-child::before {
	content: "[";
	float: left;
	padding: 8px 12px 0 0;
	font-family: var(--tds-display);
	font-size: 84px;
	font-weight: 900;
	line-height: 0.8;
	color: var(--tds-accent);
}

.tds-prose a:where(:not(.wp-element-button)) {
	color: var(--tds-text);
	text-decoration: underline;
	text-decoration-color: var(--tds-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.tds-prose a:where(:not(.wp-element-button)):hover { color: var(--tds-accent); }
.tds-prose strong { color: var(--tds-text); }
.tds-prose :is(ul, ol):not(.is-style-checklist) { padding-left: 1.3em; }
.tds-prose li + li { margin-top: 8px; }
.tds-prose li::marker { color: var(--tds-accent); }
.tds-prose hr { border: 0; border-top: 1px solid var(--tds-border); }
.tds-prose figure { margin-inline: 0; }
.tds-prose img { border-radius: 18px; }
.tds-prose figcaption { margin-top: 10px; font-size: 14px; color: var(--tds-dim); text-align: center; }

.tds-prose :not(pre) > code {
	padding: 0.1em 0.4em;
	border: 1px solid var(--tds-border);
	border-radius: 6px;
	background: var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 0.86em;
	color: var(--tds-text);
}
.tds-prose pre.wp-block-code,
.tds-prose pre {
	overflow-x: auto;
	border: 1px solid var(--tds-border-strong);
	border-radius: 18px;
	background: var(--tds-surface);
	font-family: var(--tds-mono);
	font-size: 14px;
	line-height: 1.8;
	color: var(--tds-muted);
	white-space: pre;
	tab-size: 2;
}
.tds-prose pre code { font: inherit; white-space: inherit; }

.tds-prose blockquote:not(.wp-block-pullquote blockquote) {
	padding-left: 24px;
	border-left: 2px solid var(--tds-accent);
	font-size: 20px;
	color: var(--tds-text);
}
.tds-prose blockquote cite { display: block; margin-top: 10px; font-family: var(--tds-mono); font-size: 13px; font-style: normal; color: var(--tds-dim); }

.tds-prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.tds-prose :is(th, td) { padding: 10px 12px; border: 1px solid var(--tds-border); text-align: left; }
.tds-prose th { color: var(--tds-text); }

/* Code window: a group with a filename paragraph followed by a code block. */
.is-style-code-window {
	overflow: hidden;
	border: 1px solid var(--tds-border-strong);
	border-radius: 18px;
	background: var(--tds-surface);
}
.is-style-code-window > p:first-child {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 30px;
	padding: 12px 18px;
	border-bottom: 1px solid var(--tds-border);
	font-family: var(--tds-mono);
	font-size: 12px;
	line-height: 1.4;
	color: var(--tds-dim);
}
.is-style-code-window > p:first-child::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--tds-accent);
	box-shadow: 17px 0 0 var(--tds-border-strong), 34px 0 0 var(--tds-border-strong);
}
.tds-copy {
	justify-self: end;
	height: 30px;
	padding: 0 12px;
	border: 1px solid var(--tds-border-strong);
	border-radius: 8px;
	background: transparent;
	font-family: var(--tds-mono);
	font-size: 12px;
	color: var(--tds-muted);
	cursor: pointer;
}
.tds-copy:hover,
.tds-copy.is-copied { border-color: var(--tds-accent); color: var(--tds-text); }
.is-style-code-window pre,
.tds-prose .is-style-code-window pre {
	margin: 0;
	padding: 22px;
	border: 0;
	border-radius: 0;
	background: transparent;
}

/* Pull quote. */
.wp-block-pullquote {
	position: relative;
	margin-inline: 0;
	padding: 36px 36px 36px 40px;
	overflow: hidden;
	border: 1px solid var(--tds-featured-border);
	border-radius: 24px;
	background: var(--tds-surface);
	color: var(--tds-text);
	text-align: left;
}
.wp-block-pullquote::before {
	content: "“" / "";
	position: absolute;
	top: -18px;
	left: 18px;
	font-family: var(--tds-display);
	font-size: 140px;
	font-weight: 900;
	line-height: 1;
	color: var(--tds-accent);
	opacity: 0.9;
}
.wp-block-pullquote::after {
	content: "";
	position: absolute;
	top: -80px;
	right: -80px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: var(--tds-accent);
	filter: blur(90px);
	opacity: 0.3;
	pointer-events: none;
}
.wp-block-pullquote blockquote { position: relative; margin: 36px 0 0; padding: 0; border: 0; }
.wp-block-pullquote p,
.tds-prose .wp-block-pullquote p {
	font-family: var(--tds-display);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.025em;
	color: var(--tds-text);
}
.wp-block-pullquote cite { display: block; margin-top: 16px; font-family: var(--tds-mono); font-size: 13px; font-style: normal; color: var(--tds-dim); text-transform: none; }

/* Checklist (core/list, style "Checklist"). */
ul.is-style-checklist { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; }
ul.is-style-checklist > li,
.tds-prose ul.is-style-checklist > li + li {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 16px 18px;
	border: 1px solid var(--tds-border);
	border-radius: 14px;
	background: var(--tds-surface);
	line-height: 1.5;
}
ul.is-style-checklist > li::before {
	content: "";
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 7px;
	background: var(--tds-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0D10' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ---------- Motion ---------- */

/* ---------- Loading ---------- */

/* Loading bar along the top of the window, and the logo mark spins. */
body::before {
	content: "";
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 100000;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--tds-accent) 30%, #ff8a80 50%, var(--tds-accent) 70%, transparent) 0 0 / 40% 100% no-repeat;
	box-shadow: 0 0 12px rgba(255, 90, 78, 0.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}
.is-loading body::before { opacity: 1; animation: tds-loading 1.1s ease-in-out infinite; }
.is-loading .tds-brand__mark svg { animation: tds-spin 1.2s linear infinite; }

/* Issue lists while new results load: skeleton rows shaped like the real ones. */
.tds-archive-zone.is-refreshing .tds-archive-hero { opacity: 0.45; transition: opacity 0.2s; }
.tds-skeleton { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.tds-skeleton__row {
	display: flex;
	align-items: center;
	gap: 16px 36px;
	padding: 28px 32px;
	border: 1px solid var(--tds-border);
	border-radius: 22px;
	background: var(--tds-surface);
}
.tds-skeleton__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-width: 0; }
.tds-skel {
	display: block;
	border-radius: 8px;
	background: linear-gradient(90deg, var(--tds-border) 0%, var(--tds-border-strong) 40%, var(--tds-border) 80%) 0 0 / 300% 100%;
	animation: tds-shimmer 1.4s linear infinite;
}
.tds-skel--num { flex: 0 0 auto; width: 76px; height: 52px; border-radius: 12px; }
.tds-skel--meta { width: 220px; max-width: 60%; height: 12px; }
.tds-skel--title { width: 70%; height: 24px; }
.tds-skel--text { width: 92%; height: 13px; }
.tds-skel--short { width: 55%; }
.tds-skel--arrow { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; }

@keyframes tds-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tds-spin { to { transform: rotate(360deg); } }
@keyframes tds-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes tds-loading { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes tds-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes tds-gulp {
	0%, 100% { transform: scale(1); }
	35% { transform: scale(0.84); }
	70% { transform: scale(1.1); filter: drop-shadow(0 0 24px rgba(255, 90, 78, 0.8)); }
}
@keyframes tds-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}	/* No sliding: a solid bar while loading. */
	body::before { background-size: 100% 100%; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
	.tds-article { gap: 40px; }
	.tds-aside { position: static; flex-basis: 100%; max-width: 720px; }
}

@media (max-width: 781px) {
	:root { --tds-gutter: 20px; }

	.tds-header { padding-block: 16px; }
	.tds-logo { font-size: 18px; }
	.tds-logo a { gap: 8px; }
	.tds-brand { gap: 8px; }
	.tds-brand__mark svg { width: 26px; height: 26px; }
	.tds-logo a::after { margin-left: -8px; }

	/* Home: the orbit becomes a backdrop behind the headline. */
	.tds-hero__inner { position: relative; gap: 22px; padding-block: 36px 40px; }
	.tds-hero__copy { gap: 22px; }
	.tds-hero__visual { position: absolute; top: 10px; right: -150px; width: 340px; opacity: 0.5; pointer-events: none; }
	.tds-orbit .tds-orbit__topics { display: none; }
	.tds-orbit .tds-orbit__logo { inset: 22%; }
	.tds-new-pill { padding: 6px 12px 6px 6px; font-size: 13px; }
	.tds-new-pill .tds-badge { padding: 3px 8px; font-size: 11px; }
	.tds-outline,
	.tds-issue-hero__title em { -webkit-text-stroke-width: 1.5px; }
	.tds-lede { font-size: 17px; line-height: 1.55; }
	.tds-subscribe { flex-direction: column; }
	.tds-subscribe__input,
	.tds-band--compact .tds-subscribe__input { flex-basis: auto; height: 52px; padding-inline: 14px; font-size: 16px; }
	.tds-subscribe__button { height: 52px; }
	.tds-stats { gap: 20px; }
	.tds-stat__value { font-size: 24px; }
	.tds-stat__label { font-size: 13px; }

	.tds-marquee { height: 84px; }
	.tds-marquee__band { top: 22px; right: -10%; left: -10%; padding: 11px 0; transform: rotate(-3deg); }
	.tds-marquee__track { font-size: 14px; }
	.tds-marquee__track > span { padding-right: 18px; }

	/* Home order on phones: latest issues before topics. */
	.tds-section--topics { order: 1; }
	.tds-section--about { order: 2; }

	.tds-section { gap: 14px; padding-block: 32px; }
	.tds-section--topics { gap: 12px; padding-top: 8px; padding-bottom: 40px; }
	.tds-section--about { padding-bottom: 64px; }
	.tds-section-title { font-size: 32px; }
	.tds-section--latest .tds-section-title { margin-bottom: 6px; }
	.tds-section--topics .tds-section-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
	.is-style-eyebrow { font-size: 12px; }

	/* "View all issues" moves below the cards and goes full width. */
	.tds-section--latest .tds-section-head { display: contents; }
	.tds-section--latest .tds-section-head .wp-block-buttons { order: 10; }
	.tds-section--latest .tds-section-head .wp-block-button { flex-grow: 1; }
	.tds-section--latest .tds-section-head .wp-block-button__link { width: 100%; height: 50px; }
	.tds-bento,
	.tds-bento__side { gap: 14px; }
	.tds-reply-card { display: none; }
	.tds-section--latest .tds-card-grid .wp-block-post:nth-child(n + 2) { display: none; }

	.tds-card { gap: 10px; padding: 22px; --tds-radius: 22px; }
	.tds-card__title,
	.tds-card--feature .tds-card__title { font-size: 21px; line-height: 1.2; }
	.tds-section--latest :is(.tds-card__excerpt, .tds-card__foot) { display: none; }
	.tds-card .tds-meta { font-size: 11px; }
	.tds-card--card { min-height: 0; }
	.tds-card--latest { gap: 12px; box-shadow: 0 0 50px rgba(255, 90, 78, 0.12); }
	.tds-card--latest::before { top: -80px; right: -80px; width: 200px; height: 200px; filter: blur(80px); }
	.tds-card--latest .tds-card__top .tds-meta { display: none; }
	.tds-card--latest .tds-badge { padding: 4px 9px; font-size: 11px; }
	.tds-card--latest .tds-card__title { font-size: 26px; line-height: 1.08; letter-spacing: -0.03em; }
	.tds-card__code { margin: 0; padding: 14px; border-radius: 12px; font-size: 12px; line-height: 1.7; }
	.tds-card__cta { font-size: 15px; }

	.tds-topics .wp-block-term-template { gap: 12px; }
	.tds-topics .wp-block-term { flex-basis: 100%; }
	.tds-topic { flex-direction: row; align-items: center; gap: 14px; min-height: 0; padding: 18px; --tds-radius: 18px; }
	.tds-topic__icon { width: 44px; height: 44px; border-radius: 12px; }
	.tds-topic__icon svg { width: 22px; height: 22px; }
	.tds-topic__title { margin: 0; font-size: 19px; }
	.tds-topic :is(.tds-topic__desc, .tds-topic__count) { display: none; }
	.tds-topic::after { top: 50%; right: 10px; bottom: auto; font-size: 64px; transform: translateY(-50%); }

	.tds-about { gap: 28px; padding: 32px 20px; border-radius: 24px; }
	.tds-about > .tds-ghost { top: -14px; font-size: 120px; }
	.tds-avatar--lg img { width: 132px !important; height: 132px !important; }
	.tds-about__bio { font-size: 17px; }

	.tds-band { --tds-mark-size: 300px; }
	.tds-band::before,
	.tds-band--issue::before,
	.tds-band--compact::before { top: -60px; right: -110px; }
	.tds-band__inner,
	.tds-band--issue .tds-band__inner,
	.tds-band--compact .tds-band__inner { gap: 20px; padding-block: 48px; }
	.tds-band__text { font-size: 17px; }
	.tds-band--compact .tds-subscribe { flex-basis: 100%; }

	.tds-archive-zone > .tds-ghost { bottom: -24px; font-size: 140px; }
	.tds-archive-hero { gap: 20px; padding-block: 40px 48px; }
	.tds-filterbar__inner { padding-block: 14px; }
	/* One scrollable row of pills. */
	.tds-pills {
		flex-wrap: nowrap;
		width: auto;
		margin-inline: calc(-1 * var(--tds-gutter));
		padding-inline: var(--tds-gutter);
		overflow-x: auto;
		scrollbar-width: none;
	}
	.tds-pills .wp-block-term-template { flex-wrap: nowrap; }
	.tds-search { flex-basis: 100%; min-width: 0; }
	.tds-issue-list { padding-block: 24px 64px; }
	.tds-row { gap: 12px 20px; padding: 22px; }
	.tds-row__num { min-width: 0; font-size: 40px; }
	.tds-row__body { flex-basis: 100%; }
	.tds-row__title { font-size: 21px; }
	.tds-row::after { display: none; }
	.tds-skeleton__row { flex-wrap: wrap; gap: 12px 20px; padding: 22px; }
	.tds-skeleton__body { flex-basis: 100%; }
	.tds-skel--num { width: 56px; height: 40px; }
	.tds-skel--arrow { display: none; }

	.tds-issue-hero__inner { gap: 22px; padding-block: 40px 48px; }
	.tds-issue-hero__dek { font-size: 18px; }
	.tds-article { padding-block: 40px 24px; }
	.tds-prose { font-size: 17px; }
	.tds-article .tds-prose > p:first-child { font-size: 19px; }
	.tds-article .tds-prose > p:first-child::before { font-size: 64px; }
	.tds-prose h2 { font-size: 28px; }
	.wp-block-pullquote { padding: 28px 24px 28px 28px; }
	.wp-block-pullquote p,
	.tds-prose .wp-block-pullquote p { font-size: 24px; }
	.tds-section--related { padding-bottom: 64px; }
	.tds-section--related .tds-section-head .wp-block-buttons { display: none; }
	.tds-page-body { padding-bottom: 64px; }
}

/* ---------- Editor ---------- */

/* Home sections keep their real width instead of the 720px text column. */
.block-editor-block-list__layout.is-root-container > :is(.tds-hero, .tds-marquee) { max-width: none; }
.block-editor-block-list__layout.is-root-container > .tds-container { max-width: calc(var(--tds-wide) + 2 * var(--tds-gutter)); }
/* The editor adds a 24px flow gap that the front end doesn't (blockGap is off). */
.editor-styles-wrapper :is([class*="tds-"]:not(.tds-prose), [class*="is-style-"], .wp-block-post) > * { margin-block-start: 0; }
.editor-styles-wrapper .tds-topic > .tds-topic__title { margin-block-start: auto; }
/* Bound paragraphs show their source label while editing. */
.editor-styles-wrapper .tds-card__code:empty { display: block; }
/* Ghost words and numbers are plain paragraphs: let them be clicked in the editor. */
.editor-styles-wrapper .tds-ghost { pointer-events: auto; }
