/*
 * pm-showcase-band — the showcase band on the product family pages (WO-120).
 *
 * Source frame: docs/design/frames/118-product-page-sections.json#showcases,
 * node 369:3408 — a 944-high block on the page's own light ground between the
 * models section and the designer's stuck-together CTA-band / FAQ-band /
 * footer trio: a CENTRED eyebrow (110), ONE full-bleed row of three equal
 * cards 8px apart (658), and a centred underlined "Our Showcases" link (176).
 * 110 + 658 + 176 = 944.
 *
 * Compiled to assets/css/components/showcase-band.css by src/build-tokens.mjs,
 * which substitutes the breakpoint markers (a comment holding `@bp <name>`)
 * with the pixel value from tokens/tokens.json. Never type a breakpoint width
 * here.
 *
 * Every colour is a --pm-color-* token. No hex value and no literal
 * breakpoint width may appear in this file.
 *
 * NONE of the three parts' heights is typed. They are consequences:
 *   110 = 48 (--pm-space-12) + the eyebrow's own 14 + 48
 *   658 = the cards' aspect-ratio at 1440, where three cards and two 8px
 *         gaps fill the viewport and each card is (1440 − 16) / 3 = 474.667
 *         wide (the ratio travels inline in --pm-card-ratio, written by
 *         GalleryCard::render_card)
 *   176 = 64 (--pm-space-16) + the tertiary button's own 48 + 64
 * So the band holds the frame at 1440 and scales with the viewport instead of
 * holding three numbers that only one width can satisfy.
 *
 * Three components render inside this band and NONE of them is restyled here:
 * the cards are gallery-card.css's (WO-12), the eyebrow is
 * section-header.css's (WO-28) and the link is button.css's tertiary (WO-74,
 * WO-81). This file keeps only the band's own layout. There is deliberately
 * not one selector below that reaches a .pm-gallery-card__*,
 * .pm-section-header__* or .pm-button--* class — WO-120 says the card is not
 * ours to change, and the same restraint applies to the other two.
 */

/*
 * The band itself stays on the page measure — the scaffold stylesheet
 * (style.css:21) constrains body to a centred 72rem column — because AC 2
 * says the ROW is full bleed while "the header and the link stay centred on
 * the page". Only __row escapes, below.
 *
 * That reproduces the frame's x positions exactly rather than approximately.
 * At a 1440 viewport the scaffold's content box is 72rem − 2 × 32 = 1088,
 * centred, so its centre is 720 — the same centre as the 1440 frame. The
 * eyebrow block is 40 + 16 + 72 = 128 wide, so centring puts it at
 * 720 − 64 = 656, the frame's #showcases.header.eyebrow.container.x. The link
 * is 98 wide, so centring puts it at 720 − 49 = 671, the frame's
 * #showcases.view_more.link.x. Neither number is typed anywhere.
 *
 * No background: body already carries --pm-color-surface (style.css:21), and
 * the frame's ground here is "surface (the page's own light ground) — NOT the
 * ink the FAQ band uses" (#showcases.background). Painting it again would
 * claim a ground this band does not own.
 *
 * NO MARGIN ANYWHERE IN THIS FILE, and that is AC 6. The band is inserted
 * ABOVE the CTA band on pages whose FAQ-band-to-footer seam the client
 * specifically asked to be 0 and which WO-119 had just fixed, from the
 * component, with `margin-bottom: calc(-1 * var(--pm-space-12))` on
 * .pm-faq-band (faq-band.css). That cancel depends on the FAQ band being the
 * LAST in-flow child of <article>, so that the scaffold's
 * `article { margin-bottom: var(--pm-space-12) }` (style.css:26) — which
 * collapses through <main> — is what it meets. Inserting a section above it
 * changes nothing about that relationship: this band is a sibling EARLIER in
 * the flow, it declares no bottom margin that could collapse with the CTA
 * band's top (the CTA band has none either), and it cannot reach the seam.
 * Measured both sides before and after; see docs/reviews/120-dev.md.
 */
