/*
Theme Name: Dipilon Swatchbook
Theme URI: https://dipilon.com/
Author: Dipilon
Description: The cloth-bound sample book of Dipilon: pinked swatches stapled to white cards on a grey board.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.2
License: GPL-2.0-or-later
Text Domain: dipilon-swatchbook
*/

/* Fonts, shipped with the theme (SIL Open Font License) */
@font-face {
	font-family: "Instrument Serif";
	src: url("assets/fonts/instrument-serif-regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Instrument Serif";
	src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Albert Sans";
	src: url("assets/fonts/albert-sans-variable.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Albert Sans";
	src: url("assets/fonts/albert-sans-italic-variable.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}

:root {
	/* bookcloth and board */
	--blush: #f4b6c6;
	--blush-grain: #e39cb0;
	--board: #d0d4d4;
	--board-shade: #c2c7c7;
	--card: #ffffff;
	--quiet-card: #e9ebeb;
	/* ink */
	--ink: #2a2326;
	--muted: #574e52;
	--link: #34507f;
	--rule: #ddd6d9;
	--staple-steel: #a9adb3;
	/* swatch tints */
	--sage: #b9c4a8;
	--denim: #6f84a6;
	--oat: #d9cdb8;
	--oat-pale: #ece4d6;
	--charcoal: #3b3a3c;

	--serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
	--sans: "Albert Sans", "Helvetica Neue", Arial, sans-serif;

	--step-0: 1.125rem;   /* 18 body */
	--step-s: 0.9375rem;  /* 15 fibre lines */
	--step-xs: 0.875rem;  /* 14 tags */
	--step-1: 1.375rem;   /* 22 */
	--step-2: 1.75rem;    /* 28 */
	--step-3: 2.25rem;    /* 36 */
	--step-4: 3rem;       /* 48 */
	--step-5: 4rem;       /* 64 */

	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.25rem;
	--space-5: 3.5rem;
	--space-6: 5rem;

	--measure: 33em;
	--page: 75rem;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--board);
	color: var(--ink);
	font-family: var(--sans);
	font-size: var(--step-0);
	line-height: 1.65;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 3px;
	border-radius: 1px;
}

.skip-link {
	position: absolute;
	left: var(--space-2);
	top: -4rem;
	z-index: 50;
	background: var(--card);
	color: var(--ink);
	padding: 0.6rem 1rem;
	font-weight: 600;
}
.skip-link:focus { top: var(--space-2); }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.wrap {
	width: min(var(--page), 100% - 2.5rem);
	margin-inline: auto;
}

/* ---------- The bookcloth (header and footer bands) ---------- */

.bookcloth {
	background-color: var(--blush);
	background-image:
		repeating-linear-gradient(0deg, rgba(150, 52, 84, 0.07) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 4px);
}

.cover-band {
	position: relative;
	z-index: 2;
}
.cover-band::after {
	content: "";
	position: absolute;
	left: 0; right: 0;
	bottom: -6px;
	height: 6px;
	background: url("assets/cloth/teeth-down.svg") left top / 10px 6px repeat-x;
}

.cover-band__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding-block: 1.1rem 1rem;
}

.wordmark { display: inline-flex; line-height: 0; border-radius: 2px; }
.wordmark img { height: 46px; width: auto; }

.shelf-menu ul {
	display: flex;
	gap: clamp(1.25rem, 3vw, 2.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}
.shelf-menu a {
	position: relative;
	display: inline-block;
	padding: 0.6rem 0.1rem 0.35rem;
	color: var(--ink);
	font-weight: 500;
	font-size: 1.0625rem;
	text-decoration: none;
}
.shelf-menu a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.shelf-menu .current-menu-item > a::before,
.shelf-menu .current-menu-parent > a::before,
.shelf-menu .current-post-ancestor > a::before,
.shelf-menu .current-category-ancestor > a::before,
.shelf-menu a[aria-current]::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	width: 24px;
	height: 7px;
	transform: translateX(-50%);
	background: url("assets/cloth/staple.svg") center / contain no-repeat;
}

/* ---------- Shared pieces: cards, swatches, staples, tags ---------- */

.sample-card {
	position: relative;
	background: var(--card);
	border-radius: 2px;
	box-shadow: 0 1px 0 var(--board-shade);
}

.staple {
	display: block;
	width: 28px;
	height: 8px;
	background: url("assets/cloth/staple.svg") center / contain no-repeat;
}

/* A pinked swatch drawn with the pinked edge files: 8px teeth on every side. */
.pinked {
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-oat.svg") 8 / 8px round;
	background: var(--oat-pale) padding-box;
}

.niche-tag {
	position: relative;
	display: inline-block;
	padding: 0.35rem 0.85rem 0.3rem;
	border: 6px solid transparent;
	border-image: url("assets/cloth/pinked-blush.svg") 8 / 6px round;
	background: var(--blush) padding-box;
	color: var(--ink);
	font-size: var(--step-xs);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
}
.niche-tag::before {
	content: "";
	position: absolute;
	left: 10px;
	top: -7px;
	width: 22px;
	height: 7px;
	background: url("assets/cloth/staple.svg") center / contain no-repeat;
}
a.niche-tag:hover { text-decoration: underline; }

.fibre-line {
	margin: 0;
	padding-top: 0.6rem;
	border-top: 1px solid var(--rule);
	color: var(--muted);
	font-size: var(--step-s);
	font-weight: 500;
	line-height: 1.45;
}

.quiet-card {
	background: var(--quiet-card);
	border-radius: 2px;
	padding: var(--space-3);
}

/* ---------- The ad slot and its label (runtime names) ---------- */

.dent-de-scie {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow: hidden;
}
.dent-de-scie iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
	margin-inline: auto;
}
.fiche-matiere {
	display: block;
	margin: 0 0 0.5rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: var(--step-xs);
	font-weight: 500;
	letter-spacing: 0.01em;
}

.ad-card {
	background: var(--quiet-card);
	border-radius: 2px;
	padding: 1rem 1rem 1.1rem;
}

/* ---------- Home: the open sample book ---------- */

.book {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-areas: "tagline" "lead" "strip" "own" "advanced";
	gap: var(--space-4);
	padding-block: var(--space-5) var(--space-3);
}
.book__cover {
	grid-row: 1 / span 2;
	grid-column: 1;
	margin: -1rem -1rem;
	border-radius: 3px;
	padding: 12px;
}
.book__cover::before {
	content: "";
	display: block;
	height: 100%;
	background: var(--board);
	border-radius: 1px;
	box-shadow: inset 0 0 0 1px rgba(42, 35, 38, 0.06);
}
.book__tagline {
	grid-area: tagline;
	position: relative;
	z-index: 1;
	padding: var(--space-3) var(--space-3) 0;
}
.book__tagline h1 {
	margin: 0 0 var(--space-3);
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(3.25rem, 7.2vw, 6rem);
	line-height: 0.98;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.book__tagline p {
	max-width: 26em;
	margin: 0;
	font-size: var(--step-1);
	line-height: 1.5;
}
.book__lead {
	grid-area: lead;
	position: relative;
	z-index: 1;
	padding: 0 var(--space-3) var(--space-3);
}
.book__advanced { grid-area: advanced; }

.lead-sample {
	position: relative;
	display: flow-root;
	margin-top: 2.5rem;
	padding: 0 var(--space-4) var(--space-4);
	color: inherit;
	text-decoration: none;
}
.lead-sample__swatch {
	position: relative;
	width: min(100%, 26rem);
	margin: -2.5rem auto var(--space-3) 0;
}
.lead-sample__swatch img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.lead-sample__swatch .staple,
.article-head__swatch .staple,
.sample-tile__swatch .staple {
	position: absolute;
	left: 50%;
	top: calc(6.67% - 5px);
	transform: translateX(-50%);
}
.lead-sample h2 {
	margin: 0 0 0.75rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(2rem, 3.4vw, 2.75rem);
	line-height: 1.08;
	text-wrap: balance;
}
.lead-sample:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; }
.lead-sample p { margin: 0 0 var(--space-3); }
.lead-sample__date { display: block; margin-top: 0.4rem; color: var(--muted); font-size: var(--step-s); }

.swatch-strip {
	grid-area: strip;
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3) var(--space-3);
}
.swatch-strip li {
	position: relative;
	padding: 1.25rem 1.1rem 1.1rem;
	background: var(--card);
	border-radius: 2px;
}
.swatch-strip__chip {
	position: relative;
	display: block;
	width: 64px;
	height: 64px;
	margin: -2.4rem 0 0.9rem;
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-sage.svg") 8 / 8px round;
	background: var(--sage) padding-box;
}
.swatch-strip li:nth-child(2) .swatch-strip__chip { border-image-source: url("assets/cloth/pinked-denim.svg"); background-color: var(--denim); }
.swatch-strip li:nth-child(3) .swatch-strip__chip { border-image-source: url("assets/cloth/pinked-oat.svg"); background-color: var(--oat-pale); }
.swatch-strip li:nth-child(4) .swatch-strip__chip { border-image-source: url("assets/cloth/pinked-blush.svg"); background-color: var(--blush); }
.swatch-strip__chip::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -8px;
	width: 22px;
	height: 7px;
	transform: translateX(-50%);
	background: url("assets/cloth/staple.svg") center / contain no-repeat;
}
.swatch-strip h3 {
	margin: 0 0 0.35rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: var(--step-2);
	line-height: 1.1;
}
.swatch-strip p { margin: 0; color: var(--muted); font-size: var(--step-s); font-weight: 500; line-height: 1.45; }

