/*
 * Antonio Trotta 2026, "Lines": what theme.json cannot express.
 * Tokens come from theme.json (--wp--preset--*, --wp--custom--*). No colour,
 * size or font is written here as a raw value unless it is a 1px line or
 * a geometry value from design/directions/lines-home/index.html.
 *
 * Breakpoints: 900px (two columns become one), 600px (phone type sizes),
 * 440px (header shows the mark alone).
 */

/* ── Base ─────────────────────────────────────────────────────────── */

html {
	background: var(--wp--preset--color--ground);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--ground);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 4px;
}

/* Figma embeds take keyboard focus. Browsers never match :focus-visible on an
   iframe, so it uses :focus. */
iframe:focus {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 4px;
}

img {
	height: auto;
	max-width: 100%;
}

a {
	text-underline-offset: 5px;
	text-decoration-thickness: 1px;
}

/* Gloock has no italic or bold: never let the browser fake one. */
:where(h1, h2, h3, h4, h5, h6),
.has-display-xl-font-size,
.has-display-l-font-size,
.has-display-m-font-size,
.has-title-font-size,
.has-figure-font-size {
	font-synthesis: none;
}

:where(h1, h2, h3, h4, h5, h6) :where(em, i, strong, b) {
	font-style: normal;
	font-weight: inherit;
}

/* No single word left alone on the last line. */
:where(h1, h2, h3, h4, h5, h6) {
	text-wrap: balance;
}

:where(p, li, figcaption) {
	text-wrap: pretty;
}

/* WordPress's skip link, made visible on focus. */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--ground);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	text-decoration: none;
}

/* ── Type scale ───────────────────────────────────────────────────── */
/* theme.json sets the sizes; these add the family, line height and tracking
   that belong to each size (requirements 4.2). */

.has-display-xl-font-size,
.has-display-l-font-size,
.has-display-m-font-size,
.has-title-font-size,
.has-figure-font-size {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
}

.has-display-xl-font-size { line-height: 1.02; letter-spacing: -0.02em; }
.has-display-l-font-size  { line-height: 1.04; letter-spacing: -0.02em; }
.has-display-m-font-size  { line-height: 1.1;  letter-spacing: -0.015em; }
.has-title-font-size      { line-height: 1.2;  letter-spacing: -0.01em; }

.has-figure-font-size {
	line-height: 1;
	letter-spacing: -0.01em;
	font-variant-numeric: lining-nums tabular-nums;
}

.has-standfirst-font-size { font-weight: 300; line-height: 1.45; }
.has-lead-font-size       { line-height: 1.45; }
.has-body-s-font-size     { line-height: 1.55; }
.has-label-font-size      { font-weight: 500; line-height: 1.3; }
.has-caption-font-size    { line-height: 1.5; }

@media (max-width: 600px) {
	:root {
		--wp--preset--font-size--figure: 40px;
		--wp--preset--font-size--lead: 18px;
	}
}

/* ── Captions ─────────────────────────────────────────────────────── */
/* Always under the image and left aligned (requirements 8.3). */

.wp-element-caption {
	text-align: left;
}

/* ── Rules ────────────────────────────────────────────────────────── */

.wp-block-separator {
	border: 0;
	height: 1px;
	opacity: 1;
}

/* ── Logotype (patterns/logotype.php) ────────────────────────────── */

.logotype {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px; /* Tap target (requirements 10). */
	padding: 8px 0;
	color: var(--wp--preset--color--text);
	text-decoration: none;
	white-space: nowrap;
}

.logotype:hover {
	color: var(--wp--preset--color--text);
}

.logotype__mark {
	display: block;
	height: 26px;
	width: auto;
}

.logotype__square { fill: var(--wp--preset--color--text); }
.logotype__slate  { fill: var(--wp--preset--color--mark-slate); }

.logotype__words {
	font-family: var(--wp--preset--font-family--display);
	font-size: 23px;
	line-height: 1;
	letter-spacing: -0.01em;
	font-synthesis: none;
}

.logotype__surname {
	color: var(--wp--preset--color--orange);
}

/* ── Header (parts/header.html) ──────────────────────────────────── */

.site-header__bar {
	--header-bar: 96px;
	min-height: var(--header-bar);
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

/* On the front page the header sits over the hero. */
.site-header--overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
}

