/* ────────────────────────────────────────────────────────────────────────
 * Insights Child — hero.css
 *
 * Styles for the flexible front-page hero (template-parts/section-hero.php).
 * Lifted directly from insights-homepage-v3.html with two additions:
 *   - .hero-overlay-text.position-bottom-left  (new bottom-left variant)
 *   - .hero-tagline / .hero-tagline-inner now used for above OR below
 *
 * Brand tokens (--crimson, --crimson-bright, --cream, --ink, --paper)
 * inherit from homepage.css / footer.css — NOT redeclared here.
 * Local tokens (--text-dim, --line) scoped to .hero.
 * ───────────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────
 * 0. ASTRA CONTAINER BREAKOUT
 *     Astra wraps page content in `.site-content > .ast-container`
 *     with display:flex and max-width:1240px. The front-page hero
 *     needs to span its own 1320px container without flex constraints.
 * ────────────────────────────────────────────────────────────── */
body.home #content.site-content,
body.home #content.site-content > .ast-container {
	display: block !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}
body.home #main-content.front-page-main {
	width: 100%;
	max-width: none;
}
body.home #secondary {
	display: none !important;
}

.hero {
	/* Local tokens — only used inside the hero. */
	--text-dim: rgba(26, 26, 26, 0.68);
	--line: rgba(26, 26, 26, 0.08);

	padding: 64px 0 112px;
	position: relative;
}

/* ──────────────────────────────────────────────────────────────
 * 1. MEDIA WRAP
 * ────────────────────────────────────────────────────────────── */
.hero-video-wrap {
	position: relative;
	max-width: 1320px;
	margin: 0 auto;
	width: calc(100% - 64px);
	aspect-ratio: 16 / 9;
	background-color: #2D1010;
	overflow: hidden;
	border-radius: 32px;
	box-shadow: 0 32px 80px -24px rgba(26, 26, 26, 0.18);
}
.hero-video-wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(26, 26, 26, 0.30) 0%, rgba(26, 26, 26, 0.10) 35%, rgba(26, 26, 26, 0.25) 65%, rgba(26, 26, 26, 0.65) 100%),
		radial-gradient(ellipse at center, rgba(26, 26, 26, 0.18) 0%, transparent 70%);
	pointer-events: none;
	z-index: 3;
}
.hero-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
}

/* ──────────────────────────────────────────────────────────────
 * 2. SLIDESHOW
 * ────────────────────────────────────────────────────────────── */
.hero-slideshow {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
}
.hero-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 1.4s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide-img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-color: #2D1010;
	transform: scale(1);
	transition: transform 6s ease-out;
}
.hero-slide.active .hero-slide-img { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) {
	.hero-slide.active .hero-slide-img { transform: none; transition: none; }
	.hero-slide { transition: opacity 0.2s ease; }
}

/* Slide caption — rotates per slide */
.hero-slide-captions {
	position: absolute;
	bottom: 26px;
	left: 32px;
	z-index: 4;
	height: 20px;
	min-width: 240px;
}
.hero-slide-captions span {
	position: absolute;
	bottom: 0;
	left: 0;
	font-family: 'Jost', sans-serif;
	font-style: italic;
	font-size: 13px;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.88);
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
	white-space: nowrap;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero-slide-captions span::before {
	content: "—";
	color: var(--crimson-bright);
	margin-right: 10px;
	font-style: normal;
}
.hero-slide-captions span.active { opacity: 1; transform: translateY(0); }

/* Progress bars (one per slide, fills while active) */
.hero-progress {
	position: absolute;
	bottom: 26px;
	right: 32px;
	display: flex;
	gap: 8px;
	z-index: 4;
}
.hero-progress .dot {
	width: 36px;
	height: 2px;
	background: rgba(255, 255, 255, 0.28);
	border: none;
	cursor: pointer;
	padding: 0;
	position: relative;
	overflow: hidden;
	transition: background 0.25s ease;
}
.hero-progress .dot::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	background: rgba(255, 255, 255, 0.95);
	transition: width 0.25s ease;
}
.hero-progress .dot.active::after {
	width: 100%;
	transition: width 6s linear;
}
.hero-progress .dot:hover { background: rgba(255, 255, 255, 0.45); }
.hero-progress .dot:focus-visible {
	outline: 2px solid var(--crimson-bright);
	outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
	.hero-progress .dot.active::after { transition: width 0.2s ease; }
}

/* ──────────────────────────────────────────────────────────────
 * 3. OVERLAY TEXT — centred + bottom-left variants
 * ────────────────────────────────────────────────────────────── */
.hero-overlay-text {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 80px 48px 100px;
	pointer-events: none;
}
.hero-overlay-text.position-bottom-left {
	align-items: flex-start;
	justify-content: flex-end;
	text-align: left;
	padding: 32px 48px 80px 56px;
}
.hero-overlay-eyebrow {
	font-size: 11px;
	letter-spacing: 0.30em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.92);
	font-weight: 600;
	margin-bottom: 28px;
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.65);
	opacity: 0;
	transform: translateY(20px);
	animation: heroFadeUp 1.6s cubic-bezier(0.16, 0.84, 0.24, 1) 0.5s forwards;
}
.hero-overlay-eyebrow::before {
	content: "";
	display: block;
	width: 48px;
	height: 2px;
	background: var(--crimson-bright);
	margin: 0 auto 18px;
}
.hero-overlay-text.position-bottom-left .hero-overlay-eyebrow::before {
	margin: 0 0 18px;
}
.hero-overlay-headline {
	font-family: 'Jost', sans-serif;
	font-size: clamp(36px, 5vw, 72px);
	font-weight: 500;
	letter-spacing: -0.025em;
	line-height: 1.06;
	color: #FFFFFF;
	max-width: 940px;
	text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.4);
	margin: 0;
	opacity: 0;
	transform: translateY(28px);
	animation: heroFadeUp 2.0s cubic-bezier(0.16, 0.84, 0.24, 1) 0.85s forwards;
}
.hero-overlay-headline em {
	font-style: italic;
	color: var(--crimson-bright);
	font-weight: 400;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65), 0 1px 4px rgba(0, 0, 0, 0.45);
}
.hero-overlay-text.position-bottom-left .hero-overlay-headline {
	max-width: 720px;
	font-size: clamp(32px, 4.4vw, 60px);
}

