/*
 * Home featured project band (grunt-core's grunt/featured-project).
 *
 * Never drawn in a comp: built from the written spec (docs repo
 * design-system/components.md, featured-project-band: section-label +
 * project-card + button) out of parts the Round 2 Home already uses, so it
 * reads as native:
 *   - the band: white, no heading of its own (Alanna, 2026-10-07: the band
 *     heading was dropped); the project title is the band's h2, under a
 *     "Featured project" label in the comps' .kicker style (the Home
 *     announcement tile's label, in ink here)
 *   - the tile: the picture crops to fill its half (object-fit: cover,
 *     centred; Alanna, 2026-10-08, a second deliberate exception to the
 *     signed whole-image rule after the shop tiles), with no outline round
 *     it; the words box carries the cards' 2px panel-3 rule (--tile-rule)
 *     on its three sides that do not meet the picture, as the Past
 *     exhibitions cards (Alanna, 2026-10-08)
 *   - the button: the comps' .btn (.grunt-mosaic .grunt-btn); an outside
 *     site gets the ↗ cue, which takes the button's colour there as on
 *     Home's Donate button
 * Sizes are tokens and cqw against the page container, never vw.
 */

.grunt-featured {
	background: var(--wp--preset--color--bg);
	padding: var(--tpy) 0;
}

/* Four tracks on the mosaic gutter (as the Home rows): picture on the
   first two, words on the other two. */
.grunt-featured__tile {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	background: var(--wp--preset--color--bg);
}

/* The picture box: 4:3 at least (the ::before strut), and as tall as the
   words beside it when they run longer; the picture covers it. The ink
   shows only while the file loads. */
.grunt-featured__media {
	grid-column: 1 / 3;
	margin: 0;
	position: relative;
	background: var(--wp--preset--color--text);
	overflow: hidden;
}

.grunt-featured__media::before {
	content: "";
	display: block;
	padding-top: 75%;
}

.grunt-featured__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
}

/* The rule on the three sides away from the picture (top, right, bottom
   here; the picture is on the left). Padding less the rule keeps the words
   where they sat inside the old inset outline. */
.grunt-featured__body {
	grid-column: 3 / -1;
	padding: calc(var(--tpy) - var(--tile-rule-w)) calc(var(--tp) - var(--tile-rule-w)) calc(var(--tpy) - var(--tile-rule-w)) var(--tp);
	border: var(--tile-rule);
	border-left: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

/* No picture: the words box is the whole tile, ruled all round. */
.grunt-featured__tile--noimage .grunt-featured__body {
	grid-column: 1 / -1;
	padding-left: calc(var(--tp) - var(--tile-rule-w));
	border-left: var(--tile-rule);
}

.grunt-featured__body > * {
	margin: 0;
}

/* The comps' .kicker. */
.grunt-mosaic .grunt-featured__kicker {
	margin-bottom: 10px;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.grunt-featured__title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--h-4-fluid);
	line-height: 1.04;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.grunt-mosaic .grunt-featured__line {
	margin-top: 14px;
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* The project page's first paragraph: running text, so body size. */
.grunt-mosaic .grunt-featured__excerpt {
	margin-top: 14px;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.5;
	overflow-wrap: break-word;
}

.grunt-mosaic .grunt-featured__cta {
	margin-top: 24px;
}

/* A long label wraps inside the button instead of running past the tile. */
.grunt-featured__cta .grunt-btn {
	max-width: 100%;
	overflow-wrap: anywhere;
}

/* 900 and under (where the Home rows and heroes reflow too): one column,
   the 4:3 picture over the words, so a long first paragraph never squeezes
   the picture into a tall strip beside it; the rule moves to the words
   box's left, right and bottom (the picture is above). */
@media (max-width: 900px) {
	.grunt-featured__tile {
		grid-template-columns: minmax(0, 1fr);
	}

	.grunt-featured__media,
	.grunt-featured__body {
		grid-column: 1 / -1;
	}

	.grunt-featured__body {
		padding: var(--tpy) calc(var(--tp) - var(--tile-rule-w)) calc(var(--tpy) - var(--tile-rule-w));
		border: var(--tile-rule);
		border-top: 0;
	}

	.grunt-featured__tile--noimage .grunt-featured__body {
		padding-top: calc(var(--tpy) - var(--tile-rule-w));
		border-top: var(--tile-rule);
	}
}

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

@media (max-width: 599px) {
	.grunt-mosaic .grunt-featured__excerpt {
		font-size: var(--wp--preset--font-size--body-s);
	}
}
