/**
 * Editorial Story front-end grammar.
 *
 * All space is bounded. Layouts express relationships rather than absolute
 * coordinates, then recompose deliberately at tablet and phone widths.
 */
:root {
	--aeg-story-gap-tight: clamp(4px, 0.45vw, 8px);
	--aeg-story-gap-standard: clamp(8px, 0.9vw, 16px);
	--aeg-story-gap-breath: clamp(16px, 1.8vw, 32px);
	--aeg-story-gap-section: clamp(28px, 3.5vw, 64px);
	--aeg-story-rest-tight: clamp(12px, 1.5vw, 26px);
	--aeg-story-rest-standard: clamp(28px, 3.2vw, 58px);
	--aeg-story-rest-breath: clamp(56px, 6vw, 112px);
	--aeg-story-rest-section: clamp(92px, 10vw, 180px);
}

.aeg-story-item,
.aeg-story-layout,
.aeg-story-chapter {
	box-sizing: border-box;
}

.aeg-story-photo {
	margin-block: 0;
	max-width: 100%;
	width: var(--aeg-story-item-width, 100%);
}

.aeg-story-photo.is-horizontal-left { margin-left: 0 !important; margin-right: auto !important; }
.aeg-story-photo.is-horizontal-center { margin-left: auto !important; margin-right: auto !important; }
.aeg-story-photo.is-horizontal-right { margin-left: auto !important; margin-right: 0 !important; }

.aeg-story-photo-link {
	color: inherit;
	display: block;
	text-decoration: none;
}

.aeg-story-photo-link[data-aeg-lightbox-entry='true'] {
	cursor: zoom-in;
}

.aeg-story-photo img {
	display: block;
	height: auto;
	max-width: 100%;
	width: 100%;
}