.own-text {
	grid-area: own;
	padding: var(--space-4) var(--space-3);
}
.own-text__body { max-width: var(--measure); }
.own-text__body > :first-child { margin-top: 0; }
.own-text__body h2 { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); line-height: 1.12; margin: var(--space-4) 0 var(--space-2); }
.own-text__slot { margin-top: var(--space-4); }

@media (min-width: 60em) {
	.book {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		grid-template-areas:
			"tagline lead"
			"advanced lead"
			"strip strip"
			"own own";
		column-gap: clamp(2.5rem, 5vw, 4.5rem);
		row-gap: var(--space-4);
	}
	.book__cover {
		grid-row: 1 / span 2;
		grid-column: 1 / -1;
		margin: -1.5rem -1.75rem;
		padding: 14px;
	}
	.book__cover::before {
		background:
			linear-gradient(90deg, transparent calc(45.45% - 18px), rgba(42, 35, 38, 0.10) calc(45.45% - 1px), rgba(42, 35, 38, 0.18) 45.45%, rgba(42, 35, 38, 0.06) calc(45.45% + 2px), transparent calc(45.45% + 26px)),
			var(--board);
	}
	.book__tagline { padding: var(--space-5) 0 0 var(--space-4); }
	.book__advanced { align-self: end; margin: 0 0 var(--space-4) var(--space-4); }
	.book__lead { padding: var(--space-5) var(--space-4) var(--space-4) 0; }
	.swatch-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--space-4); }
	.own-text { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); padding: var(--space-5); }
	.own-text__slot { margin-top: 0; }
}

