/*
 * Pages (M4c): the page and hub templates, Visit & Access, About, Staff &
 * Board, Support, Submissions, the Projects archive and single project.
 *
 * Built from the Round 2 comps' template system (docs repo,
 * docs/design-round-2/components.py TEMPLATE_CSS): a crumb over the page
 * h1, white section bands that start with a 2px rule above their heading,
 * a 66ch reading column, outlined tiles on the page grid, and the
 * <details> accordion. Everything is scoped to .grunt-pg (the <main> of
 * these templates), so other templates are untouched.
 *
 * Sizes that grow with the page are in cqw (the page container), never vw.
 */

/* ---- Page frame and head ------------------------------------------------- */

.grunt-pg {
	padding: 0 var(--g) calc(var(--tpy) * 2);
}

.grunt-pg > * {
	margin-block: 0;
}

.grunt-pg-head {
	padding: 8px 0 0;
	margin: 0 0 16px;
}

.grunt-pg-head > * {
	margin-block: 0;
}

/* Crumb: 16px muted, 40px above the h1 (R2 .tpl-crumb). */
.grunt-pg .grunt-pg-crumbs {
	font-size: var(--wp--preset--font-size--body-s);
	color: var(--wp--preset--color--text-muted);
	margin: 0 0 40px;
}

.grunt-pg .grunt-pg-crumbs a {
	color: inherit;
}

.grunt-pg .grunt-pg-crumbs li:not(:last-child)::after {
	opacity: 1;
}

/* h1 at the xl step, no tracking (R2 .tpl-title). */
.grunt-pg .grunt-pg-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--xl);
	line-height: 0.94;
	letter-spacing: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

/* ---- Reading column and sections ----------------------------------------- */

.grunt-pg-prose > * {
	margin-block: 0 16px;
}

.grunt-pg-prose > :last-child {
	margin-bottom: 0;
}

/* Text runs at the 66ch measure; sections, tiles, grids and media take the
   full width. */
.grunt-pg-prose > :is(p, ul, ol, h3, h4, h5, h6, blockquote, pre),
.grunt-pg-prose > section.wp-block-group > :is(p, ul, ol, h3, h4) {
	max-width: 66ch;
}

.grunt-pg-prose p,
.grunt-pg-prose li {
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.62;
}

.grunt-pg-prose > ul,
.grunt-pg-prose > ol {
	padding-left: 1.2em;
}

/* A section starts with a 2px rule on its heading: 8px from the rule to the
   heading, the tile padding below it (R2 .tpl-bandhead). Any h2 in page
   content is a section heading, so imported content takes the same shape.
   A single event's "Accessibility for this event" heading (grunt-core
   events.php) takes it too (Alanna, 2026-11-09); three classes, so the event
   column's .grunt-tpl .grunt-prose > * max-width never narrows its rule.
   An h2 typed in a single event's own text is a section heading as on
   every other page (Alanna, 2026-11-10); three classes and the element, so
   it outranks events.css's reading-column heading spacing. */
.grunt-pg-prose h2:not(.grunt-pg-label),
.grunt-hub-list > .grunt-hub-list__head,
.grunt-event-access > .grunt-prose > .grunt-event-access__heading,
.grunt-tpl .grunt-prose.grunt-event-body h2 {
	border-top: var(--wp--custom--border-w) solid var(--wp--preset--color--text);
	padding: 8px 0 0;
	margin: calc(var(--tpy) * 1.5) 0 var(--tpy);
	max-width: none;
	font-size: var(--wp--preset--font-size--h-4-fluid);
	line-height: 1.04;
}

.grunt-pg-prose > h2:first-child,
.grunt-pg-prose > section:first-child > h2:first-child,
.grunt-tpl .grunt-prose.grunt-event-body > h2:first-child,
.grunt-tpl .grunt-prose.grunt-event-body > section:first-child > h2:first-child {
	margin-top: var(--tpy);
}

/* A rule typed right before a section heading (imported content, AEP)
   would sit on the heading's own rule as a double line. Browsers without
   :has() keep both. */
.grunt-pg-prose hr:has(+ h2:not(.grunt-pg-label)),
.grunt-tpl .grunt-prose.grunt-event-body hr:has(+ h2) {
	display: none;
}

