/* ==========================================================================
   Hero system (global): the cinematic opening panel used by Home and by the opening hero of every other page.
   Moved out of pages/home.css so it loads everywhere. Classes keep the home-hero__ prefix.
   ========================================================================== */

/* ==========================================================================
   01 · Hero
   Reuses .page-hero (full height, media / veil / horizon / inner grid) and adds the home-only layers.
   ========================================================================== */
.home-hero {
	/* +40px so the credibility strip can overlap the bottom edge without covering the scroll cue */
	padding-bottom: calc(clamp(3rem, 9vh, 6.5rem) + 40px);
	background-color: var(--sanctum-black);
}

/* warm dawn behind the video / poster (also the whole look while the media slot is still empty) */
.home-hero__media::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(70% 56% at 88% 32%, rgba(244, 122, 31, 0.13), transparent 62%),
		radial-gradient(60% 50% at 8% 96%, rgba(217, 164, 65, 0.08), transparent 70%),
		linear-gradient(180deg, #15100c 0%, #0b0907 100%);
}

.home-hero__media .media-slot__placeholder {
	background: none;
	box-shadow: none;
}

.home-hero__media .media-slot__pattern {
	opacity: 0.4;
}

/*
 * Veil: dark on the copy side, light on the scene side, melting into the next section at the bottom.
 * It is painted as ::after INSIDE the media slot (z-index 5), so the slot's pause button (z-index 6) stays above it
 * and clickable — an overlay element outside the slot would sit on top of the button (WCAG 2.2.2).
 */
.home-hero__media .media-slot::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	background:
		radial-gradient(52% 66% at 90% 40%, rgba(244, 122, 31, 0.14), rgba(244, 122, 31, 0.03) 50%, transparent 72%),
		linear-gradient(90deg, rgba(11, 9, 7, 0.9) 0%, rgba(11, 9, 7, 0.6) 46%, rgba(11, 9, 7, 0.22) 100%),
		linear-gradient(180deg, rgba(11, 9, 7, 0.6) 0%, transparent 26%, transparent 60%, var(--sanctum-black) 100%);
}

/* the pause button clears the credibility strip that overlaps the hero's bottom 40px */
.home-hero__media .media-slot__toggle {
	right: 1rem;
	bottom: calc(40px + 1rem);
}

/*
 * Video background: the wrapper is 14% taller than the hero (the parallax travel never shows an edge) and the slow
 * Ken Burns scale runs on the <video> element itself, so it never touches the pause button inside .media-slot__inner.
 * Phones get a plain crop (animations.js runs parallax from tablet up).
 */
.home-hero__media--video {
	inset: -7% 0;
}

.home-hero__media--video .media-slot__toggle {
	/* 7% of the wrapper hangs below the hero's bottom edge (6.14% of its own height); +3.5rem keeps the button clear of the
	   credibility strip even at the full +5% parallax drift */
	bottom: calc(6.14% + 40px + 4.5rem);
}