.site-nav .wp-block-navigation__container {
	gap: clamp(16px, 2.5vw, 36px);
}

.site-nav .wp-block-navigation-item__content {
	position: relative;
	display: inline-block;
	padding: 14px 0;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.3;
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

/* Current page and hover: a 2px orange line that grows from the left. */
.site-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	height: 2px;
	background: var(--wp--preset--color--orange);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 300ms var(--wp--custom--ease);
}

.site-nav .wp-block-navigation-item__content:hover::after,
.site-nav .wp-block-navigation-item__content[aria-current]::after {
	transform: scaleX(1);
}

/* Under 720px the links fold into a full-screen menu behind a menu button.
   Core folds them at 600px, but the six links and the name need about 650px. */
@media (max-width: 719px) {
	.site-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.site-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Menu and close buttons: 44px targets whose icons line up with the gutter.
   The close button sits where the menu button was. */
.site-nav .wp-block-navigation__responsive-container-open,
.site-nav .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
}

.site-nav .wp-block-navigation__responsive-container-close {
	display: flex;
	top: calc((var(--header-bar) - 44px) / 2);
}

/* The open menu: one link per line between rules, in the display face. */
.site-nav .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
	--navigation-layout-justification-setting: stretch;
	padding: 0 var(--wp--custom--gutter) var(--wp--preset--spacing--40);
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
	padding-top: var(--header-bar);
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__container {
	--navigation-layout-justification-setting: stretch; /* The list carries the nav's right alignment too. */
	gap: 0;
	border-top: 1px solid var(--wp--preset--color--rule);
	animation: site-nav-in 400ms var(--wp--custom--ease) both;
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation-item {
	--navigation-layout-justification-setting: flex-start; /* The orange line spans the word, not the row. */
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation-item__content {
	padding: 16px 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--display-m);
	line-height: 1.1;
}

@keyframes site-nav-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* ── Footer (patterns/contact-band.php) ──────────────────────────── */

.site-footer__top {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--40);
}

.site-footer__linkedin a {
	display: inline-block;
	padding: 8px 0;
}

.site-footer__nav .wp-block-navigation-item__content {
	display: inline-block;
	padding: 10px 0;
	font-size: var(--wp--preset--font-size--body-s);
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.site-footer__nav .wp-block-navigation-item__content:hover {
	text-decoration: underline;
}

.site-footer__nav .wp-block-navigation__container {
	gap: 0;
}

.site-footer__bottom {
	align-items: center;
	margin-top: var(--wp--preset--spacing--section);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--rule);
}

.site-footer__bottom p {
	margin: 0;
}

/* Copyright and the analytics note, right-aligned under each other. */
.site-footer__legal {
	text-align: right;
}

.site-footer__legal p + p {
	margin-top: 4px;
}

@media (max-width: 600px) {
	.site-header__bar {
		--header-bar: 76px;
	}

	.logotype {
		gap: 8px;
	}

	.logotype__mark {
		height: 20px;
	}

	.logotype__words {
		font-size: 19px;
	}

	.site-footer__nav .wp-block-navigation__container {
		align-items: flex-start;
	}

	.site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--20);
	}

	.site-footer__legal {
		text-align: left;
	}
}

/* Narrow phones: the header shows the mark alone; the name is in the hero. */
@media (max-width: 440px) {
	.site-header .logotype__words {
		display: none;
	}

	.site-header .logotype__mark {
		height: 24px;
	}
}

/* ── Section heading and motif (patterns/section-heading*.php) ───── */

.section-heading__row {
	gap: var(--wp--preset--spacing--30);
}

.section-heading__row > * {
	margin: 0;
}

.section-heading__link a {
	display: inline-block;
	padding: 10px 0;
	font-size: var(--wp--preset--font-size--body-s);
	text-decoration: none;
}

.section-heading__link a:hover {
	text-decoration: underline;
}

/* The separator rendered as the motif by functions.php. */
.wp-block-separator.motif {
	display: block;
	width: 100%;
	height: 28px;
	margin-top: 18px;
	background: none;
	border: 0;
}

.motif svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.motif path {
	fill: none;
	vector-effect: non-scaling-stroke;
}

.motif__wave {
	stroke: var(--wp--preset--color--muted);
	stroke-width: 1;
	opacity: 0.55;
}

.motif__settle {
	stroke-width: 3;
}