/* ---------- Article: sample-card title block and reading column ---------- */

.article-head {
	position: relative;
	margin: var(--space-5) auto var(--space-4);
	width: min(66rem, 100% - 2.5rem);
}
.article-head__card {
	padding: var(--space-5) var(--space-4) var(--space-4);
}
.article-head__swatch {
	position: relative;
	width: min(17rem, 70%);
	margin: calc(-1 * var(--space-6)) 0 var(--space-3) auto;
}
.article-head__swatch img { display: block; width: 100%; aspect-ratio: 1 / 1; }
.article-head h1 {
	max-width: 15em;
	margin: var(--space-3) 0 var(--space-3);
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(2.5rem, 5.4vw, var(--step-5));
	line-height: 1.04;
	letter-spacing: -0.005em;
	text-wrap: balance;
}
.article-head__excerpt {
	max-width: 32em;
	margin: 0 0 var(--space-4);
	font-size: var(--step-1);
	line-height: 1.5;
	color: var(--ink);
}
.byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
	padding-top: var(--space-3);
	border-top: 1px solid var(--rule);
	font-size: var(--step-s);
}
.byline__team { display: flex; align-items: center; gap: 0.75rem; }
.byline__team img { width: 44px; height: 44px; }
.byline__name { display: block; font-weight: 600; color: var(--ink); }
.byline__role { display: block; color: var(--muted); }
.byline__dates { margin: 0; color: var(--muted); }
.byline__dates time { color: var(--ink); font-weight: 500; }

