/**
 * Split Reveal Hero — Frontend Styles
 *
 * Animation model:
 *   .srh-outer is a tall container (e.g. 200vh) that provides the scroll runway.
 *   .srh-sticky is position: sticky and pins to the top while the user scrolls.
 *   .srh-wrapper transforms are driven by --srh-progress (0 → 1), set by JS
 *   based on how far the user has scrolled through .srh-outer.
 */

/* ============ Outer + sticky wrapper ============ */
.srh-outer {
	position: relative;
	width: 100%;
	/* height is set inline by render() based on pinned-height + scroll_distance */
}

.srh-sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	width: 100%;
	height: 100vh; /* overridden by section_height control */
	overflow: hidden;
}

.srh-wrapper {
	/* JS sets these */
	--srh-progress: 0;
	--srh-center-opacity: 0;

	/* Editor-overridable */
	--srh-travel: 105%;

	position: relative;
	width: 100%;
	height: 100vh; /* overridden by section_height control */
	overflow: hidden;
	background: #000;
	isolation: isolate;
}

/* ============ Revealed center: background image + overlay ============ */
.srh-center-bg {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
}

.srh-center-bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

.srh-center-overlay {
	position: absolute;
	inset: 0;
	background-color: transparent;
	opacity: 0;
	pointer-events: none;
}

/* ============ Revealed center: logo (fades in with panels) ============ */
.srh-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	pointer-events: none;
	opacity: var(--srh-center-opacity, 0);
	max-width: 90%;
	will-change: opacity;
}

.srh-main-logo {
	max-width: 100%;
	height: auto;
	display: block;
	user-select: none;
}

/* ============ Badge: centered overlay, above both panels, fades OUT on scroll ============ */
.srh-badge-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 10; /* above panels (z-index 3) */
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	/* Fades from 1 → 0 as --srh-progress goes 0 → 1 */
	opacity: calc(1 - var(--srh-progress, 0));
	will-change: opacity;
}

.srh-badge-logo {
	max-width: 100%;
	height: auto;
	display: block;
	user-select: none;
}

/* ============ Scroll arrow ============ */
.srh-scroll-arrow {
	position: absolute;
	bottom: 32px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center; /* Centers icon vertically when wrapper has a fixed height */
	gap: 4px;
	box-sizing: border-box;  /* Padding/border don't expand the wrapper unexpectedly */
	/* Fades out as panels open */
	opacity: calc(1 - var(--srh-progress, 0) * 2);
}

.srh-scroll-arrow svg,
.srh-scroll-arrow .srh-scroll-arrow-img {
	display: block;
	flex-shrink: 0;
}

.srh-scroll-arrow svg {
	width: 24px;
	height: 24px;
	color: #ffffff;
	animation: srh-bounce 1.6s ease-in-out infinite;
}

.srh-scroll-arrow .srh-scroll-arrow-img {
	animation: srh-bounce 1.6s ease-in-out infinite;
	object-fit: contain;
}

@keyframes srh-bounce {
	0%, 100% { transform: translateY(0); opacity: 0.5; }
	50%       { transform: translateY(6px); opacity: 1; }
}

/* ============ Panels ============ */
.srh-panel {
	position: absolute;
	top: 0;
	height: 100%;
	overflow: hidden;
	z-index: 3;
	will-change: transform;
	backface-visibility: hidden;
	/* No CSS transition — transform is driven directly by --srh-progress via scroll */
	transition: none;
}

.srh-panel-left {
	left: 0;
	width: 50%;
}

.srh-panel-right {
	right: 0;
	width: 50%;
}

/* Panel media (video or image fills the panel) */
.srh-panel .srh-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: 1;
	display: block;
}

.srh-panel .srh-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background-color: transparent;
	opacity: 0;
	pointer-events: none;
}

/* Sensible defaults that match the source site */
.srh-panel-left .srh-overlay {
	background-color: #a9b2b9;
	opacity: 0.5;
}

.srh-panel-right {
	background-color: #434551;
}