.motif--orange .motif__settle { stroke: var(--wp--preset--color--orange); }
.motif--yellow .motif__settle { stroke: var(--wp--preset--color--yellow); }
.motif--blue .motif__settle   { stroke: var(--wp--preset--color--blue); }

.motif__rule {
	stroke: var(--wp--preset--color--rule);
	stroke-width: 1;
}

/* ── Entrances (assets/js/motif.js) ──────────────────────────────── */
/* Hidden starting states apply only under .js-anim, which the head script adds
   when motion is allowed and removes if motif.js never runs. */

.js-anim .motif .motif__wave,
.js-anim .motif .motif__settle {
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	transition: stroke-dashoffset 1.1s var(--wp--custom--ease);
}

.js-anim .motif.is-in .motif__wave,
.js-anim .motif.is-in .motif__settle {
	stroke-dashoffset: 0;
}

.js-anim .rise {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 700ms var(--wp--custom--ease), transform 700ms var(--wp--custom--ease);
}

.js-anim .rise.is-in {
	opacity: 1;
	transform: none;
}

/* ── Page frame ──────────────────────────────────────────────────── */

/* Header, main and footer meet without a gap; sections set their own padding.
   Relative, so the front page header can sit over the hero. */
.wp-site-blocks {
	position: relative;
}

.wp-site-blocks > * {
	margin-block: 0;
}

/* ── Hero (at/hero-lines) ────────────────────────────────────────── */

.hero-lines {
	position: relative;
	height: 100vh;
	min-height: 680px;
	max-height: 1000px;
	overflow: hidden;
	margin: 0;
}

.hero-lines__still,
.hero-lines__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.hero-lines.is-running .hero-lines__still {
	display: none;
}

/* Labels sit 30px right of where the lines settle (73.6% of the width). Without
   the script they use the same proportions as the still image. */
.hero-lines__labels {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(73.6% + 30px);
}

.hero-lines__label {
	position: absolute;
	top: 29%;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(22px, 2.1vw, 30px);
	line-height: 1;
	letter-spacing: -0.01em;
	white-space: nowrap;
	transform: translateY(-130%);
	transition: opacity 900ms var(--wp--custom--ease), transform 900ms var(--wp--custom--ease);
}

.hero-lines__label--2 { top: calc(29% + min(10%, 92px)); }
.hero-lines__label--3 { top: calc(29% + 2 * min(10%, 92px)); }

/* The words arrive one at a time, half a second apart. */
@media (prefers-reduced-motion: no-preference) {
	.hero-lines__label--2 { transition-delay: 500ms; }
	.hero-lines__label--3 { transition-delay: 1000ms; }
}

.hero-lines.is-running .hero-lines__label:not(.is-on) {
	opacity: 0;
	transform: translateY(-140%);
	transition: none; /* Hidden at once when the script starts; only the fade-in is staggered. */
}

.hero-lines__intro {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(40px, 7vh, 72px);
	max-width: var(--wp--custom--page);
	margin: 0 auto;
	padding: 0 var(--wp--custom--gutter);
}

.hero-lines__intro > * {
	margin: 0;
}

.hero-lines__intro p {
	margin-top: 20px;
	max-width: 640px;
	color: var(--wp--preset--color--text-2);
}

/* In the editor the hero is a plain block with its labels. */
.hero-lines.is-editor {
	height: auto;
	min-height: 0;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--step);
}

.hero-lines.is-editor .hero-lines__labels,
.hero-lines.is-editor .hero-lines__intro {
	position: static;
	display: flex;
	gap: var(--wp--preset--spacing--30);
	padding: 0;
}

.hero-lines.is-editor .hero-lines__intro {
	display: block;
}

.hero-lines.is-editor .hero-lines__label {
	position: static;
	transform: none;
}

/* ── Home sections ───────────────────────────────────────────────── */

.home-section {
	padding-block: var(--wp--preset--spacing--section);
}

.home-intro {
	padding-block: var(--wp--preset--spacing--section) calc(var(--wp--preset--spacing--section) * 0.5);
}

.cols-2,
.cols-3 {
	display: grid;
	gap: clamp(32px, 6vw, 96px);
}

.cols-2 { grid-template-columns: 1fr 1fr; }

.cols-3 {
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(24px, 3vw, 40px);
	margin-top: var(--wp--preset--spacing--40);
}

