/**
 * Oravio Video Hero
 */

.oravio-video-hero {
	--oravio-video-hero-overlay: 0.38;
	--oravio-video-hero-focal-x: 50%;
	--oravio-video-hero-focal-y: 50%;
	--oravio-video-hero-blur: 9px;
	--oravio-video-percentage-opacity: 1;
	position: relative;
	isolation: isolate;
	overflow: clip;
	background: #111318;
}

.oravio-video-hero__media {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #20242c, #0f1116);
}

.oravio-video-hero__poster,
.oravio-video-hero__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position:
		var(--oravio-video-hero-focal-x)
		var(--oravio-video-hero-focal-y);
}

.oravio-video-hero__poster {
	position: relative;
	z-index: 1;
	transition:
		opacity 520ms cubic-bezier(.22,.68,.24,1),
		filter 520ms cubic-bezier(.22,.68,.24,1),
		transform 720ms cubic-bezier(.22,.68,.24,1);
}

.oravio-video-hero__video {
	position: absolute;
	inset: 0;
	z-index: 2;
	opacity: 0;
	transform: scale(1.006);
	transition:
		opacity 620ms cubic-bezier(.22,.68,.24,1),
		transform 900ms cubic-bezier(.22,.68,.24,1);
}

.oravio-video-hero__shade {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.oravio-video-hero--full .oravio-video-hero__shade {
	background:
		linear-gradient(
			90deg,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) + 0.20)) 0%,
			rgba(4, 7, 12, var(--oravio-video-hero-overlay)) 45%,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) * 0.72)) 100%
		);
}

.oravio-video-hero--full.oravio-video-hero--content-center
.oravio-video-hero__shade {
	background:
		linear-gradient(
			180deg,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) * 0.70)) 0%,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) + 0.10)) 78%,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) + 0.20)) 100%
		);
}

.oravio-video-hero__content {
	position: relative;
	z-index: 5;
	min-width: 0;
}

.oravio-video-hero__copy {
	width: min(100%, 760px);
}

.oravio-video-hero__copy > :first-child {
	margin-top: 0;
}

.oravio-video-hero__copy > :last-child {
	margin-bottom: 0;
}

/* Full bleed. */
.oravio-video-hero--full {
	min-height: clamp(620px, 86svh, 980px);
	display: grid;
}

.oravio-video-hero--full .oravio-video-hero__media {
	position: absolute;
	inset: 0;
}

.oravio-video-hero--full .oravio-video-hero__content {
	align-self: end;
	display: flex;
	width: min(
		calc(100% - clamp(2rem, 7vw, 7rem)),
		var(--wp--style--global--wide-size, 1320px)
	);
	margin-inline: auto;
	padding:
		clamp(8rem, 17vh, 13rem)
		0
		clamp(3.25rem, 8vh, 6.5rem);
	color: #fff;
}

.oravio-video-hero--full.oravio-video-hero--content-center
.oravio-video-hero__content {
	justify-content: center;
	text-align: center;
}

.oravio-video-hero--full.oravio-video-hero--content-center
.oravio-video-hero__copy {
	margin-inline: auto;
}

.oravio-video-hero--full.oravio-video-hero--content-center
.wp-block-buttons {
	justify-content: center;
}

.oravio-video-hero--full .oravio-eyebrow {
	color: rgba(255, 255, 255, 0.82);
}

.oravio-video-hero--full h1,
.oravio-video-hero--full h2,
.oravio-video-hero--full h3,
.oravio-video-hero--full p {
	color: inherit;
}

.oravio-video-hero--full h1 {
	max-width: 15ch;
	font-size: clamp(2.8rem, 7vw, 6.6rem);
	line-height: 0.98;
	letter-spacing: -0.042em;
}

.oravio-video-hero--full.oravio-video-hero--content-center h1 {
	margin-inline: auto;
}

.oravio-video-hero--full
.wp-block-button.is-style-outline
.wp-element-button {
	border-color: rgba(255, 255, 255, 0.72);
	color: #fff;
}

/* Split. */
.oravio-video-hero--split {
	display: grid;
	grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
	min-height: clamp(600px, 76svh, 860px);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	border-block: 1px solid var(--wp--preset--color--border);
}

.oravio-video-hero--split .oravio-video-hero__media {
	min-height: inherit;
}

.oravio-video-hero--split .oravio-video-hero__shade {
	background:
		linear-gradient(
			180deg,
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) * 0.18)),
			rgba(4, 7, 12, calc(var(--oravio-video-hero-overlay) * 0.44))
		);
}

.oravio-video-hero--split .oravio-video-hero__content {
	display: flex;
	align-items: center;
	padding:
		clamp(3rem, 7vw, 7rem)
		clamp(2rem, 6vw, 6rem);
}

.oravio-video-hero--split.oravio-video-hero--content-center
.oravio-video-hero__content {
	text-align: center;
	justify-content: center;
}

.oravio-video-hero--split.oravio-video-hero--content-center
.wp-block-buttons {
	justify-content: center;
}

/* Readiness + loader. */
.oravio-video-hero.is-loading .oravio-video-hero__poster {
	filter: blur(var(--oravio-video-hero-blur));
	transform: scale(1.012);
}