@media (min-width: 52em) {
	.article-head { margin-top: var(--space-6); }
	.article-head__card { padding: var(--space-5) min(22rem, 34%) var(--space-4) var(--space-5); }
	.article-head__swatch {
		position: absolute;
		right: -1.5rem;
		top: -2.5rem;
		width: min(19rem, 30%);
		margin: 0;
		z-index: 2;
	}
	.byline { margin-right: calc(-1 * min(22rem, 34%) + var(--space-5)); }
}

.reading {
	width: min(calc(var(--measure) + 8rem), 100% - 1.5rem);
	margin: 0 auto var(--space-5);
	padding: var(--space-4) clamp(1.1rem, 5vw, 4rem) var(--space-5);
}

.entry > * { max-width: var(--measure); margin-inline: auto; }
.entry > :first-child { margin-top: 0; }
.entry p, .entry ul, .entry ol, .entry dl { margin-top: 0; margin-bottom: 1.1em; }
.entry h2 {
	position: relative;
	margin: 2.4em auto 0.7em;
	padding-left: 2.75rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(1.875rem, 3.4vw, var(--step-3));
	line-height: 1.12;
	text-wrap: balance;
}
.entry h2::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 30px;
	height: 30px;
	border: 7px solid transparent;
	border-image: url("assets/cloth/pinked-sage.svg") 8 / 7px round;
	background: var(--sage) padding-box;
}
.entry h2:nth-of-type(5n + 2)::before { border-image-source: url("assets/cloth/pinked-denim.svg"); background-color: var(--denim); }
.entry h2:nth-of-type(5n + 3)::before { border-image-source: url("assets/cloth/pinked-oat.svg"); background-color: var(--oat-pale); }
.entry h2:nth-of-type(5n + 4)::before { border-image-source: url("assets/cloth/pinked-charcoal.svg"); background-color: var(--charcoal); }
.entry h2:nth-of-type(5n + 5)::before { border-image-source: url("assets/cloth/pinked-blush.svg"); background-color: var(--blush); }
.entry h3 { margin: 1.8em auto 0.5em; font-size: 1.25rem; font-weight: 650; line-height: 1.3; }
.entry strong { font-weight: 650; }
.entry ul { padding-left: 1.2em; }
.entry ul li::marker { color: var(--muted); }
.entry li + li { margin-top: 0.35em; }

/* steps: numbered small swatches */
.entry ol {
	list-style: none;
	padding-left: 0;
	counter-reset: step;
}
.entry ol > li {
	position: relative;
	min-height: 2.4rem;
	padding-left: 3.25rem;
	counter-increment: step;
}
.entry ol > li + li { margin-top: 0.9em; }
.entry ol > li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: -0.1rem;
	width: 2.35rem;
	height: 2.35rem;
	display: grid;
	place-items: center;
	border: 6px solid transparent;
	border-image: url("assets/cloth/pinked-blush.svg") 8 / 6px round;
	background: var(--blush) padding-box;
	font-family: var(--serif);
	font-size: 1.25rem;
	line-height: 1;
	color: var(--ink);
}

