/*
Theme Name: TapeMeasure.org
Description: A museum-style theme for a collection of vintage pocket tape measures. Requires the TapeMeasure.org Catalog plugin.
Version: 1.3.0
Author: TapeMeasure.org
Requires PHP: 7.4
Text Domain: tapemeasure
*/

/* ==========================================================================
   Tokens — aged catalog paper, printer's ink, brass, and blade yellow
   ========================================================================== */

:root {
	--paper: #f2ead7;
	--paper-deep: #e6dbc1;
	--card: #fbf7ee;
	--photo-bg: #fdfbf6;
	--ink: #241d16;
	--ink-2: #4a3e31;
	--muted: #77695a;
	--rule: #cdbd98;
	--rule-soft: #ddd0b2;
	--brass: #9a6d22;
	--brass-light: #c79a45;
	--tape: #e4b43a;
	--tape-edge: #a07c1f;

	/* The ruler strip: a cream enamel blade. */
	--blade-base: #ebdfbf;
	--blade-light: #f6eedb;
	--blade-edge: #c2ad80;
	--blade-ink: #2a2118;
	--blade-red: #a3301f;
	--blade-age: .5;
	--red: #8e2c1f;
	--red-soft: #f3dcd3;
	--ok: #2f5b33;

	--display: "Libre Caslon Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--serif: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--mono: "Courier Prime", "Courier New", Courier, monospace;

	--wrap: 1200px;
	--narrow: 720px;
	--gutter: clamp(16px, 4vw, 40px);
	--radius: 3px;

	color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.has-lightbox { overflow: hidden; }

body {
	margin: 0;
	background-color: var(--paper);
	background-image: radial-gradient(ellipse at 50% 0%, rgba(255, 252, 240, .7), transparent 70%);
	background-attachment: fixed;
	color: var(--ink);
	font-family: var(--serif);
	font-size: 17px;
	line-height: 1.65;
	overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.screen-reader-text, .tm-form__hp {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip-link:focus { left: 8px; }

.muted { color: var(--muted); }

.kicker {
	font-family: var(--mono);
	font-size: 13px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--brass);
	margin: 0 0 .6em;
}
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }

.byline { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0; }

.section-title {
	font-family: var(--mono);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	margin: 0 0 1rem;
}
.section-title a { color: inherit; }

.button {
	display: inline-flex; align-items: center; gap: .4em;
	font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	padding: .75em 1.3em;
	background: var(--ink); color: var(--paper);
	border: 1px solid var(--ink); border-radius: var(--radius);
	text-decoration: none; cursor: pointer;
	transition: background .15s, color .15s;
}
.button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ==========================================================================
   The tape: a strip of blade used as divider and progress bar
   ========================================================================== */

.tape--progress {
	position: relative;
	height: 18px;
	/* The empty part reads as a recessed slot; the filled part is the cream blade. */
	background: #d3c6a6;
	box-shadow: inset 0 1px 3px rgba(60, 40, 15, .25);
	border: 1px solid var(--rule);
	border-radius: 2px;
	overflow: hidden;
}
.tape__fill {
	position: absolute; inset: 0 auto 0 0;
	background: linear-gradient(var(--blade-edge), var(--blade-light) 45%, var(--blade-base) 70%, var(--blade-edge));
	border-right: 2px solid #8a6d3a;
}
/* Graduations drawn over both parts. */
.tape--progress::after {
	content: "";
	position: absolute; inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(to right, rgba(42, 33, 24, .7) 1.5px, transparent 1.5px),
		linear-gradient(to right, rgba(42, 33, 24, .55) 1px, transparent 1px),
		linear-gradient(to right, rgba(42, 33, 24, .5) 1px, transparent 1px),
		linear-gradient(to right, rgba(42, 33, 24, .45) 1px, transparent 1px);
	background-size: 64px 70%, 32px 50%, 16px 34%, 8px 22%;
	background-repeat: repeat-x;
}

/* The page-edge ruler (see tmt_ruler() in functions.php). */
.ruler { display: block; width: 100%; height: 30px; overflow: hidden; }
/* A faint shadow under the header blade so it lifts off the page. */
.masthead .ruler { position: relative; z-index: 1; filter: drop-shadow(0 2px 2px rgba(60, 40, 15, .22)) drop-shadow(0 4px 8px rgba(60, 40, 15, .10)); overflow: visible; }
.ruler__ticks { stroke: var(--blade-ink); stroke-width: 1; fill: none; opacity: .88; }
.ruler__nums { font-family: var(--serif); font-size: 12.5px; fill: var(--blade-ink); text-anchor: end; opacity: .9; }
.ruler__foot { fill: var(--blade-red); font-weight: 700; }
.ruler__age { opacity: var(--blade-age); mix-blend-mode: multiply; }
.ruler__rim { stroke: rgba(60, 40, 15, .45); stroke-width: 1; }
.ruler__hook-edge { fill: none; stroke: rgba(50, 35, 10, .55); stroke-width: 1; }
.ruler__rivet { fill: #d6b878; stroke: #5e4519; stroke-width: 1; }
.ruler__rivet-hole { fill: #4a3612; }

/* ==========================================================================
   Masthead and navigation
   ========================================================================== */

.masthead { background: var(--paper); position: relative; z-index: 10; }
.masthead__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding-block: 18px;
	flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 46px; height: 46px; color: var(--ink); flex: none; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: .01em; }
.brand__tagline { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.nav__list a {
	font-family: var(--serif); font-size: 17px; font-variant: small-caps; letter-spacing: .06em;
	color: var(--ink); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent;
}
.nav__list a:hover, .nav__list .current-menu-item > a, .nav__list .current_page_item > a { border-bottom-color: var(--brass); }
.nav__search input {
	font-family: var(--mono); font-size: 14px;
	width: 200px; padding: 7px 10px;
	background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink);
}

.nav-toggle {
	display: none; align-items: center; gap: 10px;
	background: none; border: 1px solid var(--ink); border-radius: var(--radius);
	font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
	padding: 8px 12px; color: var(--ink); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

@media (max-width: 980px) {
	.nav-toggle { display: inline-flex; }
	.nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 16px; padding-bottom: 8px; }
	.nav.is-open { display: flex; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav__list a { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
	.nav__search input { width: 100%; }
	.brand__name { font-size: 24px; }
	.brand__mark { width: 38px; height: 38px; }
}

/* ==========================================================================
   Page heads
   ========================================================================== */

.site-main { padding-bottom: 72px; }

.page-head { padding-block: 48px 28px; max-width: 820px; }
.page-title { font-size: clamp(36px, 6vw, 60px); margin-bottom: .3em; }
.page-dek { font-size: 19px; color: var(--ink-2); margin: 0; }
.page-dek p { margin: 0 0 .6em; }

.crumbs { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin-inline: 6px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 3px double var(--ink); padding-top: 14px; margin-bottom: 20px; }
.section-head .section-title { margin: 0; }
.section-more { font-family: var(--mono); font-size: 14px; }

.empty { padding: 40px 0; color: var(--ink-2); }

/* ==========================================================================
   Catalog cards
   ========================================================================== */

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 28px 24px;
}
.card-grid--four { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.tm-card { min-width: 0; }
.tm-card__link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.tm-card__image {
	aspect-ratio: 1;
	display: flex; align-items: center; justify-content: center;
	background: var(--photo-bg);
	border: 1px solid var(--rule);
	box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s;
}
/* Photos fill the card edge to edge; the gray photo background becomes the tile. */
.tm-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tm-card__link:hover .tm-card__image { border-color: var(--brass); box-shadow: 0 6px 18px -10px rgba(36, 29, 22, .45); }
.tm-card__link:hover .tm-card__image img { transform: scale(1.04); }
.tm-card__body { padding-top: 12px; }
.tm-card__no { display: block; font-family: var(--mono); font-size: 13px; color: var(--brass); letter-spacing: .06em; }
.tm-card__title { font-family: var(--serif); font-size: 17px; line-height: 1.35; margin: 4px 0 4px; }
.tm-card__link:hover .tm-card__title { color: var(--red); }
.tm-card__meta { font-size: 14px; color: var(--muted); margin: 0; }

.tm-placeholder { width: 62%; color: var(--rule); }

/* Not in the collection: shown as an outline in the case. */
.tm-card--sought .tm-card__image, .tm-card--documented .tm-card__image {
	background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(205, 189, 152, .18) 10px 20px), var(--paper);
	border-style: dashed;
}
.tm-card--sought .tm-card__image img, .tm-card--documented .tm-card__image img { filter: grayscale(1) sepia(.25); opacity: .7; }

.tm-badge {
	display: inline-block; margin-top: 8px;
	font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
	padding: 2px 8px; border: 1px solid currentColor; border-radius: 2px;
}
.tm-badge--sought { color: var(--red); }
.tm-badge--documented { color: var(--muted); }
.tm-badge--upgrade { color: var(--brass); }
.tm-badge + .tm-badge { margin-left: 4px; }

.results-count { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0 0 20px; }

/* Pagination */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination a.page-numbers:hover { border-color: var(--ink); }

/* ==========================================================================
   Filters
   ========================================================================== */

.filters {
	position: relative;
	padding: 18px 20px;
	margin-bottom: 28px;
	background: var(--card);
	border: 1px solid var(--rule);
	border-top: 3px solid var(--ink);
}
/* The main row: keyword, maker, group, sort, apply. Room is kept on the right for "More filters". */
.filters__main { display: flex; flex-wrap: wrap; gap: 14px 14px; align-items: flex-end; padding-right: 180px; }
.filters__search { flex: 2 1 200px; }
.filters__main .filters__field { flex: 1 1 125px; }
.filters__more-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 16px; align-items: end;
	margin-top: 16px; padding-top: 16px; border-top: 1px dotted var(--rule);
}
.filters__more-toggle {
	position: absolute; right: 20px; top: 46px;
	font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
	color: var(--red); cursor: pointer; list-style: none; white-space: nowrap;
	padding: 6px 0; border-bottom: 1px solid currentColor;
}
.filters__more-toggle::-webkit-details-marker { display: none; }
.filters__more-toggle::after { content: " ▾"; }
.filters__more[open] .filters__more-toggle::after { content: " ▴"; }
.filters__more-toggle:hover { color: var(--ink); }
.filters__label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.filters select, .filters input[type=search] {
	width: 100%; height: 38px; font-family: var(--serif); font-size: 15px; color: var(--ink);
	padding: 6px 10px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
}
.filters__actions { display: flex; align-items: center; gap: 14px; flex: none; }
.filters__apply.is-js { padding: .55em 1em; }
.filters__clear { font-family: var(--mono); font-size: 13px; }

.filters-toggle { display: none; }
@media (max-width: 760px) {
	.filters-wrap { margin-bottom: 24px; }
	.filters-toggle {
		display: flex; align-items: center; justify-content: space-between; gap: 8px;
		padding: 12px 16px; cursor: pointer; list-style: none;
		font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
		background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink);
	}
	.filters-toggle::-webkit-details-marker { display: none; }
	.filters-toggle::after { content: "+"; font-size: 20px; line-height: 1; }
	.filters-wrap[open] .filters-toggle::after { content: "−"; }
	.filters-toggle__n { margin-left: auto; font-weight: 400; color: var(--red); text-transform: none; letter-spacing: 0; }
	.filters-wrap .filters { border-top: 0; margin-bottom: 0; }
}
/* Narrower screens: "More filters" sits under the main row instead of beside it. */
@media (max-width: 980px) {
	.filters__main { padding-right: 0; }
	.filters__more-toggle { position: static; display: inline-block; margin-top: 14px; }
}
@media (max-width: 560px) {
	.filters { padding: 14px; }
	.filters__main .filters__field { flex-basis: calc(50% - 8px); }
	.filters__search { flex-basis: 100%; }
	.filters__more-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Object page
   ========================================================================== */

.object__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: 48px;
	padding-top: 20px;
	align-items: start;
}

.viewer__stage {
	display: block; width: 100%; padding: 0; margin: 0; position: relative;
	aspect-ratio: 1;
	background: var(--photo-bg);
	border: 1px solid var(--rule);
	cursor: zoom-in;
	overflow: hidden;
}
.viewer__img { width: 100%; height: 100%; object-fit: contain; padding: 5%; }
.viewer__zoom-hint {
	position: absolute; right: 12px; bottom: 12px;
	display: inline-flex; align-items: center; gap: 6px;
	font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
	padding: 5px 10px; background: rgba(36, 29, 22, .82); color: var(--paper); border-radius: 2px;
	opacity: .85; transition: opacity .15s;
}
.viewer__stage:hover .viewer__zoom-hint { opacity: 1; }
.viewer__caption { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 8px 0 0; min-height: 1.4em; }

.viewer__thumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 14px 0 0; }
.viewer__thumb {
	width: 84px; padding: 0; background: var(--photo-bg);
	border: 1px solid var(--rule); cursor: pointer; display: flex; flex-direction: column;
}
.viewer__thumb img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: 4px; }
.viewer__thumb-label {
	font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 3px 4px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viewer__thumb.is-active { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--tape); }