.aeg-story-item figcaption {
	background: transparent !important;
	box-sizing: border-box;
	color: var(--aeg-caption-color, #6a6c6e) !important;
	display: block !important;
	float: none !important;
	font-size: var(--aeg-caption-size, 0.8em) !important;
	font-style: normal;
	font-weight: 400 !important;
	height: auto !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	max-height: none !important;
	opacity: 1 !important;
	overflow: visible !important;
	padding: var(--aeg-caption-top, 10px) var(--aeg-caption-sides, 4em) var(--aeg-caption-bottom, 50px) !important;
	pointer-events: auto !important;
	position: static !important;
	text-align: var(--aeg-caption-align, left) !important;
	text-shadow: none !important;
	transform: none !important;
	white-space: normal;
	width: 100%;
}

[data-aeg-captions='hide'] .aeg-story-item figcaption {
	display: none !important;
}

.aeg-story-photo-unavailable {
	align-items: center;
	background: #f1f1f1;
	border: 1px solid #d8d8d8;
	color: #6b6b6b;
	display: flex;
	justify-content: center;
	min-height: 180px;
	padding: 2rem;
	text-align: center;
}

/* Moving-image plates share the same spatial vocabulary as photographs. */
.aeg-story-video {
	margin-block: 0;
}

.aeg-story-video-frame {
	background: #111;
	position: relative;
}

.aeg-story-video-element {
	display: block;
	height: auto;
	max-width: 100%;
	width: 100%;
}

.aeg-story-video-open {
	inset: 0;
	position: absolute;
	z-index: 2;
}

.aeg-story-video-open > span {
	background: rgba(0, 0, 0, 0.7);
	border-radius: 999px;
	color: #fff;
	font-size: 12px;
	left: 50%;
	opacity: 0;
	padding: 8px 12px;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	transition: opacity 160ms ease;
}

.aeg-story-video-open:focus-visible > span,
.aeg-story-video-frame:hover .aeg-story-video-open > span {
	opacity: 1;
}

.aeg-story-video:has(video[controls]) .aeg-story-video-open {
	bottom: auto;
	height: 42px;
	left: auto;
	right: 8px;
	top: 8px;
	width: 90px;
}

.aeg-story-video:has(video[controls]) .aeg-story-video-open > span {
	opacity: 1;
}

.aeg-story-video.is-presentation-feature,
.aeg-story-video.is-presentation-cinema { width: 100%; }
.aeg-story-video.is-presentation-cinema .aeg-story-video-frame { aspect-ratio: 16 / 9; }
.aeg-story-video.is-presentation-cinema video { height: 100%; object-fit: cover; }
.aeg-story-video.is-presentation-full-bleed {
	left: auto !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	max-width: none !important;
	position: relative;
	right: auto !important;
	width: auto !important;
}
.aeg-story-video.is-presentation-quiet { margin-inline: auto; max-width: min(62vw, 900px); }
.aeg-story-video.is-presentation-portrait { margin-inline: auto; max-width: min(48vw, 720px); }

.aeg-story-video-unavailable {
	align-items: center;
	background: #171717;
	color: #eee;
	display: flex;
	justify-content: center;
	min-height: 220px;
	padding: 2rem;
	text-align: center;
}

/* Editorial text is opt-in typography, not arbitrary vertical positioning. */
.aeg-story-text {
	box-sizing: border-box;
	margin-inline: auto;
}

.aeg-story-text.is-width-narrow { max-width: 34rem; }
.aeg-story-text.is-width-measure { max-width: 48rem; }
.aeg-story-text.is-width-wide { max-width: 78rem; }
.aeg-story-text.is-width-full { max-width: none; }
.aeg-story-text.has-text-align-center { text-align: center; }
.aeg-story-text.has-text-align-right { text-align: right; }

.aeg-story-text-label {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.13em;
	margin: 0 0 1rem;
	opacity: 0.62;
	text-transform: uppercase;
}

.aeg-story-text.is-treatment-essay {
	font-size: 1rem;
	line-height: 1.68;
}

.aeg-story-text.is-treatment-deck {
	font-size: clamp(1.25rem, 2vw, 2rem);
	line-height: 1.32;
}

.aeg-story-text.is-treatment-statement {
	font-size: clamp(2.5rem, 7vw, 8rem);
	font-weight: 400;
	letter-spacing: -0.045em;
	line-height: 0.92;
}

.aeg-story-text.is-treatment-pullquote {
	font-size: clamp(1.55rem, 3.6vw, 3.7rem);
	font-style: italic;
	line-height: 1.08;
}

.aeg-story-text.is-treatment-marginalia,
.aeg-story-text.is-treatment-caption-led,
.aeg-story-text.is-treatment-credits {
	font-size: 0.82rem;
	line-height: 1.5;
}

.aeg-story-text.is-treatment-drop-cap > p:first-of-type::first-letter {
	float: left;
	font-size: 5.2em;
	line-height: 0.72;
	margin: 0.12em 0.12em 0 0;
}

.aeg-story-text.is-treatment-two-column {
	column-count: 2;
	column-gap: clamp(2rem, 5vw, 5rem);
}

.aeg-story-text.is-treatment-inverted {
	background: #111;
	color: #fff;
	padding: clamp(2.5rem, 6vw, 7rem);
}

.aeg-story-text.is-treatment-highlight {
	background: color-mix(in srgb, currentColor 7%, transparent);
	border-left: 3px solid currentColor;
	padding: clamp(1.25rem, 3vw, 2.5rem);
}

.aeg-story-text.is-treatment-credits {
	letter-spacing: 0.03em;
}

/* Solo treatments. */
.aeg-story-photo.is-presentation-feature {
	margin-inline: auto;
}

.aeg-story-photo.is-presentation-full-bleed {
	left: auto !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	max-width: none !important;
	position: relative;
	right: auto !important;
	width: auto !important;
}

.aeg-story-photo.is-presentation-quiet {
	margin-inline: auto;
}

.aeg-story-photo.is-presentation-portrait-left,
.aeg-story-photo.is-presentation-portrait-right {
	max-width: 100%;
}

.aeg-story-photo.is-presentation-portrait-right {
	margin-left: auto;
}

.aeg-story-photo.is-presentation-panorama {
	margin-inline: auto;
}

.aeg-story-photo.is-presentation-inset {
	margin-inline: auto;
}

.aeg-story-layout {
	margin-block: 0;
	max-width: 100%;
	width: var(--aeg-story-layout-width, 100%);
}

.aeg-story-layout.is-horizontal-left { margin-left: 0 !important; margin-right: auto !important; }
.aeg-story-layout.is-horizontal-center { margin-left: auto !important; margin-right: auto !important; }
.aeg-story-layout.is-horizontal-right { margin-left: auto !important; margin-right: 0 !important; }

.aeg-story-layout .aeg-story-photo,
.aeg-story-layout .aeg-story-video {
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none;
	width: 100%;
}

/* Shared layout mechanics. */
.aeg-story-layout-inner {
	display: grid;
	grid-auto-flow: row;
	min-width: 0;
}

.aeg-story-layout-inner > * {
	margin-block: 0;
	min-width: 0;
}

.aeg-story-layout.has-gap-tight .aeg-story-layout-inner { gap: var(--aeg-story-gap-tight); }
.aeg-story-layout.has-gap-standard .aeg-story-layout-inner { gap: var(--aeg-story-gap-standard); }
.aeg-story-layout.has-gap-breath .aeg-story-layout-inner { gap: var(--aeg-story-gap-breath); }
.aeg-story-layout.has-gap-section .aeg-story-layout-inner { gap: var(--aeg-story-gap-section); }

.aeg-story-layout.is-aligned-start .aeg-story-layout-inner { align-items: start; }
.aeg-story-layout.is-aligned-center .aeg-story-layout-inner { align-items: center; }
.aeg-story-layout.is-aligned-end .aeg-story-layout-inner { align-items: end; }
.aeg-story-layout.is-aligned-baseline .aeg-story-layout-inner { align-items: baseline; }

/* Pairs. */
.aeg-story-layout.is-diptych-equal .aeg-story-layout-inner,
.aeg-story-layout.is-diptych-top .aeg-story-layout-inner,
.aeg-story-layout.is-diptych-bottom .aeg-story-layout-inner,
.aeg-story-layout.is-quiet-pair .aeg-story-layout-inner,
.aeg-story-layout.is-call-response .aeg-story-layout-inner,
.aeg-story-layout.is-overlap-pair .aeg-story-layout-inner {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aeg-story-layout.is-diptych-lead-left .aeg-story-layout-inner {
	grid-template-columns: minmax(0, var(--aeg-story-lead)) minmax(0, var(--aeg-story-support));
}

.aeg-story-layout.is-diptych-lead-right .aeg-story-layout-inner {
	grid-template-columns: minmax(0, var(--aeg-story-support)) minmax(0, var(--aeg-story-lead));
}

.aeg-story-layout.is-diptych-top .aeg-story-layout-inner { align-items: start; }
.aeg-story-layout.is-diptych-bottom .aeg-story-layout-inner { align-items: end; }

.aeg-story-layout.is-quiet-pair {
	margin-inline: auto;
}

.aeg-story-layout.is-call-response .aeg-story-layout-inner {
	column-gap: var(--aeg-story-gap-section);
}

.aeg-story-layout.is-overlap-pair .aeg-story-layout-inner > :nth-child(2) {
	margin-left: clamp(-90px, -6vw, -34px);
	margin-top: clamp(36px, 5vw, 88px);
	z-index: 2;
}

/* Trios. */
.aeg-story-layout.is-triptych-equal .aeg-story-layout-inner,
.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aeg-story-layout.is-feature-two .aeg-story-layout-inner,
.aeg-story-layout.is-two-feature .aeg-story-layout-inner {
	grid-template-columns: minmax(0, var(--aeg-story-lead)) minmax(0, var(--aeg-story-support));
	grid-template-rows: repeat(2, minmax(0, auto));
}

.aeg-story-layout.is-feature-two .aeg-story-layout-inner > :first-child,
.aeg-story-layout.is-two-feature .aeg-story-layout-inner > :nth-child(3) {
	grid-row: 1 / span 2;
}

.aeg-story-layout.is-two-feature .aeg-story-layout-inner > :first-child,
.aeg-story-layout.is-two-feature .aeg-story-layout-inner > :nth-child(2) {
	grid-column: 1;
}

.aeg-story-layout.is-two-feature .aeg-story-layout-inner > :nth-child(3) {
	grid-column: 2;
}

.aeg-story-layout.is-triptych-center .aeg-story-layout-inner {
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr) minmax(0, 0.8fr);
}

.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner > :nth-child(2) {
	transform: translateY(clamp(24px, 3vw, 54px));
}

.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner > :nth-child(3) {
	transform: translateY(clamp(48px, 6vw, 108px));
}

/* Multiples. */
.aeg-story-layout.is-quartet .aeg-story-layout-inner {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aeg-story-layout.is-filmstrip .aeg-story-layout-inner {
	grid-auto-flow: column;
	grid-auto-columns: minmax(160px, 1fr);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-snap-type: inline proximity;
}

.aeg-story-layout.is-filmstrip .aeg-story-layout-inner > * {
	scroll-snap-align: start;
}

.aeg-story-layout.is-contact-sheet .aeg-story-layout-inner {
	grid-template-columns: repeat(auto-fit, minmax(min(170px, 42vw), 1fr));
}

.aeg-story-layout.is-typology .aeg-story-layout-inner {
	align-items: start;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aeg-story-layout.is-cluster .aeg-story-layout-inner,
.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-template-rows: repeat(8, minmax(20px, auto));
}

.aeg-story-layout.is-cluster .aeg-story-layout-inner > :nth-child(1) { grid-column: 1 / span 5; grid-row: 1 / span 3; }
.aeg-story-layout.is-cluster .aeg-story-layout-inner > :nth-child(2) { grid-column: 8 / span 5; grid-row: 1 / span 4; }
.aeg-story-layout.is-cluster .aeg-story-layout-inner > :nth-child(3) { grid-column: 4 / span 6; grid-row: 4 / span 3; z-index: 2; }
.aeg-story-layout.is-cluster .aeg-story-layout-inner > :nth-child(4) { grid-column: 1 / span 4; grid-row: 7 / span 2; }
.aeg-story-layout.is-cluster .aeg-story-layout-inner > :nth-child(5) { grid-column: 9 / span 4; grid-row: 7 / span 2; }

.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner > :nth-child(1) { grid-column: 4 / span 6; grid-row: 2 / span 6; z-index: 2; }
.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner > :nth-child(2) { grid-column: 1 / span 3; grid-row: 1 / span 3; }
.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner > :nth-child(3) { grid-column: 10 / span 3; grid-row: 1 / span 3; }
.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner > :nth-child(4) { grid-column: 1 / span 3; grid-row: 6 / span 3; }
.aeg-story-layout.is-feature-satellites .aeg-story-layout-inner > :nth-child(5) { grid-column: 10 / span 3; grid-row: 6 / span 3; }

.aeg-story-layout.is-panorama-details .aeg-story-layout-inner {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aeg-story-layout.is-panorama-details .aeg-story-layout-inner > :first-child {
	grid-column: 1 / -1;
}

.aeg-story-layout.is-vertical-procession .aeg-story-layout-inner {
	grid-template-columns: minmax(0, 1fr);
	margin-inline: auto;
	max-width: min(76vw, 1100px);
}

.aeg-story-layout.is-vertical-procession .aeg-story-layout-inner > :nth-child(odd) {
	margin-right: 14%;
}

.aeg-story-layout.is-vertical-procession .aeg-story-layout-inner > :nth-child(even) {
	margin-left: 14%;
}

/* Text relationships. */
.aeg-story-layout.is-image-text .aeg-story-layout-inner {
	grid-template-columns: minmax(0, var(--aeg-story-lead)) minmax(16rem, var(--aeg-story-support));
}

.aeg-story-layout.is-text-image .aeg-story-layout-inner {
	grid-template-columns: minmax(16rem, var(--aeg-story-support)) minmax(0, var(--aeg-story-lead));
}

.aeg-story-layout.is-statement-image .aeg-story-layout-inner {
	align-items: center;
	grid-template-columns: minmax(0, var(--aeg-story-support)) minmax(0, var(--aeg-story-lead));
}

.aeg-story-layout.is-statement-image .aeg-story-layout-inner > :first-child {
	font-size: clamp(2rem, 5vw, 6rem);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 0.94;
}

/* Optional crop policies are explicit. */
.aeg-story-layout.is-crop-always .aeg-story-photo,
.aeg-story-layout.is-crop-always .aeg-story-photo-link {
	height: 100%;
}

.aeg-story-layout.is-crop-always .aeg-story-photo img {
	height: 100%;
	object-fit: cover;
}

/* Semantic relationship accents remain restrained. */
.aeg-story-layout.is-relationship-contrast .aeg-story-layout-inner {
	--aeg-story-relationship-line: currentColor;
}

.aeg-story-layout.is-relationship-contrast .aeg-story-layout-inner::before {
	background: var(--aeg-story-relationship-line);
	content: '';
	display: block;
	height: 1px;
	left: 50%;
	opacity: 0.25;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(8vw, 90px);
}

.aeg-story-layout.is-relationship-contrast .aeg-story-layout-inner {
	position: relative;
}

/* Rests: never image-relative and never unbounded. */
.aeg-story-rest {
	clear: both;
	display: block;
	margin: 0 !important;
	pointer-events: none;
}

.aeg-story-rest.is-tight { height: var(--aeg-story-rest-tight); }
.aeg-story-rest.is-standard { height: var(--aeg-story-rest-standard); }
.aeg-story-rest.is-breath { height: var(--aeg-story-rest-breath); }
.aeg-story-rest.is-section { height: var(--aeg-story-rest-section); }
.aeg-story-rest > span { display: none; }

/* Chapter openings. */
.aeg-story-chapter {
	padding-block: clamp(2rem, 5vw, 7rem);
}

.aeg-story-chapter.is-quiet {
	margin-inline: auto;
	max-width: min(72rem, 86vw);
}

.aeg-story-chapter.is-statement > h2,
.aeg-story-chapter.is-statement > .wp-block-heading {
	font-size: clamp(3rem, 9vw, 10rem);
	font-weight: 400;
	letter-spacing: -0.045em;
	line-height: 0.88;
	max-width: 12ch;
}

.aeg-story-chapter.is-image-led {
	display: grid;
	gap: var(--aeg-story-gap-breath);
	grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.7fr);
}

.aeg-story-chapter-index {
	font-size: clamp(3rem, 8vw, 9rem);
	font-variant-numeric: tabular-nums;
	font-weight: 300;
	letter-spacing: -0.04em;
	line-height: 0.8;
	margin: 0 0 var(--aeg-story-gap-standard);
	opacity: 0.55;
}

@media (min-width: 783px) {
	.aeg-story-layout.is-crop-desktop .aeg-story-photo,
	.aeg-story-layout.is-crop-desktop .aeg-story-photo-link {
		height: 100%;
	}

	.aeg-story-layout.is-crop-desktop .aeg-story-photo img {
		height: 100%;
		object-fit: cover;
	}
}

@media (max-width: 1000px) {
	.aeg-story-layout.is-triptych-equal .aeg-story-layout-inner,
	.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner,
	.aeg-story-layout.is-typology .aeg-story-layout-inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.aeg-story-layout.is-triptych-equal .aeg-story-layout-inner > :last-child,
	.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner > :last-child {
		grid-column: 1 / -1;
		margin-inline: auto;
		max-width: 58%;
	}

	.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner > :nth-child(2),
	.aeg-story-layout.is-triptych-stepped .aeg-story-layout-inner > :nth-child(3) {
		transform: none;
	}
}

@media (max-width: 782px) {
	.aeg-story-photo.is-presentation-feature,
	.aeg-story-photo.is-presentation-panorama {
		width: 100%;
	}

	.aeg-story-photo.is-presentation-quiet,
	.aeg-story-photo.is-presentation-portrait-left,
	.aeg-story-photo.is-presentation-portrait-right,
	.aeg-story-photo.is-presentation-inset {
		margin-inline: auto;
		max-width: min(88vw, 620px);
		width: 88%;
	}

	.aeg-story-layout {
		width: 100%;
	}

	.aeg-story-video.is-presentation-quiet,
	.aeg-story-video.is-presentation-portrait {
		margin-inline: auto;
		max-width: min(88vw, 620px);
	}

	.aeg-story-text.is-treatment-two-column {
		column-count: 1;
	}

	.aeg-story-layout.is-mobile-stack .aeg-story-layout-inner,
	.aeg-story-layout.is-image-text .aeg-story-layout-inner,
	.aeg-story-layout.is-text-image .aeg-story-layout-inner,
	.aeg-story-layout.is-statement-image .aeg-story-layout-inner,
	.aeg-story-chapter.is-image-led {
		display: grid;
		grid-auto-flow: row;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
	}

	.aeg-story-layout.is-mobile-stack .aeg-story-layout-inner > *,
	.aeg-story-layout.is-image-text .aeg-story-layout-inner > *,
	.aeg-story-layout.is-text-image .aeg-story-layout-inner > *,
	.aeg-story-layout.is-statement-image .aeg-story-layout-inner > * {
		grid-column: auto !important;
		grid-row: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		max-width: none !important;
		transform: none !important;
	}

	.aeg-story-layout.is-mobile-scroll .aeg-story-layout-inner {
		display: grid;
		grid-auto-columns: minmax(76vw, 1fr);
		grid-auto-flow: column;
		grid-template-columns: none;
		overflow-x: auto;
		scroll-snap-type: inline mandatory;
	}

	.aeg-story-layout.is-mobile-scroll .aeg-story-layout-inner > * {
		grid-column: auto !important;
		grid-row: auto !important;
		scroll-snap-align: center;
		transform: none !important;
	}

	.aeg-story-layout.is-mobile-retain.is-contact-sheet .aeg-story-layout-inner,
	.aeg-story-layout.is-mobile-retain.is-typology .aeg-story-layout-inner,
	.aeg-story-layout.is-mobile-retain.is-quartet .aeg-story-layout-inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.aeg-story-layout.is-relationship-contrast .aeg-story-layout-inner::before {
		display: none;
	}

	.aeg-story-rest.is-tight { height: clamp(10px, 3vw, 18px); }
	.aeg-story-rest.is-standard { height: clamp(22px, 6vw, 42px); }
	.aeg-story-rest.is-breath { height: clamp(40px, 12vw, 78px); }
	.aeg-story-rest.is-section { height: clamp(70px, 20vw, 130px); }
}

@media (prefers-reduced-motion: reduce) {
	.aeg-story-layout *,
	.aeg-story-photo-link {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