/* figures: pinked swatch frames, a little wider than the column */
.entry figure {
	max-width: calc(var(--measure) + 5rem);
	margin: 2.2em auto;
}
.entry figure > img,
.entry figure > picture,
.entry figure > svg {
	display: block;
	width: 100%;
	height: auto;
	padding: 0.9rem;
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-sagepale.svg") 8 / 8px round;
	background: #e4e9dc padding-box;
}
.entry figcaption {
	max-width: var(--measure);
	margin: 0.85rem auto 0;
	color: var(--muted);
	font-size: var(--step-s);
	line-height: 1.5;
}
.entry figcaption strong { color: var(--ink); }

/* tables: sample sheets with a blush head row */
.sample-sheet {
	max-width: calc(var(--measure) + 5rem);
	margin: 2em auto;
	overflow-x: auto;
	border-radius: 2px;
	box-shadow: 0 0 0 1px var(--rule);
}
.entry table {
	width: 100%;
	min-width: 32rem;
	border-collapse: collapse;
	font-size: 1rem;
	line-height: 1.45;
}
.entry > table { display: block; overflow-x: auto; max-width: calc(var(--measure) + 5rem); }
.entry caption {
	caption-side: top;
	padding: 0.8rem 1rem;
	text-align: left;
	font-weight: 600;
	font-size: var(--step-s);
	background: var(--card);
	border-bottom: 1px solid var(--rule);
}
.entry thead th {
	background: var(--blush);
	color: var(--ink);
	font-weight: 650;
	text-align: left;
	vertical-align: bottom;
}
.entry th, .entry td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.entry tbody th { text-align: left; font-weight: 600; }
.entry tbody tr:last-child > * { border-bottom: 0; }

/* asides: stapled swatch notes */
.entry aside {
	position: relative;
	max-width: calc(var(--measure) + 1rem);
	margin: 2.2em auto;
	padding: 1.4rem 1.5rem 0.6rem;
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-oat.svg") 8 / 8px round;
	background: var(--oat-pale) padding-box;
}
.entry aside::before {
	content: "";
	position: absolute;
	left: 1.25rem;
	top: -8px;
	width: 28px;
	height: 8px;
	background: url("assets/cloth/staple.svg") center / contain no-repeat;
}
.entry aside p { margin-bottom: 0.8em; }

/* questions: folded sample flaps */
.entry details {
	margin: 0.8em auto;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}
.entry details + details { margin-top: -0.8em; border-top: 0; }
.entry summary {
	position: relative;
	padding: 0.9rem 2.5rem 0.9rem 0;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary::after {
	content: "";
	position: absolute;
	right: 0.2rem;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	border: 5px solid transparent;
	border-image: url("assets/cloth/pinked-denim.svg") 8 / 5px round;
	background: var(--denim) padding-box;
}
.entry details[open] summary::after { border-image-source: url("assets/cloth/pinked-blush.svg"); background-color: var(--blush); }
.entry details > :not(summary) { margin-top: 0; }
.entry details > p:last-child { margin-bottom: 1rem; }

/* terms */
.entry dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.entry dt { font-weight: 650; padding-top: 0.7rem; border-top: 1px solid var(--rule); }
.entry dd { margin: 0.15rem 0 0.8rem; color: var(--ink); }

/* takeaways */
.entry blockquote {
	margin: 2em auto;
	padding: 0.4rem 0 0.4rem 1.4rem;
	border-left: 3px solid var(--blush);
	font-family: var(--serif);
	font-style: italic;
	font-size: var(--step-2);
	line-height: 1.25;
}
.entry blockquote p:last-child { margin-bottom: 0; }

.entry hr { border: 0; height: 6px; margin: 2.5em auto; background: url("assets/cloth/teeth-down.svg") left top / 10px 6px repeat-x; max-width: 8rem; }

.entry .dent-de-scie,
.entry .ad-card { max-width: calc(var(--measure) + 2rem); margin: 2.4em auto; }

.team-note {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 1rem 1.25rem;
	max-width: var(--measure);
	margin: var(--space-5) auto 0;
	padding: var(--space-3);
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 2px;
}
.team-note img { width: 56px; height: 56px; }
.team-note h2 { margin: 0 0 0.25rem; font-family: var(--serif); font-weight: 400; font-size: var(--step-2); line-height: 1.1; }
.team-note p { margin: 0; font-size: 1rem; }
.team-note p + p { margin-top: 0.5rem; }

.more-samples { width: min(66rem, 100% - 2.5rem); margin: 0 auto var(--space-6); }
.more-samples > h2 { margin: 0 0 var(--space-4); font-family: var(--serif); font-weight: 400; font-size: var(--step-3); line-height: 1.1; }

/* ---------- Archive and listing cards ---------- */

.archive-band {
	position: relative;
	padding-block: var(--space-5) var(--space-5);
}
.archive-band::after {
	content: "";
	position: absolute;
	left: 0; right: 0;
	bottom: -6px;
	height: 6px;
	background: url("assets/cloth/teeth-down.svg") left top / 10px 6px repeat-x;
}
.archive-band h1 {
	margin: 0 0 0.6rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(3rem, 7vw, 5.25rem);
	line-height: 1;
}
.archive-band p { max-width: 36em; margin: 0; font-size: var(--step-1); line-height: 1.5; }

.sample-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-6) var(--space-4);
	margin: var(--space-6) 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 48em) {
	.sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sample-grid > li:nth-child(even) { margin-top: var(--space-5); }
}