.oravio-video-hero.is-video-ready .oravio-video-hero__video {
	opacity: 1;
	transform: scale(1);
}

.oravio-video-hero.is-video-ready .oravio-video-hero__poster {
	opacity: 0;
	filter: blur(0);
	transform: scale(1);
}

.oravio-video-hero__loader {
	position: absolute;
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	z-index: 6;
	display: grid;
	grid-template-columns: minmax(110px, 210px) auto;
	align-items: center;
	gap: 0.8rem;
	width: min(330px, calc(100% - 2rem));
	padding: 0.8rem 0.95rem;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 999px;
	background: rgba(8, 11, 16, 0.52);
	color: #fff;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	opacity: 0;
	transform: translate(-50%, calc(-50% + 7px));
	pointer-events: none;
	transition:
		opacity 220ms ease,
		transform 220ms ease;
}

.oravio-video-hero.is-loading .oravio-video-hero__loader {
	opacity: 1;
	transform: translate(-50%, -50%);
}

.oravio-video-hero.is-video-ready .oravio-video-hero__loader,
.oravio-video-hero.is-poster-only .oravio-video-hero__loader {
	opacity: 0;
}

.oravio-video-hero__loader-label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.oravio-video-hero__loader-track {
	position: relative;
	height: 3px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.24);
}

.oravio-video-hero__loader-fill {
	position: absolute;
	inset: 0;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	will-change: transform;
}

.oravio-video-hero__loader-value {
	min-width: 2.6rem;
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-align: right;
}


/* Percentage loader: Huviplus-inspired, deliberately minimal. */
.oravio-video-hero--loader-percentage
.oravio-video-hero__loader {
	display: block;
	width: auto;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	color: var(--wp--preset--color--brand, #2357d8);
}


.oravio-video-hero--loader-percentage
.oravio-video-hero__loader {
	transition:
		opacity 600ms ease,
		transform 220ms ease;
}

.oravio-video-hero--loader-percentage
.oravio-video-hero__loader-track {
	display: none;
}

.oravio-video-hero--loader-percentage
.oravio-video-hero__loader-value {
	display: block;
	min-width: 0;
	font-size: clamp(3.5rem, 8vw, 7.5rem);
	line-height: 0.9;
	font-weight: 700;
	letter-spacing: -0.055em;
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: currentColor;
	text-shadow: 0 1px 18px rgba(0, 0, 0, 0.12);
	filter: none;
	opacity: var(--oravio-video-percentage-opacity);
	transform: none;
	will-change: opacity;
}

.has-loader-disabled .oravio-video-hero__loader {
	display: none;
}

/* Editor. */
.editor-styles-wrapper .oravio-video-hero--editor {
	min-height: 580px;
}

.editor-styles-wrapper
.oravio-video-hero--editor
.oravio-video-hero__media {
	pointer-events: none;
}

.editor-styles-wrapper
.oravio-video-hero__editor-placeholder-media {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #2b303a, #11141a);
}

.editor-styles-wrapper
.oravio-video-hero__editor-media-controls {
	position: absolute;
	z-index: 20;
	top: 1rem;
	left: 1rem;
	right: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0.65rem;
	border-radius: 0.85rem;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.editor-styles-wrapper
.oravio-video-hero--editor.oravio-video-hero--split
.oravio-video-hero__editor-media-controls {
	right: calc(42% + 1rem);
}

.editor-styles-wrapper
.oravio-video-hero--editor
.block-editor-inner-blocks,
.editor-styles-wrapper
.oravio-video-hero--editor
.block-editor-block-list__layout {
	position: relative;
	z-index: 10;
}

@media (max-width: 760px) {
	.oravio-video-hero--full {
		min-height: max(640px, 86svh);
	}

	.oravio-video-hero--full .oravio-video-hero__content {
		width: calc(100% - 2rem);
		padding-top: 8rem;
		padding-bottom: 2.75rem;
	}

	.oravio-video-hero--full h1 {
		font-size: clamp(2.6rem, 13vw, 4.6rem);
	}

	.oravio-video-hero--split {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.oravio-video-hero--split .oravio-video-hero__media {
		min-height: min(72svh, 680px);
	}

	.oravio-video-hero--split .oravio-video-hero__content {
		padding: clamp(2.25rem, 10vw, 4rem) 1.25rem;
	}

	.editor-styles-wrapper
	.oravio-video-hero--editor.oravio-video-hero--split
	.oravio-video-hero__editor-media-controls {
		right: 1rem;
	}

	.oravio-video-hero--loader-bar
	.oravio-video-hero__loader {
		width: min(300px, calc(100% - 2rem));
	}
}

@media (prefers-reduced-motion: reduce) {
	.oravio-video-hero__poster,
	.oravio-video-hero__video,
	.oravio-video-hero__loader {
		transition: none !important;
	}

	.oravio-video-hero__video,
	.oravio-video-hero__loader {
		display: none !important;
	}

	.oravio-video-hero__poster {
		opacity: 1 !important;
		filter: none !important;
		transform: none !important;
	}
}