.object__noimage {
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
	border: 1px dashed var(--rule);
	background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(205, 189, 152, .18) 12px 24px);
}
.object__noimage .tm-placeholder { width: 50%; color: var(--muted); }

.object__no { font-family: var(--mono); font-size: 16px; letter-spacing: .08em; color: var(--brass); margin: 0 0 6px; }
.object__title { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }

.status {
	display: inline-block;
	font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
	padding: 4px 10px; margin: 0 0 22px; border-radius: 2px;
}
.status--owned { background: var(--ink); color: var(--paper); }
.status--sought { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.status--documented { background: var(--paper-deep); color: var(--ink-2); border: 1px solid var(--rule); }
.status--upgrade { display: block; width: fit-content; margin-top: -12px; background: #f6ecd6; color: var(--brass); border: 1px solid var(--brass-light); }

/* The specification label, set like an old catalog card. */
.specs { margin: 0 0 28px; border-top: 2px solid var(--ink); }
.specs__row {
	display: grid; grid-template-columns: 130px 1fr; gap: 14px;
	padding: 9px 0;
	border-bottom: 1px dotted var(--rule);
}
.specs dt { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.specs dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.specs dd a { color: var(--ink); text-decoration-color: var(--brass); }
.specs dd a:hover { color: var(--red); }
.tm-qualifier { color: var(--muted); font-style: italic; font-size: .92em; }
.specs--compact .specs__row { grid-template-columns: 110px 1fr; padding: 6px 0; }

.object__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.object__section { margin-top: 64px; }
.object__section.prose { max-width: var(--narrow); }
.prose > .section-title { font-family: var(--mono); font-size: 14px; margin: 0 0 1rem; }

.linked-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.linked-image { margin: 0; }
.linked-image img { width: 100%; background: var(--photo-bg); border: 1px solid var(--rule); padding: 6px; }
.linked-image figcaption, .tm-embed figcaption, .essay figcaption, .wp-caption-text, .wp-element-caption {
	font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-top: 8px;
}
.credit { display: block; color: var(--muted); }

.group-strip__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.group-strip__count { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.group-strip .tape { margin-bottom: 22px; }
.card-row {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px);
	gap: 20px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity;
}
.card-row .tm-card { scroll-snap-align: start; }

.article-links { list-style: none; margin: 0; padding: 0; }
.article-links li { padding: 10px 0; border-bottom: 1px dotted var(--rule); font-size: 18px; }

.object__pager {
	display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
	margin-top: 64px; padding-top: 18px; border-top: 3px double var(--ink);
}
.object__pager a { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.object__pager a span { font-family: var(--mono); font-size: 13px; color: var(--brass); }
.object__pager a:hover { color: var(--red); }
.pager__next { grid-column: 2; text-align: right; }

@media (max-width: 860px) {
	.object__layout { grid-template-columns: 1fr; gap: 28px; }
	.specs__row { grid-template-columns: 110px 1fr; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
	position: fixed; inset: 0; z-index: 1000;
	display: flex; flex-direction: column;
	background: #16120d;
	color: var(--paper);
}
.lightbox[hidden] { display: none; }
.lightbox__canvas {
	flex: 1; position: relative; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	touch-action: none; cursor: zoom-in;
}
.lightbox__canvas.is-zoomed { cursor: grab; }
.lightbox__canvas.is-zoomed:active { cursor: grabbing; }
.lightbox__img {
	max-width: 94vw; max-height: calc(100vh - 80px);
	object-fit: contain; user-select: none; -webkit-user-drag: none;
	transform-origin: center center; transition: transform .08s ease-out;
}
.lightbox__bar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 10px 16px; border-top: 1px solid rgba(242, 234, 215, .15);
	font-family: var(--mono); font-size: 14px;
}
.lightbox__tools { display: flex; gap: 6px; flex: none; }
.lightbox__tools button {
	min-width: 40px; height: 38px; padding: 0 12px;
	background: transparent; color: var(--paper);
	border: 1px solid rgba(242, 234, 215, .35); border-radius: var(--radius);
	font-family: var(--mono); font-size: 16px; cursor: pointer;
}
.lightbox__tools button:hover { background: var(--paper); color: var(--ink); }
.lightbox__caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
	.lightbox__bar { flex-direction: column; align-items: stretch; }
	.lightbox__tools { justify-content: space-between; }
}

/* ==========================================================================
   Groups and explore
   ========================================================================== */

.group-progress { margin-top: 24px; max-width: 520px; }

/* Group page with a group photograph: text beside the photo. */
.page-head--group {
	max-width: none;
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start;
}
.page-head--group .viewer__stage { aspect-ratio: 4 / 3; }
.page-head--group .viewer__img { padding: 3%; }
@media (max-width: 860px) {
	.page-head--group { grid-template-columns: 1fr; gap: 24px; }
}

.group-list__photo {
	grid-column: 1 / -1; display: block; aspect-ratio: 4 / 3; margin-bottom: 8px;
	background: var(--photo-bg); border: 1px solid var(--rule); overflow: hidden;
}
.group-list__photo > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.group-list__photo:hover > img, .group-list__photo:hover .group-mosaic img { transform: scale(1.03); }

/* Pieces' photos tiled when a group has no group photograph. */
.group-mosaic { display: grid; width: 100%; height: 100%; gap: 2px; background: var(--rule-soft); grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.group-mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 0; transition: transform .3s; }
.group-mosaic--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.group-mosaic--2 { grid-template-rows: 1fr; }
.group-mosaic--3 img:first-child { grid-row: span 2; }
.group-mosaic--empty { display: flex; align-items: center; justify-content: center; background: var(--photo-bg); }
.group-mosaic--empty .tm-placeholder { width: 40%; color: var(--rule); }

.tm-embed__group-photo { display: block; margin-bottom: 8px; background: var(--photo-bg); border: 1px solid var(--rule); }
.tm-embed__group-photo img { display: block; width: 100%; height: auto; }
.tm-embed__group-caption { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin: 0 0 18px; }
.group-progress__text { font-family: var(--mono); font-size: 14px; margin: 0 0 8px; }
.group-progress__text strong { font-size: 20px; }

.subgroups { margin-bottom: 36px; }
.subgroups__list, .term-index, .group-list { list-style: none; margin: 0; padding: 0; }
.subgroups__list { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.subgroups__list .muted { font-family: var(--mono); font-size: 13px; margin-left: 4px; }

.callout {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	margin-top: 48px; padding: 22px 24px;
	background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--tape);
}
.callout p { margin: 0; max-width: 60ch; }

.jump { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-family: var(--mono); font-size: 14px; }

.explore-section { padding-top: 40px; margin-top: 24px; border-top: 3px double var(--ink); scroll-margin-top: 16px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__row {
	display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 18px; align-items: center;
	padding: 10px 0; border-bottom: 1px dotted var(--rule);
}
.timeline__decade { font-family: var(--display); font-size: 26px; color: var(--ink); text-decoration: none; }
.timeline__decade:hover { color: var(--red); }
.timeline__bar { position: relative; height: 22px; }
.timeline__fill {
	position: absolute; inset: 0 auto 0 0;
	background-color: var(--tape);
	background-image: linear-gradient(to right, var(--ink) 1px, transparent 1px), linear-gradient(to right, var(--ink) 1px, transparent 1px);
	background-size: 48px 60%, 12px 28%; background-repeat: repeat-x;
	border: 1px solid var(--tape-edge);
}
.timeline__count { position: relative; font-family: var(--mono); font-size: 13px; padding-left: 8px; line-height: 22px; text-shadow: 0 0 4px var(--tape), 0 0 2px var(--tape); }
.timeline__thumbs { display: flex; gap: 6px; }
.timeline__thumbs img { width: 46px; height: 46px; object-fit: contain; background: var(--photo-bg); border: 1px solid var(--rule); }

@media (max-width: 680px) {
	.timeline__row { grid-template-columns: 64px 1fr; }
	.timeline__thumbs { grid-column: 2; }
	.timeline__decade { font-size: 22px; }
}

.term-index { columns: 3 220px; column-gap: 32px; }
.term-index li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dotted var(--rule); display: flex; justify-content: space-between; gap: 8px; }
.term-index a { color: var(--ink); text-decoration: none; }
.term-index a:hover { color: var(--red); text-decoration: underline; }
.term-index__count { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.term-index--compact { columns: 1; }
.term-index .term-index__sub { padding-left: 16px; font-size: .95em; }
.term-index .term-index__sub a::before { content: "— "; color: var(--muted); }

.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 32px; align-items: start; }
.group-list__item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.group-list__item .tape { grid-column: 1 / -1; }
.group-list__name { font-size: 18px; color: var(--ink); }
.group-list__count { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.construction { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px; }
.construction__title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 6px; }

/* ==========================================================================
   Home
   ========================================================================== */

.hero { padding-block: 64px 48px; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 56px; align-items: end; }
.hero .kicker { grid-column: 1 / -1; }
.hero__title { font-size: clamp(44px, 8vw, 92px); line-height: .98; margin: 0; letter-spacing: -.01em; }
.hero__intro { font-size: 19px; color: var(--ink-2); }
.hero__stats {
	grid-column: 1 / -1;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 28px 0 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.hero__stats > div { padding: 14px 0; }
.hero__stats > div + div { border-left: 1px dotted var(--rule); padding-left: 20px; }
.hero__stats dt { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero__stats dd { margin: 0; font-family: var(--display); font-size: clamp(32px, 5vw, 48px); line-height: 1.1; }

@media (max-width: 860px) {
	.hero { padding-block: 40px 28px; }
	.hero__inner { grid-template-columns: 1fr; }
}

.feature {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
	margin-block: 24px 72px;
}
.feature__media {
	background: var(--photo-bg); border: 1px solid var(--rule);
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative;
}
.feature__media::after {
	content: ""; position: absolute; inset: 10px; border: 1px solid var(--rule-soft); pointer-events: none;
}
.feature__media img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }
.feature__title { font-size: clamp(30px, 4vw, 44px); }
.feature__title a { color: var(--ink); text-decoration: none; }
.feature__title a:hover { color: var(--red); }
@media (max-width: 860px) {
	.feature { grid-template-columns: 1fr; gap: 24px; }
}

.home-section { margin-bottom: 72px; }

.article-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.article-card__image { display: block; margin-bottom: 14px; border: 1px solid var(--rule); background: var(--photo-bg); aspect-ratio: 4 / 3; overflow: hidden; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; }
.article-card__title { font-size: 24px; margin-bottom: 8px; }
.article-card--lead .article-card__title { font-size: 32px; }
.article-card__title a { color: var(--ink); text-decoration: none; }
.article-card__title a:hover { color: var(--red); }
.article-card__dek { margin: 0 0 8px; color: var(--ink-2); font-size: 16px; }
@media (max-width: 860px) {
	.article-grid { grid-template-columns: 1fr; }
}

.ways {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.ways li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ways a { display: flex; flex-direction: column; gap: 4px; padding: 22px 22px 24px; height: 100%; color: var(--ink); text-decoration: none; background: transparent; transition: background .15s; }
.ways a:hover { background: var(--card); }
.ways__label { font-family: var(--display); font-size: 26px; }
.ways a:hover .ways__label { color: var(--red); }
.ways__desc { font-size: 15px; color: var(--muted); }

/* ==========================================================================
   Articles
   ========================================================================== */

.article-list { display: flex; flex-direction: column; }
.article-row {
	display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px;
	padding: 26px 0; border-top: 1px solid var(--rule);
}
.article-row:not(:has(.article-row__image)) { grid-template-columns: 1fr; }
.article-row__image { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--rule); overflow: hidden; background: var(--photo-bg); }
.article-row__image img { width: 100%; height: 100%; object-fit: cover; }
.article-row__title { font-size: 30px; margin: 4px 0 8px; }
.article-row__title a { color: var(--ink); text-decoration: none; }
.article-row__title a:hover { color: var(--red); }
.article-row__dek { margin: 0; color: var(--ink-2); }
.article-list .tm-card { padding: 20px 0; border-top: 1px solid var(--rule); }
.article-list .tm-card__link { flex-direction: row; gap: 20px; }
.article-list .tm-card__image { width: 120px; flex: none; }
@media (max-width: 640px) {
	.article-row { grid-template-columns: 1fr; gap: 14px; }
	.article-row__title { font-size: 25px; }
}

.essay__head { padding-block: 56px 32px; text-align: center; }
.essay__title { font-size: clamp(36px, 6vw, 62px); margin-bottom: .35em; }
.essay__dek { font-size: 21px; font-style: italic; color: var(--ink-2); margin: 0 auto 20px; max-width: 34em; }
.essay__head .byline { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; display: inline-block; }
.essay__lead { margin: 0 auto 40px; max-width: 1000px; }
.essay__lead img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: var(--photo-bg); border: 1px solid var(--rule); }
.essay__foot { margin-top: 48px; }
.essay__tags { font-family: var(--mono); font-size: 14px; }
.essay__cite {
	font-size: 14px; color: var(--ink-2); background: var(--card);
	border: 1px solid var(--rule); padding: 14px 18px; overflow-wrap: anywhere;
}

/* Long-form text */
.prose { font-size: 18px; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-size: 30px; margin-top: 1.8em; }
.prose h3 { font-size: 23px; margin-top: 1.6em; }
.prose blockquote {
	margin-inline: 0; padding: 4px 0 4px 24px;
	border-left: 3px solid var(--tape); font-style: italic; color: var(--ink-2);
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose hr { border: 0; height: 24px; margin-block: 2.4em; background: center / 120px 1px no-repeat linear-gradient(var(--rule), var(--rule)); position: relative; }
.prose figure { margin-inline: 0; }
.prose img { border: 1px solid var(--rule); background: var(--photo-bg); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.prose th { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }

.single-post .essay__body > p:first-of-type::first-letter {
	float: left; font-family: var(--display); font-size: 4.4em; line-height: .82;
	padding: 6px 10px 0 0; color: var(--red);
}

/* Wider figures break out of the column. */
.essay__body .alignwide, .essay__body .tm-embed--grid { margin-inline: calc(50% - min(50vw, 540px) + var(--gutter)); }
.alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.aligncenter { margin-inline: auto; }

/* Catalog items inside articles */
.tm-embed { margin: 2em 0; padding: 18px; background: var(--card); border: 1px solid var(--rule); }
.tm-embed > .tm-card { max-width: 560px; }
.tm-embed .tm-card__link { flex-direction: row; gap: 18px; align-items: center; }
.tm-embed > .tm-card .tm-card__image { width: 140px; flex: none; }
.tm-embed .tm-card__title { font-family: var(--serif); font-size: 18px; }
.tm-embed--grid .tm-card__link { flex-direction: column; align-items: stretch; }
.tm-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.tm-ref { white-space: nowrap; }
.tm-ref__no { font-family: var(--mono); font-size: .78em; color: var(--brass); }
.tm-missing-ref { background: var(--red-soft); color: var(--red); padding: 8px 12px; font-family: var(--mono); font-size: 14px; }

/* Notes */
.tm-noteref { font-family: var(--mono); font-size: .7em; line-height: 0; margin-left: 1px; }
.tm-noteref a { text-decoration: none; padding: 0 2px; }
.tm-notes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--ink); font-size: 15px; line-height: 1.6; }
.tm-notes h2 { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 1em; }
.tm-notes ol { padding-left: 1.6em; }
.tm-notes li { scroll-margin-top: 20px; }
.tm-notes li:target { background: var(--card); outline: 1px solid var(--tape); }
.tm-notes__back { text-decoration: none; margin-left: 4px; }

/* ==========================================================================
   Contact form
   ========================================================================== */

.tm-contact { margin-top: 2em; }
.tm-contact__item { margin-bottom: 24px; }
.tm-contact__item .tm-card__link { flex-direction: row; gap: 16px; align-items: center; }
.tm-contact__item .tm-card__image { width: 90px; flex: none; }
.tm-form { display: grid; gap: 18px; font-size: 16px; }
.tm-form__row label { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; color: var(--ink-2); }
.tm-form__opt { text-transform: none; letter-spacing: 0; color: var(--muted); }
.tm-form input[type=text], .tm-form input[type=email], .tm-form select, .tm-form textarea {
	width: 100%; font: inherit; font-family: var(--serif); color: var(--ink);
	padding: 10px 12px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
}
.tm-form input:focus, .tm-form select:focus, .tm-form textarea:focus { border-color: var(--brass); outline: 2px solid rgba(154, 109, 34, .25); outline-offset: 0; }
.tm-form__help { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.tm-form .tm-button { justify-self: start; }
.tm-form button[type=submit] {
	justify-self: start;
	font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	padding: .8em 1.5em; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); cursor: pointer;
}
.tm-form button[type=submit]:hover { background: var(--red); border-color: var(--red); }

.tm-notice { padding: 14px 18px; margin-bottom: 20px; border: 1px solid; border-radius: var(--radius); }
.tm-notice ul { margin: 0; padding-left: 1.2em; }
.tm-notice--ok { background: #e6efe2; border-color: var(--ok); color: var(--ok); }
.tm-notice--error { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* ==========================================================================
   Footer
   ========================================================================== */

.colophon { background: var(--ink); color: var(--paper-deep); }
.colophon__inner {
	display: grid; grid-template-columns: 1fr auto; gap: 24px 48px;
	padding-block: 44px 36px;
}
.colophon__name { font-family: var(--display); font-size: 28px; color: var(--paper); margin: 0 0 4px; }
.colophon__stats { font-family: var(--mono); font-size: 13px; margin: 0; color: var(--brass-light); }
.colophon .nav__list { gap: 22px; flex-wrap: wrap; }
.colophon .nav__list a, .colophon__nav a { color: var(--paper-deep); font-variant: small-caps; text-decoration: none; letter-spacing: .06em; }
.colophon__nav a:hover { color: var(--tape); }
.colophon__nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 22px; margin: 0; padding: 0; }
.colophon__legal { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid rgba(242, 234, 215, .15); font-size: 13px; color: #a8998a; }
@media (max-width: 760px) {
	.colophon__inner { grid-template-columns: 1fr; }
	.colophon .nav__list { flex-direction: row; }
	.colophon .nav__list a { border: 0; padding: 0; }
}

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

@media print {
	.masthead, .colophon, .filters, .object__actions, .viewer__thumbs, .object__pager, .lightbox { display: none !important; }
	body { background: #fff; }
}