/* Person card names are h3s with their own spacing (People, below). */
.grunt-pg-prose h3:not(.grunt-pg-label, .grunt-person__name) {
	font-size: var(--wp--preset--font-size--lead);
	margin: var(--tpy) 0 9px;
}

.grunt-pg-prose > section > * {
	margin-block: 0 16px;
}

/* Small uppercase labels (the footer's heading style, on white). */
.grunt-pg .grunt-pg-label {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-muted);
	margin: 0 0 9px;
	border: 0;
	padding: 0;
}

/* ---- Tiles (sub-pages, Support actions) ---------------------------------- */

.grunt-hub-list {
	margin-block: var(--tpy);
}

.grunt-hub-tiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	/* At most three across (signed wireframes, sheets 06 and 08): the
	   track minimum never drops below a third of the row, so the 1248 page
	   cannot fit a fourth. Narrower, the 280px auto-fill steps as before. */
	grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 280px), calc((100% - 2 * var(--g)) / 3)), 1fr));
	gap: var(--g);
}

.grunt-hub-tile {
	position: relative;
	margin: 0;
	padding: var(--tpy) var(--tp);
	background: var(--wp--preset--color--bg);
	outline: 2px solid var(--wp--preset--color--panel-3);
	outline-offset: -2px;
	min-height: 44px;
}

/* Hover (Alanna, 2026-10-08): the tile takes the event rows' hover grey
   (the surface token), its outline turns black, and the title is not
   underlined. Only where a pointer hovers: iOS keeps :hover after a tap,
   which would leave the tile grey on coming back. Keyboard focus gets the
   same grey and the accent ring below. */
@media (hover: hover) {
	.grunt-hub-tile:hover {
		background: var(--wp--preset--color--surface);
		outline-color: var(--wp--preset--color--text);
	}
}

.grunt-hub-tile__link {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h-5-fluid);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: var(--wp--preset--color--text);
}

/* The whole tile is the link's target. */
.grunt-hub-tile__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.grunt-hub-tile__link:hover,
.grunt-hub-tile__link:focus-visible {
	color: var(--wp--preset--color--accent);
}

/* Keyboard focus rings the whole tile; a click or tap rings nothing. Only
   where :has() works; elsewhere the link keeps its own focus ring. */
@supports selector(:has(*)) {
	.grunt-hub-tile__link:focus-visible {
		outline: none;
	}

	.grunt-hub-tile:has(.grunt-hub-tile__link:focus-visible) {
		background: var(--wp--preset--color--surface);
		outline: 3px solid var(--wp--preset--color--accent);
		outline-offset: 2px;
	}
}

.grunt-hub-tile__arrow {
	position: absolute;
	top: calc(var(--tpy) + 0.45em);
	right: var(--tp);
	color: var(--wp--preset--color--accent);
}

.grunt-hub-tile:has(.grunt-hub-tile__arrow) {
	padding-right: calc(var(--tp) + 24px);
}

.grunt-hub-tile__note {
	margin: 10px 0 0;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.5;
	color: var(--wp--preset--color--text-muted);
}

.grunt-pg-prose .grunt-hub-tile__note {
	font-size: var(--wp--preset--font-size--body-s);
}

/* ---- Visit & Access quick facts ------------------------------------------ */

.grunt-visit-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--g);
	padding: var(--tpy) 0;
	border-top: var(--wp--custom--border-w) solid var(--wp--preset--color--text);
}

.grunt-visit-facts > *,
.grunt-visit-facts__col > * {
	margin-block: 0;
}

/* The map above the address (Alanna, 2026-10-08): the column's width, 4:3,
   no border. */
.grunt-visit-facts__col > .grunt-visit-map {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	border: 0;
	margin-block: 12px;
}

.grunt-visit-facts__col > .grunt-pg-label:not(:first-child) {
	margin-top: var(--tpy);
}

.grunt-pg-prose p.grunt-visit-fact {
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
	line-height: 1.55;
	margin: 0 0 6px;
}

.grunt-pg-prose p.grunt-pg-link {
	margin: 10px 0 0;
	font-weight: 700;
}

/* Nothing in the facts band is bold except its headings: hours (grunt-core's
   grunt/hours, one line per day), address, facts and links (Alanna,
   2026-10-08). */