.sample-tile {
	position: relative;
	display: flow-root;
	height: 100%;
	padding: 0 var(--space-3) var(--space-3);
	color: inherit;
	text-decoration: none;
}
.sample-tile__swatch { position: relative; width: 12rem; margin: -3rem 0 var(--space-3); }
.sample-tile__swatch img { display: block; width: 100%; aspect-ratio: 1 / 1; }
.sample-tile h2, .sample-tile h3 {
	margin: 0 0 0.6rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: var(--step-2);
	line-height: 1.12;
	text-wrap: balance;
}
.sample-tile:hover h2, .sample-tile:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; }
.sample-tile p { margin: 0 0 var(--space-2); }
.sample-tile .fibre-line { margin-top: var(--space-2); }
.sample-tile--plain { padding-top: var(--space-3); }

.pagination { margin: 0 0 var(--space-6); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pagination a, .pagination span { padding: 0.5rem 0.9rem; background: var(--card); border-radius: 2px; text-decoration: none; }
.pagination .current { background: var(--blush); }

/* ---------- Institutional and policy pages ---------- */

.page-sheet {
	width: min(calc(var(--measure) + 8rem), 100% - 1.5rem);
	margin: var(--space-5) auto var(--space-6);
	padding: var(--space-5) clamp(1.1rem, 5vw, 4rem);
}
.page-sheet__head { max-width: var(--measure); margin: 0 auto var(--space-4); }
.page-sheet__head h1 {
	margin: var(--space-3) 0 0.75rem;
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(2.5rem, 5vw, 3.75rem);
	line-height: 1.04;
	text-wrap: balance;
}
.page-sheet__head p { margin: 0; color: var(--muted); font-size: var(--step-s); font-weight: 500; }
.page-sheet__chip {
	display: block;
	width: 48px;
	height: 48px;
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-blush.svg") 8 / 8px round;
	background: var(--blush) padding-box;
}
.page-sheet--policy .page-sheet__chip { border-image-source: url("assets/cloth/pinked-oat.svg"); background-color: var(--oat-pale); }
.page-sheet--contact .page-sheet__chip { border-image-source: url("assets/cloth/pinked-denim.svg"); background-color: var(--denim); }
.page-sheet .entry h2 { font-size: clamp(1.625rem, 3vw, 2rem); }

.about-team {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 1rem 1.25rem;
	max-width: var(--measure);
	margin: var(--space-4) auto 0;
	padding-top: var(--space-3);
	border-top: 1px solid var(--rule);
}
.about-team img { width: 64px; height: 64px; }
.about-team p { margin: 0; }

/* the measurement choice on the cookies page (runtime names) */
.nuancier {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	max-width: var(--measure);
	margin: 1.5em auto;
	padding: 1rem 1.1rem;
	border: 8px solid transparent;
	border-image: url("assets/cloth/pinked-oat.svg") 8 / 8px round;
	background: var(--oat-pale) padding-box;
}
.nuancier button,
.onglet button {
	min-height: 44px;
	min-width: 7.5rem;
	padding: 0.55rem 1.1rem;
	border: 1.5px solid var(--ink);
	border-radius: 2px;
	background: var(--card);
	color: var(--ink);
	font: 600 1rem/1.2 var(--sans);
	cursor: pointer;
}
.nuancier button:hover,
.onglet button:hover { background: var(--oat-pale); }
.teinte {
	flex-basis: 100%;
	margin: 0;
	color: var(--ink);
	font-size: var(--step-s);
	font-weight: 500;
}

/* ---------- Search and the missing page ---------- */

.search-sheet { width: min(66rem, 100% - 2.5rem); margin: var(--space-5) auto var(--space-6); }
.search-sheet__head { padding: var(--space-4); }
.search-sheet__head h1 { margin: 0 0 var(--space-3); font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1.05; }
.search-form { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 34rem; }
.search-form label { flex-basis: 100%; font-weight: 600; font-size: var(--step-s); }
.search-form input[type="search"] {
	flex: 1 1 14rem;
	min-height: 48px;
	padding: 0.6rem 0.9rem;
	border: 1.5px solid var(--muted);
	border-radius: 2px;
	background: var(--card);
	color: var(--ink);
	font: 400 1.0625rem/1.3 var(--sans);
}
.search-form button {
	min-height: 48px;
	padding: 0.6rem 1.3rem;
	border: 0;
	border-radius: 2px;
	background: var(--ink);
	color: var(--card);
	font: 600 1rem/1.2 var(--sans);
	cursor: pointer;
}
.search-form button:hover { background: var(--charcoal); }
.search-list { margin-top: var(--space-6); }
.empty-note { padding: var(--space-4); }
.empty-note p { margin: 0 0 1rem; max-width: 34em; }

.missing { width: min(52rem, 100% - 2.5rem); margin: var(--space-6) auto; padding: var(--space-5) var(--space-4); }
.missing__chips { display: flex; gap: 0.6rem; margin-bottom: var(--space-3); }
.missing__chips span { width: 40px; height: 40px; border: 7px solid transparent; border-image: url("assets/cloth/pinked-sage.svg") 8 / 7px round;
	background: var(--sage) padding-box; }
.missing__chips span:nth-child(2) { border-image-source: url("assets/cloth/pinked-white.svg"); background-color: var(--card); box-shadow: inset 0 0 0 1px var(--rule); }
.missing__chips span:nth-child(3) { border-image-source: url("assets/cloth/pinked-blush.svg"); background-color: var(--blush); }
.missing h1 { margin: 0 0 var(--space-2); font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1.05; }
.missing p { max-width: 34em; }

/* ---------- Footer: the back cover ---------- */

.back-cover {
	position: relative;
	margin-top: var(--space-5);
	padding-block: var(--space-5) var(--space-4);
}
.back-cover::before {
	content: "";
	position: absolute;
	left: 0; right: 0;
	top: -6px;
	height: 6px;
	background: url("assets/cloth/teeth-up.svg") left top / 10px 6px repeat-x;
}
.back-cover__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
}
.back-cover__brand { display: grid; grid-template-columns: 56px 1fr; gap: 1rem; align-items: start; }
.back-cover__brand img { width: 56px; height: 56px; }
.back-cover__tagline { margin: 0 0 0.5rem; font-family: var(--serif); font-size: var(--step-2); line-height: 1.1; }
.back-cover__publisher { margin: 0; font-size: 1rem; line-height: 1.55; }
.back-cover__publisher a, .fibre-menu a { color: var(--ink); }
.fibre-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2 12rem;
	column-gap: var(--space-4);
}
.fibre-menu li { break-inside: avoid; border-bottom: 1px solid rgba(42, 35, 38, 0.22); }
.fibre-menu a {
	display: block;
	padding: 0.55rem 0 0.45rem;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
}
.fibre-menu a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.back-cover__small { margin: var(--space-4) 0 0; font-size: var(--step-xs); color: var(--ink); }