.cols-2 > *,
.cols-3 > * {
	margin: 0;
}

.cols-3 h3 {
	margin: 0;
}

.cols-3 p {
	margin-top: 12px;
}

.section-heading__note {
	max-width: 320px;
	margin: 0;
}

/* ── Work cards (at/cs-card in a Query Loop) ─────────────────────── */

.work-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(48px, 5vw, 72px) clamp(24px, 3vw, 48px);
	margin-top: 56px;
	padding: 0;
	list-style: none;
}

.work-grid > li {
	margin: 0;
}

.work-card {
	display: block;
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.work-card:hover {
	color: var(--wp--preset--color--text);
}

.work-card__shot {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--wp--custom--radius);
	isolation: isolate; /* Keeps the rounded clip while the image scales on hover (Safari). */
	background: var(--wp--preset--color--step);
}

.work-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top left;
	filter: brightness(0.92);
	transition: filter 400ms var(--wp--custom--ease), transform 600ms var(--wp--custom--ease);
}

.work-card:hover .work-card__image {
	filter: brightness(1);
	transform: scale(1.015);
}

/* Card video (cs-card block): covers the card image and plays once when it comes
   into view (motif.js). Without motion the image shows on its own. The image is
   hidden with opacity, not visibility, so its alt text stays available. */
.work-card__video {
	display: none;
}

.js-anim .work-card__video {
	display: block;
	position: absolute;
	inset: 0;
}

.js-anim .work-card__shot--video img.work-card__image {
	opacity: 0;
}

.work-card__meta,
.work-card__tags {
	margin: 20px 0 0;
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.work-card__tags {
	margin-top: 12px;
}

/* With no result line between them, the tags sit as far below the title's rule
   as the title sits above it. */
.work-card__title + .work-card__tags {
	margin-top: 18px;
}

.work-card__title {
	margin: 10px 0 0;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	/* The same at level 2 (Work) as at level 3 (Home). */
	font-size: var(--wp--preset--font-size--title);
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

.work-card:hover .work-card__title {
	text-decoration: underline;
}

.work-card__result {
	display: flex;
	gap: 18px;
	align-items: baseline;
	margin-top: 18px;
}

.work-card__figure,
.result-item__figure {
	flex: none;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--figure);
	line-height: 1;
	letter-spacing: -0.01em;
	font-variant-numeric: lining-nums tabular-nums;
	font-synthesis: none;
}

.work-card__text {
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

/* Lab card (patterns/home-lab-card.php): spans both columns after the case
   studies, the image in the left column and the text in the right. Stacks like
   the other cards under 900px. */
.work-card--wide {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: clamp(24px, 3vw, 48px);
	align-items: start;
	margin-top: clamp(48px, 5vw, 72px);
}

.work-card__body > * {
	margin: 0;
}

.work-card__body > .work-card__title {
	margin-top: 10px;
}

.work-card__body > .work-card__text {
	display: block;
	max-width: 34em;
	margin-top: 18px;
}

.work-card__body > .work-card__tags {
	margin-top: 18px;
}

/* ── Results (at/result in .results-grid) ────────────────────────── */

.results-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(24px, 3vw, 48px);
	margin-top: 56px;
}

.results-grid > * {
	margin: 0;
}

.result-item::before {
	content: "";
	display: block;
	width: 40px;
	height: 3px;
	margin-bottom: 24px;
}

.result-item--orange::before { background: var(--wp--preset--color--orange); }
.result-item--blue::before   { background: var(--wp--preset--color--blue); }

.result-item__figure {
	margin: 0 0 16px;
}

.result-item__text {
	margin: 0;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

/* ── What I bring ────────────────────────────────────────────────── */

.is-style-line-direction-bottom .bring {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: clamp(32px, 5vw, 80px);
	align-items: start;
}

.bring > *,
.bring__body > * {
	margin: 0;
}

.bring__photo img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: var(--wp--custom--radius);
}

.bring__body .section-heading__link {
	margin-top: 36px;
}

/* ── Page title (patterns/work-header.php) ────────────────────────── */

.page-title {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--50);
}

.page-title__row {
	display: grid;
	grid-template-columns: 1fr minmax(0, 600px);
	gap: var(--wp--preset--spacing--40);
	align-items: end;
	/* As tall as the Work intro (two standfirst lines, 12px, one body-s line),
	   so every page title sits at the same height whatever is beside it. */
	min-height: calc(2 * 1.45 * var(--wp--preset--font-size--standfirst) + 12px + 1.55 * var(--wp--preset--font-size--body-s));
}