.grunt-pg-prose .grunt-visit-facts p.grunt-visit-fact,
.grunt-pg-prose .grunt-visit-facts p.grunt-pg-link,
.grunt-visit-facts a,
.grunt-visit-facts a .grunt-ext {
	font-weight: 400;
}

.grunt-pg-prose .grunt-hours {
	list-style: none;
	padding: 0;
	margin: 0 0 6px;
}

.grunt-pg-prose .grunt-hours li {
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
	line-height: 1.55;
	margin: 0;
}

@media (max-width: 640px) {
	.grunt-visit-facts {
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--tpy);
	}
}

/* ---- People (Staff & Board) ----------------------------------------------- */

.grunt-person-grid {
	display: grid;
	/* At most four across (signed wireframe, sheet 09); narrower, the
	   220px auto-fill steps as before. */
	grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 220px), calc((100% - 3 * var(--g)) / 4)), 1fr));
	gap: var(--g);
}

.grunt-person-grid > * {
	margin: 0;
}

.grunt-person {
	padding: var(--tpy) var(--tp);
	outline: 2px solid var(--wp--preset--color--panel-3);
	outline-offset: -2px;
}

.grunt-person > * {
	margin-block: 0;
}

.grunt-pg-prose .grunt-person__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.2;
	margin: 0 0 6px;
}

.grunt-person__name a {
	text-decoration-thickness: 1.5px;
}

.grunt-pg-prose .grunt-person__role {
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.5;
	color: var(--wp--preset--color--text-muted);
	margin: 0;
}

/* ---- Funders (About) ------------------------------------------------------ */

.grunt-about-funders__logos {
	display: flex;
	flex-wrap: wrap;
	gap: var(--g);
	align-items: center;
}

.grunt-about-funders__logos > * {
	margin: 0;
}

/* The logos take three quarters of the content column, left-aligned with
   the text (Alanna, 2026-10-08): about 900px at the 1200 column, so the
   1153px banner (live's 1200x400 file trimmed of its white margin, the
   largest source there is) is drawn below its own size. On a phone they
   span the column. When grunt sends one logo per funder, each image is
   drawn at its own size (up to the column) and they wrap. */
.grunt-about-funders__logos > :only-child {
	flex: 0 1 75%;
}

.grunt-about-funders__logos img {
	display: block;
	height: auto;
	max-width: 100%;
}

.grunt-about-funders__logos > :only-child img {
	width: 100%;
}

@media (max-width: 640px) {
	.grunt-about-funders__logos > :only-child {
		flex-basis: 100%;
	}
}

/* ---- Land acknowledgement (full page) ------------------------------------- */

.grunt-pg-prose p.grunt-pg-ack {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
}

/* ---- Accordion: native <details>, zero script (R2 accordion) -------------- */

.grunt-pg .wp-block-details {
	margin: 0 0 10px;
	max-width: none;
}

.grunt-pg .wp-block-details > summary {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	background: var(--wp--preset--color--surface);
	padding: 8px var(--tp);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.35;
	cursor: pointer;
	list-style: none;
}

.grunt-pg .wp-block-details > summary::-webkit-details-marker {
	display: none;
}

/* The marker follows the element's own state, so it cannot disagree with
   it. \FE0E keeps the triangle as text, not an emoji. */
.grunt-pg .wp-block-details > summary::before {
	content: "\25B6\FE0E";
	color: var(--wp--preset--color--accent);
	font-size: 14px;
	flex: none;
}

.grunt-pg .wp-block-details[open] > summary::before {
	content: "\25BE";
	font-size: 21px;
}

.grunt-pg .wp-block-details > summary:hover {
	background: var(--wp--custom--color--panel-2);
}

.grunt-pg .wp-block-details > :not(summary) {
	padding: 14px var(--tp) 0;
	margin: 0;
	max-width: calc(66ch + 2 * var(--tp));
}

.grunt-pg .wp-block-details > :last-child:not(summary) {
	padding-bottom: 18px;
}

/* ---- Call to action row (Submissions) ------------------------------------- */

.grunt-pg-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--g);
	padding: var(--tpy) var(--tp);
	outline: 2px solid var(--wp--preset--color--panel-3);
	outline-offset: -2px;
}