/* Panel text label */
.srh-panel-text {
	position: absolute;
	left: 50%;
	top: 92%;
	transform: translate(-50%, -50%);
	z-index: 4;
	text-align: center;
	white-space: normal;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 500;
	line-height: 1.4;
	pointer-events: none;
	margin: 0;
	width: 90%;
}

.srh-left-text  { color: #ffffff; }
.srh-right-text { color: #a9b2b9; }

/* ============ Scroll-driven transforms ============
 * Each panel's transform is a linear function of --srh-progress (0 → 1).
 * At progress=0 the panel is in place (covering); at progress=1 it has
 * travelled by --srh-travel (default 105%) in its chosen direction.
 */
.srh-panel[data-direction="left"]   { transform: translate3d(calc(var(--srh-progress) * var(--srh-travel) * -1), 0, 0); }
.srh-panel[data-direction="right"]  { transform: translate3d(calc(var(--srh-progress) * var(--srh-travel)),       0, 0); }
.srh-panel[data-direction="top"]    { transform: translate3d(0, calc(var(--srh-progress) * var(--srh-travel) * -1), 0); }
.srh-panel[data-direction="bottom"] { transform: translate3d(0, calc(var(--srh-progress) * var(--srh-travel)),       0); }

/* ============ Elementor editor preview ============
 * Inside the editor the outer is collapsed to viewport height and sticky is
 * disabled so the layout sits comfortably in the editor canvas. Default
 * progress is 0 so the user sees the panels (with their text + media) and
 * can edit them. To preview the revealed state, drag the editor wrapper.
 */
body.elementor-editor-active .srh-outer {
	height: 100vh !important;
}

body.elementor-editor-active .srh-sticky {
	position: relative;
	top: auto;
	height: 100%;
}

/* Default progress in editor: 0 = panels covering, slides fully visible */
body.elementor-editor-active .srh-wrapper {
	--srh-progress: 0;
	--srh-center-opacity: 0;
}

/* ============ Responsive tweaks ============ */
@media (max-width: 1024px) {
	.srh-panel-text {
		font-size: 13px;
	}
}

/* ============ Mobile vertical layout (≤ 810px) ============
 * Below 810px the two side-by-side panels become a stacked top/bottom layout
 * (top panel + bottom panel), but the animation stays HORIZONTAL: the top
 * panel slides off to the left and the bottom panel slides off to the right
 * — preserving the directional "opening" feel of the desktop animation.
 */
@media (max-width: 810px) {
	/* Top half = the "left" panel */
	.srh-panel-left {
		width: 100% !important;
		height: 50% !important;
		top: 0 !important;
		left: 0 !important;
	}
	/* Bottom half = the "right" panel */
	.srh-panel-right {
		width: 100% !important;
		height: 50% !important;
		top: 50% !important;
		left: 0 !important;
		right: auto !important;
		bottom: auto !important;
	}
	/* Animation: HORIZONTAL — top slides off left, bottom slides off right.
	   Override any data-direction value the author set for desktop. */
	.srh-wrapper .srh-panel-left[data-direction] {
		transform: translate3d(calc(var(--srh-progress) * var(--srh-travel) * -1), 0, 0);
	}
	.srh-wrapper .srh-panel-right[data-direction] {
		transform: translate3d(calc(var(--srh-progress) * var(--srh-travel)), 0, 0);
	}
	/* Text positioning: centre each label inside its half so it's visually
	   balanced and doesn't sit at the seam where the two panels meet. */
	.srh-panel-left .srh-panel-text,
	.srh-panel-right .srh-panel-text {
		top: 50% !important;
		bottom: auto !important;
	}
}

@media (max-width: 640px) {
	.srh-panel-text {
		font-size: 11px;
		letter-spacing: 0.06em;
	}
}

/* ============ Reduced motion ============
 * Disable scroll-pinning entirely; show the final revealed state immediately.
 */
@media (prefers-reduced-motion: reduce) {
	.srh-outer {
		height: 100vh !important;
	}
	.srh-sticky {
		position: relative;
	}
	.srh-wrapper {
		--srh-progress: 1;
		--srh-center-opacity: 1;
	}
}
