/*
 * Post-Header — the showcase family's shared layer (divb-hq#302).
 *
 * Ten stages for the few big articles. They share the stage, its scrim, the type and the
 * hand-over into the text column; each design's own sheet holds only its layout and its motion.
 * Enqueued for `Mf_Post_Header_Renderer::SHOWCASE_VARIANTS`, between `mfph-base` and the
 * design's sheet — the Business family's place in the cascade.
 *
 * NO WEBFONT IS FETCHED. The serif and the sans are named, so a theme that self-hosts them is
 * used, and everything else falls back to the system stack.
 *
 * **The scrim sits on the text block, not on the stage, and that is the readability rule**
 * (docs/SPEC-post-header-showcase.md §5). Where the text lands on the picture depends on the
 * design, the viewport and the focal point, and a picture's brightness says nothing about the
 * spot under the kicker: the dark test picture has spots as bright as the bright one's. So the
 * text block carries a gradient that is dark enough behind its own content for white type on a
 * WHITE picture, and its top padding is the room the gradient fades in. `quarterly-cover`
 * learned the same thing first.
 *
 * **The stage is a one-cell grid.** The picture is absolutely placed in it, the text is a grid
 * item, so a stage can never be shorter than its text: on a narrow phone the text grows the stage
 * instead of hanging above it.
 *
 * Motion lives in each design's sheet, inside `@supports (animation-timeline: view())`, and only
 * ever moves AWAY from the readable, visible state. Without support (Firefox today) or with
 * reduced motion, every design is its still frame, and the still frame is built to stand alone.
 */

.mfph-header.mfph-sc {

	/* The theme's sticky site header, measured on the live blog on 2026-10-29: 75.3px at 1280
	   and 900, 72px at 700 and 390 (the navigation collapses in between). */
	--mfph-site-header: 75px;
	--mfph-sc-stage: max(420px, calc((100svh - var(--mfph-site-header)) * 0.88));
	--mfph-sc-navy: #0b1a33;
	--mfph-sc-ink: #111;
	--mfph-sc-muted: #555b66;
	--mfph-sc-blue: #1d4f99;
	--mfph-sc-orange: #e35205;
	--mfph-sc-paper: #fff;
	--mfph-sc-scrim: 6, 15, 32;

	/* stylelint-disable-next-line max-line-length */
	--mfph-sc-sans: inter, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, helvetica, arial, sans-serif;
	--mfph-sc-serif: fraunces, georgia, "Times New Roman", serif;
	--mfph-sc-gutter: max(24px, calc(50% - 560px));
	--mfph-sc-meta-gap: 10px;

	margin: 0 0 8px;
	color: var(--mfph-sc-ink);
	font-family: var(--mfph-sc-sans);
}

:root:root:root:root .mfph-header.mfph-sc {
	color: var(--mfph-sc-ink);
}

/* ---- The stage ------------------------------------------------------------------------- */

.mfph-sc__stage {
	position: relative;
	display: grid;
	min-height: var(--mfph-sc-stage);
	overflow: hidden;
	background: var(--mfph-sc-navy);
	isolation: isolate;
}

.mfph-sc__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
}

/* Three classes: the crop-free ground rule in base.css (`.mfph-header .mf-uncropped`) is
   not involved — the stage image never carries that class — but a theme's `img` rules are. */
.mfph-header.mfph-sc .mfph-sc__img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

.mfph-sc__bg .mfph-sc__img {
	position: absolute;
	inset: 0;
}

/* The text block: at the stage's bottom, with the scrim that guarantees it. 0.68 behind every
   line of the content is what white 12.5px type needs on a white picture: measured on the
   rendered page with the bright test picture (pencils on white), the brightest background next
   to the kicker is 6.0:1 against white, the title's 6.9:1. The 160px of top padding is where the
   scrim fades in, in two steps, so a bright picture shows no seam where it starts.

   **The scrim is a layer of its own (`::before`), not the block's background**, so a design can
   move the type without moving the darkness: animating the whole block made the scrim rise with
   the title, faster than the picture behind it (Tom, 01, in all three browsers). A design that
   moves its text animates `.mfph-sc__text > *`; the scrim follows the picture, or the stage. */
.mfph-sc__text {
	--mfph-sc-scrim-top: rgba(var(--mfph-sc-scrim), 0);
	--mfph-sc-scrim-mid: rgba(var(--mfph-sc-scrim), 0.3);
	--mfph-sc-scrim-text: rgba(var(--mfph-sc-scrim), 0.68);
	--mfph-sc-scrim-foot: rgba(var(--mfph-sc-scrim), 0.9);

	position: relative;
	align-self: end;
	padding: 160px var(--mfph-sc-gutter) 44px;
	color: #fff;
	isolation: isolate;
}

:root:root:root:root .mfph-sc__text {
	color: #fff;
}

.mfph-sc__text::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: "";

	/* stylelint-disable-next-line max-line-length */
	background: linear-gradient(0deg, var(--mfph-sc-scrim-foot) 0%, var(--mfph-sc-scrim-text) calc(100% - 160px), var(--mfph-sc-scrim-mid) calc(100% - 70px), var(--mfph-sc-scrim-top) 100%);
	pointer-events: none;
}

