@charset "UTF-8";

/*
 * The category pages (/form/, /navigation/, /layout/, /feedback/): option 01
 * "Filtered grid", the owner's pick of 2026-11-11
 * (mockups/category-page/01-filtered-grid.html), built in src/category.njk.
 *
 * Loads after /css/home.css, which carries everything below the opening: the
 * rail, the grid, the fields and their tiles, the level meter, the no-match
 * block, Jost and the lime focus ring. The level states are
 * /css/category-states/<slug>.css, the demo styles /css/bundles/<slug>.css,
 * and the header and footer chrome.css. global.css is never loaded here.
 *
 * What this file adds: the page's ground and type tokens, the trail, the
 * opening (the title on the left, the intro set in two columns beside it, as
 * the home poster sits beside its h1), the one inline code style, and the
 * category chips, which are links here rather than filters.
 *
 * Light theme: the opening on paper; dark theme: on ink. The rail and the
 * grid's checker are the home page's, so the page stays within its theme:
 * paper and #1f1f22 in light, #0c0c0d and #1f1f22 in dark.
 *
 * Flat CSS only (the repo's iOS 15.2 rule). Breakpoints use Bootstrap's
 * names: sm 576, md 768, lg 992, xl 1200, xxl 1400.
 */

/* ── Page tokens: the reading ground, paper or ink ────────────────────── */

body {
	--pg: #f4f1eb;
	--pg-ink: #0c0c0d;
	--pg-body: #1f1e1b;
	--pg-muted: #4f4e48;
}

body:has(#theme-toggle:checked) {
	--pg: #0c0c0d;
	--pg-ink: #f4f1eb;
	--pg-body: #e4e1da;
	--pg-muted: #a9a69e;
}

/* the page carries the token names the inline code style reads; each field
   sets its own for its demo */
main {
	--text: #1a1a1a;
	--surface-2: #ede9e0;
	--border: #d0ccc0;
	display: block;
	color: var(--pg-ink);
	background: var(--pg);
}

body:has(#theme-toggle:checked) main {
	--text: #f0f0f0;
	--surface-2: #1c1c1e;
	--border: #2a2a2d;
}

/* the site's one inline code style (global.css), on the page's own tokens */
:not(pre, dt, th) > code {
	font-family: var(--font-mono);
	font-size: .85em;
	color: var(--text);
	background: var(--surface-2);
	padding: .12em .4em;
	border-radius: 4px;
	border: 1px solid var(--border);
	overflow-wrap: anywhere;
}

/* ── Breadcrumb: Home > CSS Form Examples (as on the example pages) ───── */

.breadcrumb-trail ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .3rem .5rem;
	list-style: none;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.3;
}

.breadcrumb-trail li {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	color: var(--pg-muted);
}

.breadcrumb-trail a {
	color: inherit;
	text-decoration: none;
	border-radius: 4px;
}

.breadcrumb-trail a:hover {
	color: var(--pg-ink);
	text-decoration: underline;
}

.breadcrumb-trail [aria-current] {
	color: var(--pg-ink);
}

.breadcrumb-trail .fa-icon {
	width: .55em;
	height: .55em;
	opacity: .7;
}

/* ── The opening: the title, the intro beside it ───────────────────────── */

.category-opening {
	padding: clamp(1.5rem, 2.5vw, 2.25rem) var(--gutter) clamp(2.5rem, 4.5vw, 4.5rem);
}

.category-title {
	margin-top: clamp(.75rem, 1.5vw, 1.25rem);
	font-size: clamp(3rem, 5.6vw, 6rem);
	font-weight: 800;
	line-height: .9;
	letter-spacing: -.035em;
	color: var(--pg-ink);
	text-wrap: balance;
}

.category-intro {
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.category-intro p {
	max-width: 68ch;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--pg-body);
	text-wrap: pretty;
}

.category-intro p + p {
	margin-top: 1rem;
}

@media (min-width: 768px) {
	.category-intro {
		columns: 2 18rem;
		column-gap: clamp(1.75rem, 3vw, 3rem);
	}

	.category-intro p {
		break-inside: auto;
	}
}

/* from xl the title takes the left and the intro the right, the
   paragraphs' last line on the title's baseline */
@media (min-width: 1200px) {
	.category-opening-row {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: end;
		gap: clamp(2.5rem, 5vw, 6rem);
	}

	.category-intro {
		margin-top: 0;
		padding-bottom: .15rem;
	}
}

/* ── The checker's phase: no empty strip above the signup row ──────────── */

/* The grid ends on the signup row, which is always the checker's light
   side (paper in light, #1f1f22 in dark). Where a filter state leaves an
   empty end on the light side, the states file shifts the whole checker a
   step (--ph2 two to a row, --ph3 three to a row) and darkens the empty
   end, so it never runs into the signup row as an empty block. These are
   home.css's checker rules with the phase added; one to a row has no
   empty end */
@media (min-width: 992px) and (max-width: 1599.98px) {
	.grid > .cell {
		--p0: round(down, calc(mod(var(--p, 0) + 1 + var(--ph2, 0), 4) / 2), 1);
	}
}

@media (min-width: 1600px) {
	.grid > .cell {
		--p0: mod(var(--q, 0) + var(--ph3, 0), 2);
	}
}

/* ── The rail: the category chips are links ────────────────────────────── */

/* home.css styles the chips as labels for its category radios; here each
   one is a link to its hub, and the hub on show is the lit chip */
.rail-picks .chip {
	color: inherit;
	text-decoration: none;
}

.rail-picks .chip[aria-current="page"] {
	color: #0c0c0d;
	background: #b8ff57;
	border-color: #0c0c0d;
}

/* ── Each example's description, over the demo on hover ────────────────── */

/* The line rides up with the title band when a tile is hovered and lies over
   the bottom of the demo, just above the title. It takes no room of its own:
   the band's reserved height is the title and level, as on the home page, so
   no demo is sized around it (owner, 2026-11-12). Its ground is frosted glass
   in the field's own color (below), so the demo shows through it. It passes pointers through to the demo. */
.words {
	position: relative;
}

.tile-desc {
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	margin: 0;
	padding: calc(var(--pad) * .6) var(--pad) calc(var(--pad) * .15);
	font-size: 1rem;
	line-height: 1.45;
	color: var(--text);
	text-wrap: pretty;
	background: linear-gradient(var(--tint), var(--tint)), var(--field);
	pointer-events: none;
}

/* frosted glass where the browser can blur: the demo shows through, softened,
   so the line reads over it (owner, 2026-11-12); elsewhere it stays solid */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (color: color-mix(in srgb, red 50%, transparent)) {
	.tile-desc {
		background: linear-gradient(var(--tint), var(--tint)), color-mix(in srgb, var(--field) 45%, transparent);
		-webkit-backdrop-filter: blur(6px) saturate(1.15);
		backdrop-filter: blur(6px) saturate(1.15);
	}
}

@media (prefers-reduced-transparency: reduce) {
	.tile-desc {
		background: linear-gradient(var(--tint), var(--tint)), var(--field);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

/* A touch screen shows the band at all times, so there the line would sit on
   the demo for good: it stays in the page (search reads it) but not on screen */
@media not ((hover: hover) and (pointer: fine)) {
	.tile-desc {
		display: none;
	}
}