.grunt-pg-cta > * {
	margin: 0;
}

.grunt-pg .wp-block-button__link {
	text-decoration: none;
}

.grunt-pg .wp-block-button__link .grunt-ext {
	color: inherit;
}

/* ---- Newsletter on a white page (the footer's form, light) --------------- */

.grunt-pg .grunt-newsletter__lead {
	color: var(--wp--preset--color--text-muted);
	margin: 0;
}

.grunt-pg .grunt-newsletter__form input[type="email"] {
	border: 2px solid var(--wp--preset--color--border);
	border-right: none;
	background: #fff;
}

.grunt-pg .grunt-newsletter__submit {
	background: var(--wp--preset--color--button-ink);
	color: #fff;
	border-color: var(--wp--preset--color--button-ink);
}

.grunt-pg .grunt-newsletter__submit:hover:not(:disabled) {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: #fff;
}

.grunt-pg .grunt-newsletter__form :disabled {
	opacity: 0.6;
}

/* ---- Projects: archive cards and single ---------------------------------- */

.grunt-project-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--g);
}

.grunt-project-cards > li {
	margin: 0;
	display: flex;
}

.grunt-project-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	position: relative;
	outline: 2px solid var(--wp--preset--color--panel-3);
	outline-offset: -2px;
}

.grunt-project-card:hover {
	outline-color: var(--wp--preset--color--text);
}

/* One 4:5 box per card (R2 .pximg), so images line up across a row. A
   card with a picture draws it as the exhibition cards do: the box, the
   blurred copy and the inset picture are .grunt-card__img, __blur and
   __photo (exhibitions.css), so the two stay the same. Only the no-image
   box is styled here. */
.grunt-project-card__img--none {
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--text);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	/* No image: the title on the ink field (R2 past cards, no-image). */
	padding: 30px;
	text-align: center;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--wp--custom--color--panel-4);
	overflow-wrap: anywhere;
}

.grunt-project-card__body {
	padding: 18px var(--tp) 24px;
}

.grunt-project-card__body > * {
	margin: 0;
}

.grunt-project-card__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h-5-fluid);
	line-height: 1.08;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.grunt-project-card__title a {
	text-decoration: none;
	color: var(--wp--preset--color--text);
}

.grunt-project-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	/* Above the picture (.grunt-card__photo is z-index 1), so a tap on it
	   opens the project, as on the exhibition cards. */
	z-index: 2;
}

.grunt-project-card__title a:hover,
.grunt-project-card__title a:focus-visible {
	text-decoration: underline;
	color: var(--wp--preset--color--accent);
}

/* Keyboard focus rings the whole card; a click or tap rings nothing. Only
   where :has() works; elsewhere the link keeps its own focus ring. */
@supports selector(:has(*)) {
	.grunt-project-card__title a:focus-visible {
		outline: none;
	}

	.grunt-project-card:has(.grunt-project-card__title a:focus-visible) {
		outline: 3px solid var(--wp--preset--color--accent);
		outline-offset: 2px;
	}
}

.grunt-project-card__note {
	margin-top: 10px;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.5;
	color: var(--wp--preset--color--text-muted);
}

.grunt-pg-pagination {
	margin-top: var(--tpy);
	font-weight: 700;
}

@media (max-width: 900px) {
	.grunt-project-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.grunt-project-cards {
		grid-template-columns: minmax(0, 1fr);
	}

	/* No phone override for the no-image panel: it keeps the 4:5 box and
	   the title on the ink field in one column too, as in two and three
	   (Alanna, 2026-10-29; it was a 12px bar here). */
}

/* Single project: meta lines under the title, then the image, uncropped. */
.grunt-project-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 22px 0 0;
}

.grunt-project-meta > * {
	margin: 0;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
}

.grunt-pg .grunt-project-hero {
	margin: var(--tpy) 0;
}

/* The single project and single event pictures (events.css
   .grunt-event-image) share this rule. Below 800px, where the picture sits
   above the text, it is the full content width, the title's and the
   text's, whatever its shape, height from its own ratio (Alanna,
   2026-10-28; until then at most 600 x 750, from 2026-10-21). Left on the
   text column's edge. No width here, so the img's width attribute (the
   uploaded file's own) applies: a file narrower than the column is drawn
   at its own width, never stretched; any wider one fills the column. From
   800px it sits beside the text, at most 750px tall (below). Never cropped
   (promos carry text): object-fit contain, against the left edge. The
   `sizes` value matches (grunt-core includes/images.php, page-image). */