.page-title__row > *,
.page-title__intro > * {
	margin: 0;
}

.page-title__intro p + p {
	margin-top: 12px;
}

/* ── Work filter (patterns/work-filter.php, assets/js/work-filter.js) */

/* Without JavaScript the bar is gone, so there are no dead controls. While the
   script loads it keeps its space, so the cards below do not jump when it shows. */
html:not(.js) .work-filter-band {
	display: none;
}

.work-filter-band:not(.is-ready) {
	visibility: hidden;
}

.work-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
}

.work-filter__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.work-filter__label,
.work-filter__count {
	margin: 0;
	font-size: var(--wp--preset--font-size--body-s);
	color: var(--wp--preset--color--muted);
}

/* One line high before the script writes the count. */
.work-filter__count {
	min-height: 1lh;
}

.work-filter__label {
	margin-right: 8px;
}

.work-filter__chip {
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 999px;
	background: transparent;
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--body-s);
	cursor: pointer;
	transition: border-color 300ms var(--wp--custom--ease), background-color 300ms var(--wp--custom--ease);
}

.work-filter__chip:hover {
	border-color: var(--wp--preset--color--blue);
}

.work-filter__chip[aria-pressed="true"] {
	background: var(--wp--preset--color--text);
	border-color: var(--wp--preset--color--text);
	color: var(--wp--preset--color--ground);
}

.work-grid--page {
	margin-top: 0;
}

.work-grid > li[hidden] {
	display: none;
}

/* ── Case study (templates/single-case_study.html) ───────────────── */

.cs-back {
	padding-top: var(--wp--preset--spacing--40);
}

.cs-back p {
	margin: 0;
}

.cs-back a {
	display: inline-block;
	padding: 12px 0;
	text-decoration: none;
}

.cs-content {
	padding-bottom: var(--wp--preset--spacing--60);
}

/* Section headings inside a case study or post use the title size, as in the
   Figma case study frame; display-m is for page-level sections. */
.single .cs-content h2 {
	font-size: var(--wp--preset--font-size--title);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* A heading sits closer to its own text than to the block above it. Posts keep
   their text in one article-body group. Case study headings that open a section
   group already get the 96px gap between groups (compat.css). */
:is(.cs-content, .cs-content > .article-body) > h2:not(:first-child) {
	margin-block-start: var(--wp--preset--spacing--50);
}

:is(.cs-content, .cs-content > .article-body) > h3:not(:first-child) {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* Header block (at/cs-header, render-lines.php): 880px, left aligned. */
.is-layout-constrained > .cs-head {
	max-width: 880px;
}

.cs-head {
	padding-top: var(--wp--preset--spacing--50);
}

.cs-head__title {
	margin: 0;
}

.cs-head__standfirst {
	max-width: 760px;
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: var(--wp--preset--font-size--standfirst);
	font-weight: 300;
	line-height: 1.45;
	color: var(--wp--preset--color--text-2);
}

.cs-head .motif {
	margin-top: var(--wp--preset--spacing--30);
}

.cs-head__facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	margin: var(--wp--preset--spacing--30) 0 0;
}

.cs-head__facts--wide {
	grid-template-columns: minmax(0, 640px);
}

.cs-head__facts dt {
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
}

.cs-head__facts dd {
	margin: 4px 0 0;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

/* Outcomes (at/outcomes-grid, render-lines.php): a full-width results band
   with the figures in the reading column. */
.outcomes-band {
	padding-block: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--step);
	border-top: 3px solid var(--wp--preset--color--orange);
	border-bottom: 3px solid var(--wp--preset--color--orange);
}

.outcomes-band__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: var(--wp--preset--spacing--40);
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding-inline: var(--wp--custom--gutter);
	box-sizing: content-box;
}

.outcomes-band .result-item > * {
	margin-top: 0;
}

/* Pull quote (at/pull-quote, render-lines.php). Set in the body face at
   standfirst size under a thin rule, so the section headings stay the only
   large serif text in the body and the quote never reads as one. */
.pull-quote-lines {
	margin-block: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--rule);
}

.pull-quote-lines blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

