/*
 * Page hero, in the site's vocabulary (blocks: opener cover, chapter wide):
 *   photograph  framed within the chrome container under the white header,
 *               a low landscape (about 1376 x 500 px on desktop), no shade
 *   panel       engraved burgundy, the fading gold frame from its upper
 *               right; anchored 64 px in from the photograph's left edge,
 *               rising over its lower part and hanging 80 px below it onto
 *               the white, so the hero opens and closes on white
 *   words       the path in small gold capitals (current page underlined),
 *               the heading in the white serif, the standfirst in rose
 * Phones: the photograph, then the panel overlapping its foot.
 */
@layer blocks {
	.page-hero {
		padding-bottom: var(--space-4);
	}

	.page-hero__frame {
		position: relative;
		display: grid;
	}

	.page-hero__media {
		position: relative;
		aspect-ratio: 4 / 3;
		overflow: hidden;
		background: var(--muted);
	}

	.page-hero__image {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		animation: motion-settle calc(var(--duration-slow) * 1.8) var(--ease-out) both;
	}

	.page-hero__panel {
		position: relative;
		display: grid;
		align-content: start;
		margin: calc(var(--space-12) * -1) var(--space-4) 0;
		padding: var(--space-10) var(--space-6);
		background: var(--background);
		color: var(--foreground);
	}

	.page-hero__panel-frame {
		inset: var(--space-3) var(--space-3) 35% 40%;
	}

	/* The path: small spaced capitals in gold, the current page in white. */
	.page-hero__steps {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0 var(--space-2);
		font-size: var(--type-label-size);
		line-height: var(--type-label-line);
		letter-spacing: var(--type-label-tracking);
		font-weight: 600;
		text-transform: uppercase;
		color: var(--eyebrow);
	}

	.page-hero__step {
		display: flex;
		align-items: baseline;
		gap: var(--space-2);
	}

	/* At least 24 px tall: a comfortable target (WCAG 2.5.8). */
	.page-hero__link {
		display: inline-flex;
		align-items: center;
		min-height: var(--space-6);
		color: inherit;
		text-decoration: none;
	}

	.page-hero__current {
		color: var(--heading);
		text-decoration-line: underline;
		text-decoration-thickness: 1px;
		text-decoration-color: var(--ramp-gold-300);
		text-underline-offset: 0.6em;
	}

	.page-hero__heading {
		max-width: 14em;
		margin-top: var(--space-6);
		font-size: var(--type-h2-size);
		line-height: var(--type-h2-line);
		color: var(--heading);
		text-wrap: balance;
	}

	.page-hero__standfirst {
		max-width: 32rem;
		margin-top: var(--space-5);
		color: var(--muted-foreground);
	}

	/* Without a heading the path itself is the h1, large in the serif. */
	.page-hero--trail .page-hero__steps {
		gap: 0 var(--space-3);
		font-family: var(--font-heading);
		font-size: var(--type-h2-size);
		line-height: var(--type-h2-line);
		letter-spacing: 0;
		font-weight: 400;
		text-transform: none;
		color: var(--heading);
	}

	.page-hero--trail .page-hero__step {
		gap: var(--space-3);
	}

	.page-hero--trail .page-hero__current {
		text-decoration-color: currentColor;
		text-underline-offset: 0.1em;
	}

	.page-hero__title {
		font: inherit;
		color: inherit;
	}

	@media (min-width: 48rem) {
		.page-hero__media {
			aspect-ratio: 16 / 9;
		}

		.page-hero__panel {
			margin: calc(var(--space-20) * -1) var(--space-10) 0;
			padding: var(--space-12) var(--space-10);
		}
	}

	@media (min-width: 64rem) {
		.page-hero {
			padding-bottom: var(--space-6);
		}

		/* The panel hangs 80 px below the photograph. */
		.page-hero__frame {
			padding-bottom: var(--space-20);
		}

		.page-hero__media {
			aspect-ratio: auto;
			height: clamp(26rem, 36vw, 32rem);
		}

		.page-hero__panel {
			position: absolute;
			bottom: 0;
			left: calc(var(--gutter) + var(--space-16));
			width: min(40rem, 52%);
			margin: 0;
			padding: var(--space-14) var(--space-16) var(--space-14) var(--space-14);
		}

		.page-hero__panel-frame {
			inset: var(--space-4) var(--space-4) 40% 35%;
		}

		.page-hero__heading {
			font-size: 3rem;
			line-height: 3.5rem;
		}
	}
}