@media (min-width: 52em) {
	.back-cover__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-5); }
}

/* ---------- Measurement banner (runtime name: onglet) ---------- */

.onglet {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 40;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 1rem;
	padding: 0.6rem max(1rem, env(safe-area-inset-left)) calc(0.6rem + env(safe-area-inset-bottom));
	background: var(--card);
	border-top: 1px solid var(--board-shade);
	color: var(--ink);
	font-size: 0.875rem;
	line-height: 1.4;
}
.onglet p { margin: 0; max-width: 46rem; }
.onglet a { color: var(--link); }
.onglet button { min-width: 6.5rem; }
.onglet [hidden] { display: none; }
body:has(.onglet:not([hidden])) { padding-bottom: 7.5rem; }

@media (max-width: 40em) {
	.onglet { justify-content: flex-start; gap: 0.45rem 0.6rem; padding-top: 0.55rem; font-size: 0.8125rem; }
	.onglet button { flex: 1 1 0; min-width: 0; }
	body:has(.onglet:not([hidden])) { padding-bottom: 10.5rem; }
}

/* ---------- Small screens ---------- */

@media (max-width: 40em) {
	.wordmark img { height: 38px; }
	.cover-band__inner { flex-wrap: wrap; gap: 0.5rem 1rem; }
	.shelf-menu ul { gap: 1.25rem; }
	.book { padding-top: var(--space-4); }
	.book__tagline { padding: var(--space-3) var(--space-2) 0; }
	.book__lead { padding: 0 var(--space-1) var(--space-2); }
	.lead-sample { padding: 0 var(--space-3) var(--space-3); }
	.own-text { padding: var(--space-3) var(--space-3); }
	.article-head__card { padding: var(--space-4) var(--space-3) var(--space-3); }
	.article-head__swatch { margin-top: calc(-1 * var(--space-5)); }
	.reading { padding-top: var(--space-3); }
	.entry h2 { padding-left: 2.4rem; }
	.entry h2::before { width: 26px; height: 26px; border-width: 6px; border-image-width: 6px; }
	.entry figure > img { padding: 0.5rem; }
	.entry aside { padding: 1.2rem 1rem 0.4rem; }
}

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