@media (max-width: 767px) {
	.home-hero__media--video {
		inset: 0;
	}

	.home-hero__media--video .media-slot__toggle {
		bottom: calc(40px + 1rem);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.home-hero__media video.media-slot__media,
	.home-spirit__bg--video video.media-slot__media {
		transform-origin: 50% 55%;
		animation: hs-kenburns 24s ease-in-out infinite alternate;
	}
}

/* decorative layers never swallow pointer events: only the copy, the scene and the controls are interactive */
.home-hero__inner {
	pointer-events: none;
}

.home-hero__inner > * {
	pointer-events: auto;
}

/* saffron rim light from the right edge: a narrow, bright edge that falls off quickly (light, not a colour fill) */
.home-hero__rim {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: -1;
	width: min(30vw, 460px);
	pointer-events: none;
	background:
		radial-gradient(ellipse 100% 44% at 100% 44%, rgba(255, 154, 77, 0.34), rgba(244, 122, 31, 0.07) 46%, transparent 74%),
		linear-gradient(270deg, rgba(255, 170, 100, 0.12), transparent 24%);
	mix-blend-mode: screen;
	opacity: 0.8;
}

/* cursor glow: JS sets --mx / --my on the hero (data-spotlight) */
.home-hero__glow {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: radial-gradient(520px circle at var(--mx, 72%) var(--my, 36%), rgba(255, 154, 77, 0.16), transparent 62%);
	opacity: 0.35;
	transition: opacity 0.6s ease;
}

@media (hover: hover) and (pointer: fine) {
	.home-hero:hover .home-hero__glow {
		opacity: 1;
	}
}

.home-hero__horizon {
	z-index: 0;
}

.home-hero__inner {
	gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 1024px) {
	.home-hero__inner {
		grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
	}
}

/*
 * H1 = "Hanuman Sena –" (display size) + the Hindi tagline (smaller). The heading itself is set at the TAGLINE size and
 * the English name is scaled up with em: the line splitter wraps each line in a block whose strut is the heading's own
 * font-size, so this keeps Hindi lines tight instead of inheriting the 100px English line height.
 */
.home-hero__title {
	--home-tag-ratio: 0.56;
	margin: 0 0 1.5rem;
	font-size: calc(var(--fs-hero) * var(--home-tag-ratio));
	line-height: 1.3;
}

@media (min-width: 1024px) {
	.home-hero__title {
		--home-tag-ratio: 0.5;
	}
}

/* the copy column is a size container: the name never outgrows it (6.9em ≈ "Hanuman Sena –") whatever the viewport */
.home-hero__copy {
	container-type: inline-size;
}

.home-hero__name {
	font-size: min(calc(1em / var(--home-tag-ratio)), 14cqi);
	line-height: 1.02;
	letter-spacing: var(--tracking-display);
}

/* the trailing dash is saffron: a hard colour stop placed in the gap before it (the name is a single word) */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.home-hero__name {
		background: linear-gradient(90deg, var(--heading) 0 92.4%, var(--accent) 92.4%);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

/* Hindi tagline: never negative-tracked (the [lang=hi] rule in style.css also guarantees it) */
.home-hero__tag {
	display: inline;
	color: var(--saffron-bright);
	font-family: var(--font-hi-display);
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
}

.home-hero__lead {
	max-width: 34rem;
	font-size: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
}

.home-hero__actions {
	align-items: center;
}

@media (min-width: 1024px) {
	/* keep Join · Donate · View Our Work on one row in the 6-column copy block */
	.home-hero__actions .btn--lg {
		padding-inline: 1.7rem;
	}
}

@media (max-width: 767px) {
	.home-hero__actions {
		gap: 0.75rem;
	}

	.home-hero__actions .btn--lg {
		min-height: 52px;
	}
}

/* scene: gada + dhwaj with pointer depth */
.home-hero__scene {
	position: relative;
	width: min(78vw, 360px);
	aspect-ratio: 1;
	margin-inline: auto;
}

@media (min-width: 768px) {
	.home-hero__scene {
		width: min(100%, 520px);
	}
}

@media (min-width: 1024px) {
	.home-hero__scene {
		width: min(100%, 580px);
		margin-inline: auto 0;
	}
}

.home-hero__halo {
	position: absolute;
	inset: 4%;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 46%, rgba(244, 122, 31, 0.22), rgba(244, 122, 31, 0.05) 55%, transparent 72%);
	box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.2);
}

.home-hero__halo::before,
.home-hero__halo::after {
	content: '';
	position: absolute;
	border-radius: 50%;
}

.home-hero__halo::before {
	inset: 9%;
	border: 1px solid rgba(217, 164, 65, 0.16);
}

.home-hero__halo::after {
	inset: -5%;
	border: 1px dashed rgba(217, 164, 65, 0.22);
}

@media (prefers-reduced-motion: no-preference) {
	.home-hero__halo::after {
		animation: hs-spin 160s linear infinite;
	}
}

.home-hero__gada,
.home-hero__dhwaj {
	position: absolute;
}

.home-hero__gada {
	inset: 2% 14% 2% 14%;
}

.home-hero__dhwaj {
	top: -4%;
	right: -2%;
	width: 42%;
	z-index: 2;
}

.home-hero__float {
	position: relative;
	height: 100%;
}

.home-hero__gada .media-slot {
	height: 100%;
	aspect-ratio: auto;
}

.home-hero__gada .media-slot__art {
	inset: 0;
	filter: drop-shadow(0 0 40px rgba(244, 122, 31, 0.45));
}

.home-hero__dhwaj .media-slot__art {
	inset: 0;
	color: var(--saffron);
	filter: drop-shadow(0 0 26px rgba(244, 122, 31, 0.5));
}

/* the flag pole fills the left of the dhwaj frame: keep its slot badge on the free side */
.home-hero__dhwaj .media-slot__meta {
	inset: auto 0.4rem 0.4rem auto;
}