/* ──────────────────────────────────────────────────────────────
 * 4. TAGLINE — above or below (Cheam-style)
 *     Generous bottom padding gives the editorial "breathing room"
 *     between the headline and the hero media (matches Cheam's
 *     ~96px gap on their admissions page).
 * ────────────────────────────────────────────────────────────── */
.hero-tagline {
	padding: 80px 0 180px;
	background: transparent;
}
.hero + .hero-tagline,
.hero-tagline + .hero {
	padding: 0 0 180px;
}
.hero-tagline-inner {
	max-width: 1380px;
	margin: 0 auto;
	padding: 0 40px;
	text-align: center;
}
.hero-eyebrow {
	font-size: 11px;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--crimson);
	font-weight: 700;
	margin-bottom: 28px;
	opacity: 0;
	transform: translateY(20px);
	animation: heroFadeUp 1.6s cubic-bezier(0.16, 0.84, 0.24, 1) 0.45s forwards;
}
.hero-eyebrow::before {
	content: "";
	display: block;
	width: 48px;
	height: 2px;
	background: var(--crimson-bright);
	margin: 0 auto 18px;
}
.hero-headline {
	font-family: 'Jost', sans-serif;
	font-size: clamp(44px, 5.0vw, 76px);
	font-weight: 500;
	letter-spacing: -0.025em;
	line-height: 1.08;
	color: var(--ink);
	margin: 0 auto;
	max-width: 1200px;
	opacity: 0;
	transform: translateY(28px);
	animation: heroFadeUp 2.0s cubic-bezier(0.16, 0.84, 0.24, 1) 0.8s forwards;
}
/* Only force single-line on very wide displays where the sentence
   physically fits — i.e. ≥ 1720px viewport. Below that the headline
   wraps to two lines but stays much bigger than before. */
@media (min-width: 1720px) {
	.hero-headline { white-space: nowrap; max-width: none; }
}
.hero-headline em {
	font-style: italic;
	color: var(--crimson);
	font-weight: 400;
}

/* ──────────────────────────────────────────────────────────────
 * 5. KEYFRAMES
 * ────────────────────────────────────────────────────────────── */
@keyframes heroFadeUp {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────────
 * 5b. CINEMATIC HERO REVEAL — Cheam-style intro
 *      ACF toggle `hero_cinematic_reveal`. When on, the hero VIDEO
 *      starts at fullscreen on page load, holds for ~1.5s, then
 *      animates down to its in-layout position via a JS-driven
 *      FLIP transform (see hero.js).
 *
 *      The chrome (header, eyebrow, headline) is intentionally NOT
 *      animated — it sits in its final position from the start, and
 *      the fullscreen video simply covers it during the hold. When
 *      the video shrinks back to its bounded box, the headline is
 *      revealed because the video no longer covers it.
 *      (This is the Cheam pattern — no chrome animation at all.)
 *
 *      We only lock body scroll during the hold + morph so the user
 *      can't interrupt the moment.
 * ────────────────────────────────────────────────────────────── */
body.is-cinematic-loading {
	overflow: hidden;
}
.hero--cinematic .hero-video-wrap {
	will-change: transform, border-radius;
}
/* Lift the hero above all other UI while the FLIP morph runs, so the
   fullscreen video covers the header, tagline, and everything below. */
body.is-cinematic-loading .hero {
	position: relative;
	z-index: 99999;
}
/* Suppress the tagline's normal fade-up entrance when cinematic mode
   is on — the headline must be in its final state from the start,
   so the video shrinking is the only animation visible. */
.hero--cinematic .hero-eyebrow,
.hero--cinematic .hero-headline,
.hero--cinematic .hero-overlay-eyebrow,
.hero--cinematic .hero-overlay-headline {
	opacity: 1 !important;
	transform: none !important;
	animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
	/* Skip the morph entirely for reduced-motion users. */
	body.is-cinematic-loading { overflow: auto !important; }
}

/* ──────────────────────────────────────────────────────────────
 * 6. RESPONSIVE
 * ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.hero { padding: 32px 0 56px; }
	.hero-video-wrap {
		aspect-ratio: 4 / 5;
		width: calc(100% - 40px);
		border-radius: 18px;
	}
	.hero-overlay-text { padding: 56px 24px 80px; }
	.hero-overlay-text.position-bottom-left { padding: 24px 28px 56px; }
	.hero-overlay-headline { font-size: clamp(28px, 7vw, 36px); }
	.hero-overlay-text.position-bottom-left .hero-overlay-headline { font-size: clamp(26px, 6.5vw, 32px); }
	.hero-progress { right: 20px; bottom: 18px; }
	.hero-slide-captions { left: 20px; bottom: 18px; }
	.hero-progress .dot { width: 24px; }

	.hero-tagline { padding: 56px 0 96px; }
	.hero-tagline-inner { padding: 0 20px; }
	.hero-headline {
		font-size: clamp(28px, 7vw, 40px);
		white-space: normal; /* allow wrapping on narrow viewports */
	}
}