/* ---- Type ------------------------------------------------------------------------------ */

.mfph-sc__kicker {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	align-items: center;
	margin: 0 0 14px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mfph-sc__kicker::before {
	content: "";
	flex: 0 0 auto;
	width: 28px;
	height: 3px;
	background: var(--mfph-sc-orange);
}

.mfph-header.mfph-sc .mfph-sc__title {
	max-width: 20ch;
	margin: 0;
	font-family: var(--mfph-sc-serif);
	font-size: clamp(30px, 5.2vw, 62px);
	font-weight: 600;
	line-height: 1.06;
	letter-spacing: -0.01em;
	color: inherit;
	text-wrap: balance;
}

:root:root:root:root .mfph-header.mfph-sc .mfph-sc__title {
	color: inherit;
}

/* The meta line is the Business family's markup (`Mf_Post_Header_Biz::meta()`), so every rule
   that family's sheet sets is restated here: in the picker both sheets load, and the tile must
   look like the front end. */
.mfph-header.mfph-sc .mfph-biz__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px var(--mfph-sc-meta-gap);
	align-items: center;
	margin: 18px 0 0;
	font-size: 14px;
	color: inherit;
}

:root:root:root:root .mfph-header.mfph-sc .mfph-biz__meta {
	color: inherit;
}

.mfph-header.mfph-sc .mfph-biz__meta b {
	font-weight: 600;
	color: inherit;
}

:root:root:root:root .mfph-header.mfph-sc .mfph-biz__meta b {
	color: inherit;
}

/* The role is its own flex item after the name and belongs to it: a word space, not the gap. */
.mfph-header.mfph-sc .mfph-biz__role {
	margin-left: calc(0.3em - var(--mfph-sc-meta-gap));
}

.mfph-header.mfph-sc .mfph-biz__sep {
	color: inherit;
	opacity: 0.5;
}

:root:root:root:root .mfph-header.mfph-sc .mfph-biz__sep {
	color: inherit;
}

.mfph-header.mfph-sc .mfph-biz__sep::before {
	content: "|";
}

/* ---- After the stage: the lead, then the ad slot, in the text column ------------------- */

.mfph-sc__after {
	box-sizing: content-box;
	max-width: var(--wp--style--global--content-size, 800px);
	margin: 0 auto;
	padding-right: var(--wp--style--root--padding-right, 24px);
	padding-left: var(--wp--style--root--padding-left, 24px);
}

.mfph-sc__lead {
	margin: 24px 0 0;
	font-size: clamp(18px, 1.6vw, 21px);
	line-height: 1.5;
	color: var(--mfph-sc-ink);
}

:root:root:root:root .mfph-sc__lead {
	color: var(--mfph-sc-ink);
}

.mfph-sc__slot {
	margin-top: 24px;
}

/* The lead beside the title: on the stage, white on the scrim, or in 03's head on paper. A
   design with the lead on the stage also prints it under the stage for a phone, and exactly one
   of the two is displayed at any width — `display: none` is what keeps a screen reader from
   reading it twice. */
.mfph-header.mfph-sc .mfph-sc__lead--stage,
.mfph-header.mfph-sc .mfph-sc__lead--head {
	max-width: 58ch;
	margin: 16px 0 0;
	font-size: clamp(16.5px, 1.55vw, 20px);
}

.mfph-header.mfph-sc .mfph-sc__lead--stage {
	color: rgba(255, 255, 255, 0.92);
}

:root:root:root:root .mfph-header.mfph-sc .mfph-sc__lead--stage {
	color: rgba(255, 255, 255, 0.92);
}

.mfph-header.mfph-sc .mfph-sc__lead--head {
	color: #2a2f3a;
}

:root:root:root:root .mfph-header.mfph-sc .mfph-sc__lead--head {
	color: #2a2f3a;
}

.mfph-header.mfph-sc .mfph-sc__lead--phone {
	display: none;
}

/* ---- Phones ---------------------------------------------------------------------------- */

@media (max-width: 781px) {

	.mfph-header.mfph-sc {
		--mfph-site-header: 72px;
		--mfph-sc-gutter: 20px;
		--mfph-sc-meta-gap: 14px;
	}

	.mfph-sc__text {
		padding-bottom: 28px;
	}

	.mfph-header.mfph-sc .mfph-biz__meta {
		row-gap: 2px;
	}

	.mfph-header.mfph-sc .mfph-biz__sep {
		display: none;
	}

	.mfph-header.mfph-sc .mfph-sc__lead--stage {
		display: none;
	}

	.mfph-header.mfph-sc .mfph-sc__lead--phone {
		display: block;
	}
}

/* ---- The picker's tiles: still frames at a fixed height -------------------------------- */

/* A tile is a scaled header inside the modal's scroller, where a view() timeline would animate
   with the modal and 100svh would be the editor's height. */
.mfph-preview .mfph-header.mfph-sc {
	--mfph-sc-stage: 560px;
}

.mfph-preview .mfph-sc *,
.mfph-preview .mfph-sc *::before,
.mfph-preview .mfph-sc *::after {
	animation: none !important;
}