.pull-quote-lines blockquote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--standfirst);
	font-weight: 300;
	line-height: 1.45;
	color: var(--wp--preset--color--text-2);
}

.pull-quote-lines figcaption {
	margin-top: 12px;
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
}

/* Next case study band (at/next-article, render-lines.php). */
.next-cs-band {
	padding-block: var(--wp--preset--spacing--section);
	background: var(--wp--preset--color--step);
	border-top: 3px solid var(--wp--preset--color--yellow);
	/* No bottom line: the contact band's blue line follows straight after. */
}

.next-cs-band__inner {
	max-width: 880px;
	margin: 0 auto;
	padding-inline: var(--wp--custom--gutter);
	box-sizing: content-box;
}

.next-cs-band__inner > * {
	margin: 0;
}

.next-cs-band__meta {
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
}

.next-cs-band__title {
	margin-top: 12px;
	font-size: var(--wp--preset--font-size--display-m);
}

.next-cs-band__title a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.next-cs-band__title a:hover {
	text-decoration: underline;
	text-underline-offset: 8px;
}

.next-cs-band__meta {
	margin-top: 12px;
}

.next-cs-band__text {
	margin-top: 20px;
	max-width: 640px;
	color: var(--wp--preset--color--text-2);
}

.next-cs-band__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	align-items: center;
	margin-top: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--body-s);
}

.next-cs-band__links a {
	display: inline-block;
	padding: 12px 0;
	text-decoration: none;
}

.next-cs-band__links a:hover {
	text-decoration: underline;
}

/* Public summary of a protected case study (class cs-summary, shown above the
   password form too). Space between the decisions so each can be scanned. */
.cs-summary li + li {
	margin-top: var(--wp--preset--spacing--20);
}

/* Password page (at_password_form_lines in the plugin). */
.cs-lock {
	margin-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
}

.cs-lock > * {
	margin: 0;
}

.cs-lock__form {
	margin-top: var(--wp--preset--spacing--30);
}

.cs-lock__label {
	display: block;
	margin-bottom: 8px;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
}

.cs-lock__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cs-lock__input {
	flex: 1 1 240px;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 0;
	background: var(--wp--preset--color--step);
	color: var(--wp--preset--color--text);
	font: inherit;
}

.cs-lock__input[aria-invalid="true"] {
	border-color: var(--wp--preset--color--orange);
}

.cs-lock__error {
	margin-top: 8px;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--body-s);
}

.cs-lock__help {
	margin-top: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--body-s);
	color: var(--wp--preset--color--text-2);
}

/* ── Lists, pages and posts (page-writing, archive, search, page, single) */

.list-section {
	padding-bottom: var(--wp--preset--spacing--section);
}

.list-section .post-rows {
	margin-top: 0;
}

.post-pagination {
	margin-top: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--body-s);
}

.post-pagination a {
	display: inline-block;
	padding: 12px 0;
}

.page-title > .wp-block-post-title,
.page-title > .wp-block-heading,
.page-title > .wp-block-query-title {
	margin: 0;
}

.page-content {
	padding-bottom: var(--wp--preset--spacing--section);
}

.post-head {
	padding-top: var(--wp--preset--spacing--50);
}

.post-head > * {
	margin-top: 0;
}

.post-head__meta {
	gap: var(--wp--preset--spacing--20);
	margin-top: var(--wp--preset--spacing--30);
}

.post-head__meta > * {
	margin: 0;
}

.post-head__meta a {
	color: inherit;
}

.post-image {
	margin-top: var(--wp--preset--spacing--50);
}

.post-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius);
}

/* Images and Figma embeds in case studies and posts: the 4px corner of the
   Figma design (cards and portrait, frames 42:1525 and 44:1750). */
.cs-content :is(.wp-block-image img, iframe) {
	border-radius: var(--wp--custom--radius);
}

.single-post .cs-content {
	padding-top: var(--wp--preset--spacing--50);
}

/* ── Post rows (writing list) ────────────────────────────────────── */

.post-rows {
	margin-top: 40px;
	padding: 0;
	list-style: none;
}

.post-row {
	display: grid;
	grid-template-columns: 160px 1fr auto;
	gap: var(--wp--preset--spacing--30);
	align-items: baseline;
	padding: 28px 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.post-row > * {
	margin: 0;
}

.post-row .wp-block-post-title a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.post-row .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 6px;
}