.pm-showcase-band {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/*
 * The header (#showcases.header — 110 high, eyebrow only, centred). The
 * eyebrow container sits at y48 and is 14 high, so 48 + 14 + 48 = 110 and the
 * 48 is --pm-space-12 on both edges. The eyebrow's own 14 is
 * section-header.css's 12px caption at its normal leading — not set here.
 *
 * The centring is the section-header pattern's own `--center` modifier, which
 * ShowcaseBand.php asks for with `align => 'center'`; this rule only supplies
 * the band's padding and lets the pattern fill the width it needs to centre
 * in.
 */
.pm-showcase-band__head {
	padding-block: var(--pm-space-12);
}

/*
 * The row (#showcases.row — y110, 1440 wide, 658 high, full_bleed: true,
 * gap 8).
 *
 * AC 2 — FULL BLEED, with the same technique every other full-bleed component
 * on this site uses, unchanged: `width: 100vw` plus
 * `margin-inline: calc(50% - 50vw)` (hero.css, intro.css, products.css,
 * models.css, deliver.css, partners.css, services.css, team.css, legal.css,
 * contact.css, showcase-rows.css and faq-band.css all carry exactly this
 * pair). The percentage resolves against .pm-showcase-band's content box —
 * the page measure — so at 1440 it is 544 − 720 = −176 a side, the row's left
 * edge lands on 0 and its right on 1440.
 *
 * ONE ROW, AND THE ROW DOES NOT CARE HOW MANY CARDS THERE ARE.
 * `grid-auto-flow: column` with `grid-auto-columns: minmax(0, 1fr)` gives N
 * equal implicit columns in a single row for whatever N the count control
 * (AC 4) produced, so the count lives in exactly one place — the PHP — and
 * never has to be mirrored into an inline custom property or a track list
 * here. minmax(0, …) rather than 1fr so a long unbroken Dutch title cannot
 * push a card past its track (MISTAKES.md §E4 — Dutch runs 20-30% longer).
 *
 * The 8px gutter is --pm-space-2, the frame's #showcases.row.gap, the same
 * token showcase-rows.css and showcase-grid.css use for the same gutter.
 * --pm-color-surface shows through it: the row is full bleed and the scaffold
 * body's surface stops at the page measure, so WITHOUT this the gutters and
 * the bleed margins would show whatever is behind the body box. This is the
 * one colour this file needs, and it is the ground the extract names
 * (#showcases.background).
 *
 * The frame's hidden sibling 55:1573 — an alternate tall/square composition —
 * is NOT built, here or in the widget (AC 4, MISTAKES.md §G15: a hidden
 * element tells you nothing about what it would be).
 */
.pm-showcase-band__row {
	box-sizing: border-box;
	width: 100vw;
	margin-inline: calc(50% - 50vw);
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: var(--pm-space-2);
	background-color: var(--pm-color-surface);
}

/*
 * A card slot. The card carries its own ratio (--pm-card-ratio, written
 * inline by GalleryCard::render_card) and its own overflow; min-width: 0 is
 * the wrap guard that lets a long Dutch title wrap instead of widening the
 * track (MISTAKES.md §E4, showcase-rows.css's own slot rule).
 */
.pm-showcase-band__slot {
	min-width: 0;
}

/*
 * The view-more row (#showcases.view_more — y768, 176 high, the link at y64,
 * 48 high, centred and underlined). 64 is --pm-space-16, and 64 + 48 + 64 =
 * 176: the height is the padding plus the button's own geometry, not a value.
 *
 * This is pm-showcase-grid's `__more` row (showcase-grid.css:344-349) — the
 * same 176-high centred tertiary, from 34-showcases.json#view_more — written
 * as this band's own class because that file is not this ticket's to touch.
 * It differs in one way and deliberately: that one types `min-height: 176px`,
 * this one reaches 176 from the --pm-space-16 token plus the button, so a
 * token change moves it and a long wrapped Dutch label grows it instead of
 * sitting in a fixed box.
 */
.pm-showcase-band__more {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: var(--pm-space-16);
}

/*
 * AC 8 — responsive. The frame gives 1440 only
 * (#showcases.box — width 1440) and there is no mobile design.
 *
 * TODO(open-question): below the laptop breakpoint the frame gives nothing
 * (#open_questions, WO-120 open question 2, MISTAKES.md §C7). This follows
 * THE HOUSE PATTERN FOR A THREE-ACROSS CARD ROW, unchanged and not invented:
 * showcase-grid.css:281,321-331 lays its cards out `repeat(3, 1fr)` with the
 * same `gap: var(--pm-space-2)` and collapses to `repeat(2, 1fr)` below the
 * laptop breakpoint and `1fr` below tablet. Three to two to one, at laptop
 * and tablet, is therefore what this band does — and it is the collapse
 * Rest\Showcases::sizes_attribute() already describes to the browser
 * (33vw / 50vw / 100vw against the same two breakpoints), which is why the
 * widget reuses that helper rather than writing a second hint. Owner: the
 * designer, with the missing mobile design.
 *
 * `grid-auto-flow: row` must be restored with the track list: the base rule's
 * `column` flow would otherwise keep filling columns and the two-track
 * template would be ignored. The cards keep their aspect ratio, so a wider
 * card is a taller card and the row's height follows — there is no height
 * here to contradict it.
 */
@media (max-width: 1024px) {
	.pm-showcase-band__row {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.pm-showcase-band__row {
		grid-auto-flow: row;
		grid-template-columns: minmax(0, 1fr);
	}
}
