/* Label: Hero */
/*
 * The standard page hero (prototype "page-hero" on every page but Home, Statement and Article; cmc.css §3b).
 * Pattern cmc/hero (patterns/hero.php):
 *
 *   core/group      backing  {"align":"full","className":"section-page-hero is-style-section","backgroundColor":"white",
 *                             "layout":{"type":"default"}}   the prototype's hero corners show the page: white
 *                             (off-white on Contact)
 *     core/group    surface  {"tagName":"section","className":"is-style-hero","layout":{"type":"constrained"}}  ← this file
 *       core/group  copy     {"layout":{"type":"constrained","contentSize":"563px","justifyContent":"left"}}
 *                             contentSize = the prototype's max-w-[…] on that page (Methodology 563, About 700 …)
 *         core/paragraph     {"className":"is-style-eyebrow-rule","style":{"spacing":{"margin":{"bottom":"25px"}}}}
 *         core/heading       {"level":1,"fontSize":"text-1","style":{"typography":{"letterSpacing":"-1.97px"}}}
 *                             the design's desktop-only line break = <br class="is-desktop-only"> (global.css)
 *
 * The decoration is CSS on the surface (its background and two pseudo-elements, below), so the editor only holds the
 * copy and the decoration shows in the editor too.
 * Padding 145 / 70 (50 below 1024) and min-height max(50vh, 600px) live here: padding set on the surface in the
 * editor wins (Contact: bottom 25).
 */

/* The backing (no padding) is the query container, so 100cqw = the hero's width: the canvas is sized off it. */
.wp-block-group:has(> .wp-block-group.is-style-hero) {
	container-type: inline-size;
}

.wp-block-group.is-style-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: max(50vh, 600px);
	padding-top: 145px;
	padding-bottom: 50px;
	background-color: var(--wp--preset--color--coral);
}

/* Flex items with auto side margins (the constrained layout's) would shrink to their content: keep the copy full width. */
.wp-block-group.is-style-hero > * {
	width: 100%;
}

@media (width >= 1024px) {
	.wp-block-group.is-style-hero {
		padding-bottom: 70px;
	}
}

/* Every line break in the design's hero copy is desktop-only (<br class="hidden lg:inline">), so a <br> in the hero
   copy is hidden below 1024: content made with createBlock loses the is-desktop-only class (About, Report, Committee).
   Not the Home typewriter, whose <br>s separate its lines. */
@media (width < 1024px) {
	.wp-block-group.is-style-hero :is(h1, h2, p):not(.is-style-typewriter) br {
		display: none;
	}
}

/*
 * The decoration, in the prototype's layer order (cmc.css §3b), bottom to top, under the copy:
 *   ::before  the 4x4 mesh (.hero-mesh) in the design's 1440x870 canvas, cropped by the hero: width 100%,
 *             height max(100%, 870/1440 of the width) (.hero-canvas: aspect-ratio + min-height 100%)
 *   ::after   the arc mark (.hero-logo img: full width at its own height, top 18.161% of the canvas), under the white
 *             band behind the menu (.hero-white-top: 168px, white to clear, at 75%). The box runs from the top of the
 *             hero to the bottom of the arc mark, which is drawn at its bottom edge.
 * The surface stays coral underneath, as the prototype's section: it is what the rounded corners' edge pixels blend.
 * The mesh is the prototype's with its animation dropped (plan §8). Every colour is a palette token written in OKLCH
 * (cmc.css :root -l/-c/-h at hue offset 0): OKLCH stops make the gradients interpolate in oklab, as the design does.
 * The band's 75% white is written out: opacity on the box would fade the arc mark too.
 */
.wp-block-group.is-style-hero::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	left: 0;
	width: 100%;
	aspect-ratio: 1440 / 870;
	min-height: 100%;
	pointer-events: none;
	background-color: oklch(0.8267 0.0849 39.8);
	background-image:
		/* row 0 — pale, and geometrically FIXED: this is the band behind the menu */
		radial-gradient(70% 46% at 0.0% 0.0%,
		  oklch(0.9405 0.0265 41.1) 0%,
		  oklch(0.9405 0.0265 41.1 / 0) 100%),
		radial-gradient(54% 40% at 33.33% 0.0%,
		  oklch(0.9405 0.0265 41.1) 0%,
		  oklch(0.9405 0.0265 41.1 / 0) 100%),
		radial-gradient(58% 46% at 66.67% 0.0%,
		  oklch(0.9528 0.0046 78.3) 0%,
		  oklch(0.9528 0.0046 78.3 / 0) 100%),
		radial-gradient(62% 48% at 100.0% 0.0%,
		  oklch(0.9771 0.0034 67.8) 0%,
		  oklch(0.9771 0.0034 67.8 / 0) 100%),
		/* row 2 — drifts */
		radial-gradient(38% 30% at 0.0% 75.42%,
		  oklch(0.8267 0.0849 39.8) 0%,
		  oklch(0.8267 0.0849 39.8 / 0) 100%),
		radial-gradient(46% 38% at 73.71% 76.77%,
		  oklch(0.7223 0.1465 39.8) 0%,
		  oklch(0.7223 0.1465 39.8 / 0) 100%),
		radial-gradient(44% 38% at 100.0% 66.67%,
		  oklch(0.7223 0.1465 39.8) 0%,
		  oklch(0.7223 0.1465 39.8 / 0) 100%),
		/* row 3 — drifts */
		radial-gradient(48% 36% at 0.0% 100.0%,
		  oklch(0.7223 0.1465 39.8) 0%,
		  oklch(0.7223 0.1465 39.8 / 0) 100%),
		radial-gradient(46% 36% at 24.48% 100.0%,
		  oklch(0.7223 0.1465 39.8) 0%,
		  oklch(0.7223 0.1465 39.8 / 0) 100%),
		radial-gradient(52% 40% at 66.67% 100.0%,
		  oklch(0.7223 0.1465 39.8) 0%,
		  oklch(0.7223 0.1465 39.8 / 0) 100%),
		radial-gradient(46% 38% at 100.0% 100.0%,
		  oklch(0.8267 0.0849 39.8) 0%,
		  oklch(0.8267 0.0849 39.8 / 0) 100%);
}

.wp-block-group.is-style-hero::after {
	--hero-logo-top: max(18.161%, 100cqw * 0.18161 * 870 / 1440);
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	left: 0;
	width: 100%;
	height: calc(var(--hero-logo-top) + 100cqw * 629.95349 / 938.91749);
	pointer-events: none;
	background:
		linear-gradient(180deg, rgb(255 255 255 / 0.75) 0%, transparent 100%) 0 0 / 100% 168px no-repeat,
		url("../../images/cmc-icon-progressive-blur.svg") 0 100% / 100% auto no-repeat;
}
