/**
 * Scroll Video Hero
 * Front-end styles. The pinned inner element fills the viewport; GSAP pins it
 * while the outer section provides the scroll distance. Per-instance values
 * (--svh-text, --svh-tint) are set inline by the shortcode.
 */

.svh {
	position: relative; /* MUST stay in normal flow — GSAP inserts its pin-spacer
	                        here to reserve the scroll distance. */
	width: 100%;
	z-index: 9;
}

/* Optional: make the hero break out to the full viewport width even when it
   sits inside a padded WPBakery row. Add the class "svh-fullbleed" in the
   element's "Extra class name" field to enable. */
.svh-fullbleed {
	left: 50%;
	margin-left: -50vw;
	width: 100vw;
	max-width: 100vw;
}

/* The element that fills 100% of the screen. GSAP pins this (position:fixed)
   while scrubbing — we deliberately do NOT use position:sticky, because this
   theme's body{overflow:hidden} makes the body a scroll container and silently
   breaks sticky. GSAP's fixed-based pin is immune to that. */
.svh__pin {
	position: relative;
	width: 100%;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	background: #000;
}

.svh__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	/* Hint the browser to keep decoded frames ready for smoother seeking. */
	will-change: transform;
	pointer-events: none;
	user-select: none;
}

.svh__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--svh-tint, 0.2));
	pointer-events: none;
}

/* --- Adopted overlays ---
   Elements tagged .svh-overlay-* (or auto-adopted in the JS) are moved by JS
   inside the pinned hero so they stay overlaid on the video for the whole
   scroll. Positioning and animations are left entirely to WPBakery / the
   element's own styles — we only ensure they stack above the video. */
.svh__pin > [class*="svh-overlay-"] {
	z-index: 4;
}

/* --- Overlay content --- */

.svh__content {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	padding: var(--svh-content-pad, 8vmin);
	color: var(--svh-text, #fff);
	text-align: var(--svh-align, center);
	pointer-events: none;
}

.svh__content > * {
	pointer-events: auto;
}

/* Custom overlay markup (from the Overlay Content editor). Inherits the hero
   text colour; the user's own headings/paragraphs keep their theme styling. */
.svh__custom {
	color: var(--svh-text, #fff);
	max-width: min(90vw, 60ch);
}
.svh__custom :where(h1, h2, h3, h4, h5, h6, p) {
	color: inherit;
}
.svh__custom > :first-child { margin-top: 0; }
.svh__custom > :last-child { margin-bottom: 0; }

/* Content positioning presets. */
.svh--pos-center .svh__content {
	--svh-align: center;
	align-items: center;
	justify-content: center;
}
.svh--pos-bottom-center .svh__content {
	--svh-align: center;
	align-items: center;
	justify-content: flex-end;
}
.svh--pos-bottom-left .svh__content {
	--svh-align: left;
	align-items: flex-start;
	justify-content: flex-end;
}
.svh--pos-top-left .svh__content {
	--svh-align: left;
	align-items: flex-start;
	justify-content: flex-start;
}

.svh__heading {
	margin: 0;
	color: var(--svh-text, #fff);
	max-width: 18ch;
}

.svh__subheading {
	margin: 0.75em 0 0;
	color: var(--svh-text, #fff);
	max-width: 46ch;
	opacity: 0.92;
}

.svh__btn {
	display: inline-block;
	margin-top: 1.75em;
	padding: 0.85em 2em;
	border-radius: 4px;
	background: var(--svh-text, #fff);
	color: #111;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.svh__btn:hover {
	transform: translateY(-2px);
	opacity: 0.9;
}



/* 690 */

@media screen and (max-width: 690px) {
	video.svh__video {
	    width: 130%;
	    left: -30%;
	}
}



/* Respect users who ask for reduced motion — JS falls back to a looped play,
   so nothing about the pinned scrub applies here. */
@media (prefers-reduced-motion: reduce) {
	.svh__video {
		will-change: auto;
	}
}