:is(.grunt-pg .grunt-project-hero, .grunt-tpl .grunt-event-image) img {
	display: block;
	/* Undo core's width: 100% so the width attribute applies again. */
	width: revert-layer;
	max-width: 100%;
	height: auto;
	/* Core writes the block's scale inline (object-fit: cover by default,
	   which would crop once the height cap binds). The templates set
	   "contain"; !important holds it for a copy of a template saved in the
	   Site Editor before that. */
	object-fit: contain !important;
	object-position: left top;
}

/* Single project and event: the featured picture, whatever its shape,
   sits in the right third of the page grid from 800px, top-aligned with
   the body text, which keeps the left two thirds. On an event it starts
   below the date, time and place, beside the body. Below 800px it stays
   above the text, the full content width (above) (Alanna, 2026-10-28:
   first for portrait and square pictures, from the mock of that day, then
   the same day for every picture; from 900px until later that day). A
   page without a featured picture is not a grid.
   - The page becomes a three-column grid; every other child spans it, so
     the head stays above and anything after the body (the event's
     Accessibility band) starts below both the picture and the text, never
     beside or under either.
   - Grid items do not collapse margins: the head's 16px would add to the
     row's top margin, and the body's first and last children's margins
     would add inside it, so those are zeroed. Picture and text share the
     gap the picture had above it before (project --tpy, event 32px).
   - The picture is the column's width, never wider than its file (the
     width attribute), at most 750px tall, never cropped. The enlarge
     button and any caption stay with it in the column. grunt-core's
     page-image `sizes` matches (includes/images.php).
   - A body that starts with a heading: the picture lines up with the
     first paragraph under it (below). */