.post-row .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

/* ── Lab page (templates/page-lab.html, patterns/lab-algomaster.php) ── */

.lab-project {
	align-items: start;
}

.lab-project__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius);
}

.lab-project__body > * {
	margin: 0;
}

.lab-project__body > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.lab-project__body > .lab-project__meta {
	margin-top: 8px;
}

.lab-project__body > .lab-project__series {
	margin-top: var(--wp--preset--spacing--50);
}

.lab-project__body .post-rows {
	margin-top: 0;
	border-top: 1px solid var(--wp--preset--color--rule);
}

.lab-project__body .post-row {
	grid-template-columns: 140px 1fr;
	padding: 20px 0;
}

@media (max-width: 900px) {
	.cols-2,
	.cols-3,
	.work-grid,
	.work-card--wide,
	.page-title__row,
	.is-style-line-direction-bottom .bring {
		grid-template-columns: 1fr;
	}

	.work-card__body > .work-card__meta {
		margin-top: 20px;
	}

	.page-title__row {
		align-items: start;
		min-height: 0;
	}

	.results-grid {
		grid-template-columns: 1fr 1fr;
		row-gap: 48px;
	}

	.bring__photo {
		max-width: 280px;
	}
}

@media (max-width: 600px) {
	.hero-lines__labels {
		left: auto;
		right: var(--wp--custom--gutter);
	}

	.hero-lines__label {
		right: 0;
	}

	.results-grid {
		grid-template-columns: 1fr;
	}

	.post-row,
	.lab-project__body .post-row {
		grid-template-columns: 1fr;
		gap: 6px;
	}
}

/* ── Padlock after password-protected titles ─────────────────────── */
/* Printed by at-publication-blocks (at_lock_icon) on core Post Title blocks. */

.at-lock {
	display: inline-block;
	width: 0.42em;
	height: 0.42em;
	margin-left: 0.28em;
	vertical-align: 0.06em;
	color: var(--wp--preset--color--muted);
}

/* On the cards and the next case study band it comes before the title. */
.work-card__title .at-lock,
.next-cs-band__title .at-lock {
	margin: 0 0.3em 0 0;
}

/* Larger on the smaller card titles, where it is the only password signal. */
.work-card__title .at-lock {
	width: 0.56em;
	height: 0.56em;
	vertical-align: 0;
}

.at-lock svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ── Reading progress and back to top (assets/js/read-progress.js) ── */
/* Case studies and posts. The line is Saffron, the Direction colour of the
   Home hero (Antonio, 21 October 2026). Both sit under the lightbox. */

.read-progress {
	position: fixed;
	inset: 0 0 auto;
	z-index: 50;
	height: 3px;
	pointer-events: none;
}

.read-progress__bar {
	display: block;
	height: 100%;
	background: var(--wp--preset--color--yellow);
	transform: scaleX(var(--read-progress, 0));
	transform-origin: 0 50%;
}

/* No fill, so it never covers the content. The soft dark edge keeps the ring
   and arrow visible over a light image. 44px is the smallest comfortable tap. */
.to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 50;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--wp--preset--color--text);
	cursor: pointer;
	filter: drop-shadow(0 0 2px rgb(16 27 45 / 0.9));
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}

.to-top.is-shown {
	opacity: 1;
	visibility: visible;
}

.to-top:focus-visible {
	outline: 2px solid var(--wp--preset--color--yellow);
	outline-offset: 2px;
}

.to-top svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.to-top__track {
	stroke: var(--wp--preset--color--muted);
	opacity: 0.4;
}

/* pathLength 100 on the circle, so the dash lengths read as percentages. */
.to-top__ring {
	stroke: var(--wp--preset--color--yellow);
	stroke-dasharray: 100px;
	stroke-dashoffset: calc(100px - 100px * var(--read-progress, 0));
	transform: rotate(-90deg);
	transform-box: fill-box;
	transform-origin: center;
}

.to-top__arrow {
	stroke: currentColor;
}

.to-top:hover .to-top__arrow {
	stroke: var(--wp--preset--color--yellow);
}

@media (max-width: 600px) {
	.to-top {
		right: 16px;
		bottom: 16px;
	}
}

/* ── Motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important; /* Overrides any block or plugin animation. */
		transition-duration: 0.01ms !important; /* As above. */
	}
}