/* ---------- Additions ---------- */

.ad-card.article-advanced {
	width: min(calc(var(--measure) + 8rem), 100% - 1.5rem);
	margin: 0 auto var(--space-4);
}
.search-count { margin: 0 0 var(--space-2); font-weight: 500; }
.search-list .sample-grid { margin-top: var(--space-5); }
.missing .search-form { margin-top: var(--space-4); }

/* sample sheets: the caption is repeated above the scrolling sheet so it never scrolls away */
.sample-sheet-wrap { max-width: calc(var(--measure) + 5rem); margin: 2em auto; }
.sample-sheet-wrap .sample-sheet { margin: 0; }
.sample-sheet__title {
	margin: 0 0 0.6rem;
	font-weight: 650;
	font-size: var(--step-s);
	line-height: 1.4;
}
.sample-sheet caption {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0 !important;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0 !important;
}

@media (min-width: 52em) {
	.entry figure,
	.entry .sample-sheet-wrap {
		max-width: none;
		margin-left: -2.5rem;
		margin-right: -2.5rem;
	}
	.entry figure figcaption { padding-inline: 2.5rem; }
}

@media (max-width: 40em) {
	.entry table { min-width: 30rem; font-size: 0.9375rem; }
	.entry th, .entry td { padding: 0.6rem 0.75rem; }
	.team-note { grid-template-columns: 1fr; }
	.team-note img { width: 48px; height: 48px; }
	.reading { padding-inline: 1rem; }
}
.entry code {
	padding: 0.05em 0.35em;
	border-radius: 2px;
	background: var(--oat-pale);
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.88em;
}