@media (min-width: 800px) {
	.grunt-pg:has(> .grunt-project-hero),
	.grunt-tpl:has(> .grunt-event-image) {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: var(--g);
		align-items: start;
	}

	.grunt-pg:has(> .grunt-project-hero) > *,
	.grunt-tpl:has(> .grunt-event-image) > * {
		grid-column: 1 / -1;
		min-width: 0;
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-head,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-tpl-head {
		margin-bottom: 0;
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-project-hero,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-image {
		grid-column: 3;
		grid-row: 2;
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body {
		grid-column: 1 / span 2;
		grid-row: 2;
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-project-hero,
	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose {
		margin: var(--tpy) 0 0;
	}

	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-image,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body {
		margin: 32px 0 0;
	}

	/* A body that starts with a heading (h1 to h6, also first in a first
	   section): the picture's top edge is level with the top of the
	   capital letters on the first line of the first paragraph under the
	   heading, empty paragraphs passed over, not with the heading (Alanna,
	   2026-10-28). How far down that line is depends on how the heading
	   wraps, which CSS cannot pass from the text to the picture beside it
	   (assets/js/featured-align.js): the script sets has-heading-first and
	   --grunt-lead-in, the top of that line's letters box (the font's
	   ascent) below the top of the body. --grunt-cap-inset is the rest, the
	   ascent above the capitals: Inter's ascent is 1984 and its cap height
	   1490 of 2048 units (hhea and OS/2 of the vendored InterVariable), so
	   0.2412em, 4.34px at the 18px body size; measured in WebKit, the
	   capitals' top is 8.0px below the line box's top at 18/29.16px, the
	   half leading 3.69px plus this. Without the script the picture stays
	   level with the heading. Each rule repeats its base selector so it
	   outranks it. */
	.grunt-pg.has-heading-first,
	.grunt-tpl:has(> .grunt-event-image).has-heading-first {
		--grunt-cap-inset: calc((1984 - 1490) / 2048 * var(--wp--preset--font-size--body));
		--grunt-lead-shift: calc(var(--grunt-lead-in, 0px) + var(--grunt-cap-inset));
	}

	.grunt-pg.has-heading-first:has(> .grunt-project-hero) > .grunt-project-hero {
		margin-top: calc(var(--tpy) + var(--grunt-lead-shift));
	}

	.grunt-tpl:has(> .grunt-event-image).has-heading-first > .grunt-event-image {
		margin-top: calc(32px + var(--grunt-lead-shift));
	}

	/* Whatever is first in the body starts at the top of the text column,
	   level with the picture: no top margin of its own. A section heading
	   there has no rule of its own either; the rule runs over picture and
	   text (below). The event h2 selectors repeat the element so they
	   outrank the event body's section heading margin (above, near the
	   start of this file). */
	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose > :first-child,
	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose > section:first-child > h2:first-child,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > :first-child,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > h2:first-child,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > section:first-child > h2:first-child {
		margin-top: 0;
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose > :last-child,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > :last-child {
		margin-bottom: 0;
	}

	/* A body that starts with text: the picture's top is level with the
	   top of the first line's letters box, not the line's (the half
	   leading, (1.62 - 1.21)/2 of the 18px body size, Inter's ascent plus
	   descent being 1.21em; pages.css and events.css body text). */
	.grunt-pg:has(> .grunt-project-hero):has(> .grunt-pg-prose > :is(p, ul, ol):first-child) > .grunt-project-hero {
		margin-top: calc(var(--tpy) + (1.62 - 1.21) / 2 * var(--wp--preset--font-size--body));
	}

	.grunt-tpl:has(> .grunt-event-image):has(> .grunt-event-body > :is(p, ul, ol):first-child) > .grunt-event-image {
		margin-top: calc(32px + (1.62 - 1.21) / 2 * var(--wp--preset--font-size--body));
	}

	/* A project or event body that starts with a section heading (its 2px rule,
	   above): the rule runs the full content width, over the picture as
	   well as the text, as on a project without a picture, and the heading
	   and the picture both start just under it (the picture then moves
	   down to the first paragraph, has-heading-first, above). The rule is the page's own ::before, a grid row
	   of its own between the head and the picture and text; the heading
	   drops its border and the 8px under it, which moves to the picture
	   and the text (Alanna, 2026-10-28). Content is not touched: any
	   first-of-body h2, also inside a first section (imported content).
	   A single event (also a call or job) with a picture takes the same
	   treatment since its typed h2 became a section heading (theme 0.3.51,
	   Alanna, 2026-11-10), with the event's 32px above the rule. */
	.grunt-pg:has(> .grunt-project-hero):has(> .grunt-pg-prose > h2:first-child:not(.grunt-pg-label), > .grunt-pg-prose > section:first-child > h2:first-child:not(.grunt-pg-label))::before {
		content: "";
		grid-column: 1 / -1;
		grid-row: 2;
		margin-top: var(--tpy);
		border-top: var(--wp--custom--border-w) solid var(--wp--preset--color--text);
	}

	.grunt-pg:has(> .grunt-project-hero):has(> .grunt-pg-prose > h2:first-child:not(.grunt-pg-label), > .grunt-pg-prose > section:first-child > h2:first-child:not(.grunt-pg-label)) > :is(.grunt-project-hero, .grunt-pg-prose) {
		grid-row: 3;
		margin-top: 8px;
	}

	.grunt-tpl:has(> .grunt-event-image):has(> .grunt-event-body > h2:first-child, > .grunt-event-body > section:first-child > h2:first-child)::before {
		content: "";
		grid-column: 1 / -1;
		grid-row: 2;
		margin-top: 32px;
		border-top: var(--wp--custom--border-w) solid var(--wp--preset--color--text);
	}

	.grunt-tpl:has(> .grunt-event-image):has(> .grunt-event-body > h2:first-child, > .grunt-event-body > section:first-child > h2:first-child) > :is(.grunt-event-image, .grunt-event-body) {
		grid-row: 3;
		margin-top: 8px;
	}

	/* Under the rule, the picture lines up with the first paragraph
	   (has-heading-first, above). */
	.grunt-pg.has-heading-first:has(> .grunt-project-hero):has(> .grunt-pg-prose > h2:first-child:not(.grunt-pg-label), > .grunt-pg-prose > section:first-child > h2:first-child:not(.grunt-pg-label)) > .grunt-project-hero,
	.grunt-tpl.has-heading-first:has(> .grunt-event-image):has(> .grunt-event-body > h2:first-child, > .grunt-event-body > section:first-child > h2:first-child) > .grunt-event-image {
		margin-top: calc(8px + var(--grunt-lead-shift));
	}

	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose > h2:first-child:not(.grunt-pg-label),
	.grunt-pg:has(> .grunt-project-hero) > .grunt-pg-prose > section:first-child > h2:first-child:not(.grunt-pg-label),
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > h2:first-child,
	.grunt-tpl:has(> .grunt-event-image) > .grunt-event-body > section:first-child > h2:first-child {
		border-top: 0;
		padding-top: 0;
	}

	:is(.grunt-pg:has(> .grunt-project-hero) > .grunt-project-hero, .grunt-tpl:has(> .grunt-event-image) > .grunt-event-image) img {
		max-width: min(100%, 750px * var(--grunt-ratio, 100));
		max-height: 750px;
	}

	/* A portrait picture in the project body (below) is at most half the
	   text column; here that column is two of the three tracks,
	   (2 x (100cqw - 2g) - g) / 3, so half is that over 6. */
	.grunt-pg-project:has(> .grunt-project-hero) .grunt-pg-prose > figure:not(.alignwide, .alignfull) > :is(img, a > img).grunt-portrait {
		width: min(var(--grunt-portrait-w), (2 * (100cqw - 2 * var(--g)) - var(--g)) / 6);
	}

	.grunt-pg-project:has(> .grunt-project-hero) .grunt-pg-prose > p > :is(img, a > img).grunt-portrait {
		width: min(var(--grunt-portrait-w), (2 * (100cqw - 2 * var(--g)) - var(--g)) / 6, 33ch);
	}
}

/* Single project body: a portrait picture (taller than wide) sits on the
   left with the text beside it, from 600px; on a phone it stays above the
   text, as before. grunt's beta feedback (Oct 2026): "Can text wrap with
   the image on these pages? Particularly with vertical images." (Alanna,
   2026-10-26; as in the single exhibition body, exhibitions.css.)
   grunt-core (includes/body-images.php) marks the img .grunt-portrait and
   writes --grunt-portrait-w: its own width, at most 600 x 750 (the cap on
   the single picture above), so a small upload is never stretched.
   - An Image block's figure, or a captioned figure, floats whole, drawn at
     that width or half the column, whichever is less. The figure is
     min-content wide and the img's width has no %, so the figure measures
     the picture and the caption wraps to it.
   - A bare img typed into a paragraph (classic content), or its link,
     floats inside the paragraph, at most 33ch (half the 66ch measure).
   - Right instead of left when the editor aligned it right.
   - Text after it keeps its own column (a block formatting context), so a
     paragraph never runs under the picture; anything else (a heading,
     another picture, an embed) starts below it.
   A gallery's pictures are not direct children and never float. Click to
   enlarge keeps working: core's button sits inside the figure. */
@media (min-width: 600px) {
	.grunt-pg-project .grunt-pg-prose {
		display: flow-root;
	}

	.grunt-pg-project .grunt-pg-prose > figure:has(> img.grunt-portrait, > a > img.grunt-portrait):not(.alignwide, .alignfull),
	.grunt-pg-project .grunt-pg-prose > p > :is(img.grunt-portrait, a:has(> img.grunt-portrait)) {
		float: left;
		clear: both;
		margin: 6px 32px 20px 0;
	}

	/* !important over the width a classic [caption] writes inline (the
	   picture's own), so the caption follows the drawn picture. */
	.grunt-pg-project .grunt-pg-prose > figure:has(> img.grunt-portrait, > a > img.grunt-portrait):not(.alignwide, .alignfull) {
		width: min-content !important;
	}

	/* A paragraph holding a portrait starts below any earlier float, so it
	   has the full measure to share with its own picture. */
	.grunt-pg-project .grunt-pg-prose > p:has(> img.grunt-portrait, > a > img.grunt-portrait) {
		clear: both;
	}

	.grunt-pg-project .grunt-pg-prose > figure.alignright:has(> img.grunt-portrait, > a > img.grunt-portrait),
	.grunt-pg-project .grunt-pg-prose > p > :is(img.grunt-portrait.alignright, a:has(> img.grunt-portrait.alignright)) {
		float: right;
		margin: 6px 0 20px 32px;
	}

	.grunt-pg-project .grunt-pg-prose > figure:not(.alignwide, .alignfull) > :is(img, a > img).grunt-portrait {
		display: block;
		width: min(var(--grunt-portrait-w), (100cqw - 2 * var(--g)) / 2);
		max-width: none;
		height: auto;
	}

	.grunt-pg-project .grunt-pg-prose > p > :is(img, a > img).grunt-portrait {
		display: block;
		width: min(var(--grunt-portrait-w), (100cqw - 2 * var(--g)) / 2, 33ch);
		max-width: none;
		height: auto;
	}

	.grunt-pg-project .grunt-pg-prose > :is(figure, p):has(> img.grunt-portrait, > a > img.grunt-portrait) ~ :is(p, ul, ol, blockquote, h3, h4, h5, h6) {
		display: flow-root;
	}

	.grunt-pg-project .grunt-pg-prose > :is(figure, p):has(> img.grunt-portrait, > a > img.grunt-portrait) ~ :not(p, ul, ol, blockquote, h3, h4, h5, h6) {
		clear: both;
	}
}

/* On a phone a portrait stays above its text even when the editor aligned
   it (core floats .alignleft and .alignright at every width). */
@media (max-width: 599px) {
	.grunt-pg-project .grunt-pg-prose > :is(figure, p):has(> img.grunt-portrait, > a > img.grunt-portrait),
	.grunt-pg-project .grunt-pg-prose > p > :is(img.grunt-portrait, a:has(> img.grunt-portrait)) {
		float: none;
		margin-inline: 0;
	}

	/* A bare img in a text paragraph is inline once it stops floating; as
	   a block it sits above the text (as exhibitions.css does). */
	.grunt-pg-project .grunt-pg-prose > p > img.grunt-portrait {
		display: block;
	}
}

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

@media (max-width: 599px) {
	/* R2 mobile: the h1 drops to the h3 step. */
	.grunt-pg .grunt-pg-title {
		font-size: var(--wp--preset--font-size--h-3);
		line-height: 1.04;
	}

	.grunt-pg .grunt-pg-crumbs {
		margin-bottom: 24px;
	}
}

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

.grunt-pg-editor-box {
	padding: 18px;
	border: 2px dashed var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--body-s);
}

/* ---- Footer: link to the full land acknowledgement (M4c) ------------------ */

.grunt-footer p.grunt-ack-link {
	grid-column: 1 / 5;
	font-weight: 700;
}

@media (max-width: 640px) {
	.grunt-footer p.grunt-ack-link {
		grid-column: 1 / -1;
		padding: 0;
	}
}

/* ---- Lists (index, archive): title and excerpt per post ------------------ */

.grunt-pg-list-items {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: var(--wp--custom--border-w) solid var(--wp--preset--color--text);
}

.grunt-pg-list-items > li {
	margin: 0;
	padding: var(--tpy) 0;
	border-bottom: 1px solid var(--wp--preset--color--text);
}

.grunt-pg-list-items > li > * {
	margin-block: 0;
}

.grunt-pg .grunt-pg-list-title {
	font-size: var(--wp--preset--font-size--h-5-fluid);
	line-height: 1.08;
}

.grunt-pg .grunt-pg-list-title a {
	text-decoration: none;
}

.grunt-pg .grunt-pg-list-title a:hover {
	text-decoration: underline;
	color: var(--wp--preset--color--accent);
}

.grunt-pg .grunt-pg-list-excerpt {
	margin-top: 10px;
	max-width: 66ch;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--body-s);
}

.grunt-pg .grunt-pg-list-excerpt p {
	margin: 0;
}

/* ---- Body copy on phones (see style.css) ---------------------------------- */

/* Same selectors as the prose rules above, so only they step down. Link
   lines (.grunt-pg-link) keep 18px; hub tiles keep it too, because each
   tile's arrow is placed in em from the tile. */
@media (max-width: 599px) {
	.grunt-pg-prose p:where(:not(.grunt-pg-link)),
	.grunt-pg-prose li:where(:not(.grunt-hub-tile)),
	.grunt-pg-prose p.grunt-visit-fact,
	.grunt-pg-prose .grunt-hours li {
		font-size: var(--wp--preset--font-size--body-s);
	}
}