/* scroll cue */
.home-hero__cue {
	position: absolute;
	right: 0;
	bottom: calc(40px + 1.4rem);
	left: 0;
	z-index: 3;
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 0.7rem;
	width: max-content;
	margin-inline: auto;
	color: var(--fg-muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.home-hero__cue:hover {
	color: var(--fg);
}

.home-hero__cue-line {
	width: 1px;
	height: 46px;
	background: linear-gradient(to bottom, var(--saffron), transparent);
	transform-origin: top;
}

@media (min-width: 1024px) and (min-height: 640px) {
	.home-hero__cue {
		display: flex;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.home-hero__cue-line {
		animation: home-cue 2.6s var(--ease-in-out) infinite;
	}
}

@keyframes home-cue {
	0% { transform: scaleY(0); opacity: 0; }
	35% { transform: scaleY(1); opacity: 1; }
	100% { transform: scaleY(1); opacity: 0; }
}


/* ==========================================================================
   Premium opening hero for EVERY page  (.hx-hero, template-parts/components/hero-premium.php)
   Same layers as the home hero: parallax photo + veil, saffron rim light, cursor glow, embers, light sweep, temple skyline,
   split-line headline, 3D scene with pointer depth, scroll cue.
   ========================================================================== */
.hx-hero {
	min-height: min(100svh, 940px);
	padding-top: calc(var(--header-h) + clamp(1.5rem, 5vh, 3.5rem));
	padding-bottom: clamp(3.25rem, 9vh, 6rem);
	align-items: center;
}

@supports not (min-height: 100svh) {
	.hx-hero { min-height: min(100vh, 940px); }
}

.hx-hero .home-hero__cue { bottom: 1.25rem; }

.hx-hero .home-hero__media .media-slot__toggle { bottom: 1rem; }

.hx-hero__copy { container-type: inline-size; max-width: 46rem; }

.hx-hero__title {
	margin: 0 0 clamp(1rem, 2.2vw, 1.6rem);
	font-size: clamp(2.35rem, 10.5cqi, 4.9rem);
	line-height: 1.08;
	letter-spacing: var(--tracking-display);
	text-wrap: balance;
}

.hx-hero__title .accent,
.hx-hero__title em { color: var(--saffron-bright); font-style: normal; }

.hx-hero__lead {
	max-width: 38rem;
	margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
	color: var(--fg-soft);
	font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.3rem);
	line-height: 1.6;
}

/* copy left, scene right from tablet landscape; on phones the 3D scene is left out so the hero stays compact */
.hx-hero .home-hero__inner { align-items: center; }

@media (min-width: 768px) and (max-width: 1023px) {
	.hx-hero .home-hero__inner { grid-template-columns: minmax(0, 1fr); }
	.hx-hero .home-hero__scene { display: none; }
}

@media (max-width: 767px) {
	.hx-hero { min-height: min(92svh, 760px); }
	.hx-hero .home-hero__scene { display: none; }
}

.hx-hero .home-hero__scene { width: min(100%, 500px); }

/* a card dropped in the scene column (e.g. the donation card) behaves like the 3D scene: right-aligned, never overflowing */
.hx-hero__card { width: min(100%, 520px); margin-inline: auto 0; }

@media (max-width: 1023px) { .hx-hero__card { margin-inline: 0; } }

/* one floating model in the lower-left corner when the right column carries a card (donate) */
.hx-hero__deco { position: absolute; left: clamp(0.5rem, 3vw, 3rem); bottom: clamp(3.5rem, 12vh, 7rem); z-index: 1; width: clamp(96px, 12vw, 190px); pointer-events: none; }
@media (max-width: 1023px) { .hx-hero__deco { display: none; } }

/* Floating 3D objects carry no panel behind them and their glow must not be clipped (rules shared with the home page) */
.home-hero__obj,
.home-hero__obj .media-slot,
.home-hero__obj .media-slot__inner,
.home-hero__obj .media-slot__placeholder { background: transparent; box-shadow: none; overflow: visible; }
.home-hero__obj .media-slot__pattern { display: none; }
.home-hero__obj model-viewer { --poster-color: transparent; background: transparent; }
/* Hero titles sit on ONE line from tablet up: the size is derived from the number of characters (--hx-chars, set by the component)
   and the width of the copy column, so a long title ("Seva Activities of Hanuman Sena") gets a smaller size and a short one
   ("Gallery") stays big. Phones keep up to two balanced lines. */
@media (min-width: 768px) {
	.hx-hero__copy { max-width: min(100%, 52rem); }
	.hx-hero__title {
		white-space: nowrap;
		font-size: clamp(2rem, calc(100cqi / (var(--hx-chars, 14) * 0.52)), 4.9rem);
		line-height: 1.1;
	}
	.hx-hero__title .split-line,
	.hx-hero__title .split-line__inner { white-space: nowrap; }
}
/* phones: long titles use two balanced lines at a size that really fits (never three) */
@media (max-width: 767px) {
	.hx-hero__title {
		font-size: clamp(1.55rem, calc(185cqi / (var(--hx-chars, 14) * 0.6)), 2.4rem);
		line-height: 1.12;
	}
}

/* ---- heroes without a 3D scene: the copy gets the full width (the donation card page keeps its second column) ---- */
.hx-hero--solo .home-hero__inner { grid-template-columns: minmax(0, 1fr); }
.hx-hero--solo .home-hero__copy { max-width: min(100%, 60rem); }
.home-hero.hx-hero--solo:not(.hx-hero) .home-hero__copy { max-width: min(100%, 52rem); }
@media (min-width: 1024px) {
	.hx-hero:not(.hx-hero--solo) .home-hero__inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.home-hero__scene, .hx-hero__deco { display: none !important; }
