/**
 * Video Slider block styles.
 */

.ortega-video-slider {
	--ortega-vs-yellow: var(--ortega-color-yellow, #ffe400);
	--ortega-vs-yellow-hover: #ffd000;
	--ortega-vs-yellow-progress: #e6c800;
	--ortega-vs-blue: var(--ortega-color-blue, #0058a4);
	--ortega-vs-blue-dark: var(--ortega-color-blue-dark, #093272);
	--ortega-vs-blue-darker: #092450;
	--ortega-vs-dot: #9fc6e8;
	--ortega-vs-progress: var(--ortega-vs-blue-dark);
	--ortega-vs-play-size: clamp(72px, 18vw, 116px);
	--ortega-vs-frame-max: 1440px;
	/* Match shared module gutters (Shop the Lineup, Featured Recipes, etc.). */
	--ortega-vs-pad-x: clamp(1rem, 4vw, 3rem);

	background: transparent;
	box-sizing: border-box;
	color: var(--ortega-vs-blue-dark);
	margin: 0 auto;
	max-width: 100%;
	padding: clamp(1.5rem, 4vw, 3rem) 0;
	position: relative;
	width: 100%;
}

.ortega-video-slider *,
.ortega-video-slider *::before,
.ortega-video-slider *::after {
	box-sizing: border-box;
}

.ortega-video-slider__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(1rem, 3vw, 1.5rem);
	margin-inline: auto;
	max-width: min(var(--ortega-vs-frame-max), 100%);
	padding-inline: var(--ortega-vs-pad-x);
	position: relative;
	width: 100%;
}

.ortega-video-slider__frame {
	/* Mobile mask viewBox 353×480 — width fills content, height follows AR */
	aspect-ratio: 353 / 480;
	height: auto;
	isolation: isolate;
	margin-inline: auto;
	max-width: 100%;
	position: relative;
	width: 100%;
}

.ortega-video-slider__viewport {
	height: 100%;
	inset: 0;
	mask-image: url("../images/video-slider/mask-mobile.svg");
	mask-mode: alpha;
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: contain;
	-webkit-mask-image: url("../images/video-slider/mask-mobile.svg");
	-webkit-mask-position: center;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	overflow: hidden;
	position: absolute;
	width: 100%;
}

.ortega-video-slider__slide {
	height: 100%;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transition: opacity 0.45s ease;
	visibility: hidden;
	width: 100%;
	z-index: 0;
}

.ortega-video-slider__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	visibility: visible;
	z-index: 1;
}

.ortega-video-slider__media {
	height: 100%;
	inset: 0;
	overflow: hidden;
	position: absolute;
	width: 100%;
}

.ortega-video-slider__poster,
.ortega-video-slider__video {
	display: block;
	height: 100%;
	inset: 0;
	max-width: none;
	min-height: 100%;
	min-width: 100%;
	object-fit: cover;
	object-position: center;
	position: absolute;
	width: 100%;
}

.ortega-video-slider__video {
	opacity: 0;
	transition: opacity 0.35s ease;
}

.ortega-video-slider__video.is-ready {
	opacity: 1;
}

.ortega-video-slider.is-poster-only .ortega-video-slider__video {
	display: none;
}

.ortega-video-slider__play {
	align-items: center;
	appearance: none;
	background: transparent;
	background-color: transparent;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	height: var(--ortega-vs-play-size);
	justify-content: center;
	left: 50%;
	padding: 0;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(var(--ortega-vs-play-size) * 116 / 109);
	z-index: 3;
}

/* Override global button:hover background (style.css) — color lives on the SVG blob only. */
.ortega-video-slider__play:hover,
.ortega-video-slider__play:focus-visible,
.ortega-video-slider__play:active {
	background: transparent;
	background-color: transparent;
}

.ortega-video-slider__play:focus-visible {
	outline: 3px solid var(--ortega-vs-blue);
	outline-offset: 4px;
}

.ortega-video-slider__play-icon {
	color: var(--ortega-vs-yellow);
	display: grid;
	height: 100%;
	place-items: center;
	position: relative;
	transform: scale(1);
	transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
	width: 100%;
	will-change: transform;
}

.ortega-video-slider__play:hover .ortega-video-slider__play-icon,
.ortega-video-slider__play:focus-visible .ortega-video-slider__play-icon {
	transform: scale(1.1);
}

.ortega-video-slider__play-shape {
	color: var(--ortega-vs-yellow);
	display: block;
	grid-area: 1 / 1;
	height: 100%;
	transition: color 0.25s ease;
	width: 100%;
}

.ortega-video-slider__play:hover .ortega-video-slider__play-shape,
.ortega-video-slider__play:focus-visible .ortega-video-slider__play-shape {
	color: var(--ortega-vs-yellow-hover);
}

.ortega-video-slider__play-triangle {
	color: var(--ortega-vs-blue);
	display: block;
	grid-area: 1 / 1;
	height: 38%;
	margin-left: 5%;
	overflow: visible;
	width: auto;
}

.ortega-video-slider__nav {
	display: flex;
	justify-content: center;
	width: 100%;
}

.ortega-video-slider__pills {
	display: none;
}

.ortega-video-slider__dots {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ortega-video-slider__dot {
	appearance: none;
	background: var(--ortega-vs-dot);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	display: block;
	flex: 0 0 auto;
	height: 10px;
	overflow: hidden;
	padding: 0;
	position: relative;
	transition:
		width 0.3s ease,
		background-color 0.3s ease;
	width: 10px;
}

.ortega-video-slider__dot.is-active {
	background: var(--ortega-vs-dot);
	width: 48px;
}

.ortega-video-slider__dot:focus-visible {
	outline: 2px solid var(--ortega-vs-blue);
	outline-offset: 3px;
}

.ortega-video-slider__dot-track {
	display: block;
	height: 100%;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.ortega-video-slider__dot-fill {
	background: var(--ortega-vs-progress);
	display: block;
	height: 100%;
	left: 0;
	position: absolute;
	top: 0;
	transform: scaleX(0);
	transform-origin: left center;
	width: 100%;
	will-change: transform;
}

.ortega-video-slider__dot:not(.is-active) .ortega-video-slider__dot-fill {
	transform: scaleX(0) !important;
}

.ortega-video-slider__pill {
	align-items: center;
	appearance: none;
	background: var(--ortega-vs-blue-dark);
	border: 0;
	border-radius: 999px;
	color: var(--ortega-vs-yellow);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--ortega-font-body);
	font-size: clamp(14px, 1.2vw, 18px);
	font-weight: 700;
	justify-content: center;
	letter-spacing: 0.01em;
	line-height: 1.1;
	min-height: 44px;
	overflow: hidden;
	padding: 0.65rem 1.35rem;
	position: relative;
	transition:
		background-color 0.25s ease,
		color 0.25s ease;
	white-space: nowrap;
}

.ortega-video-slider__pill.is-active {
	background: var(--ortega-vs-yellow);
	color: var(--ortega-vs-blue-dark);
}

/* Override global button:hover background (style.css). */
.ortega-video-slider__pill:hover,
.ortega-video-slider__pill:focus-visible,
.ortega-video-slider__pill:active {
	background: var(--ortega-vs-blue-darker);
	background-color: var(--ortega-vs-blue-darker);
	color: var(--ortega-vs-yellow);
}

.ortega-video-slider__pill.is-active:hover,
.ortega-video-slider__pill.is-active:focus-visible,
.ortega-video-slider__pill.is-active:active {
	background: var(--ortega-vs-yellow);
	background-color: var(--ortega-vs-yellow);
	color: var(--ortega-vs-blue-dark);
}

.ortega-video-slider__pill:focus-visible {
	outline: 2px solid var(--ortega-vs-blue);
	outline-offset: 3px;
}

.ortega-video-slider__pill-label {
	position: relative;
	z-index: 1;
}

.ortega-video-slider__pill-track {
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

.ortega-video-slider__pill-fill {
	background: var(--ortega-vs-yellow-progress);
	display: block;
	height: 100%;
	left: 0;
	opacity: 0;
	position: absolute;
	top: 0;
	transform: scaleX(0);
	transform-origin: left center;
	width: 100%;
	will-change: transform;
}

.ortega-video-slider__pill.is-active .ortega-video-slider__pill-fill {
	opacity: 1;
}

.ortega-video-slider__pill:not(.is-active) .ortega-video-slider__pill-fill {
	transform: scaleX(0) !important;
}

.ortega-video-slider-placeholder {
	background: #f3f7fb;
	border: 1px dashed #9fc6e8;
	border-radius: 12px;
	color: var(--ortega-vs-blue-dark);
	font-family: var(--ortega-font-body);
	padding: 2rem;
	text-align: center;
}

/* Lightbox — mirrors Video Hero / SDI pattern */
.ortega-video-slider-lightbox {
	inset: 0;
	position: fixed;
	z-index: 100000;
}

.ortega-video-slider-lightbox[hidden] {
	display: none;
}

.ortega-video-slider-lightbox.is-open {
	display: block;
}

.ortega-video-slider-lightbox__backdrop {
	background: rgb(0 0 0 / 88%);
	inset: 0;
	position: absolute;
}

.ortega-video-slider-lightbox__dialog {
	display: flex;
	flex-direction: column;
	inset: 0;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
	position: absolute;
}

.ortega-video-slider-lightbox__close {
	align-items: center;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	height: 36px;
	justify-content: center;
	line-height: 0;
	margin: 0 0 12px auto;
	outline: none;
	padding: 0;
	width: 36px;
}

.ortega-video-slider-lightbox__close:hover,
.ortega-video-slider-lightbox__close:focus-visible,
.ortega-video-slider-lightbox__close:active {
	background-color: transparent;
	color: var(--ortega-vs-yellow);
	outline: none;
}

.ortega-video-slider-lightbox__close-icon {
	display: block;
	height: 36px;
	width: 36px;
}

.ortega-video-slider-lightbox__dialog:focus {
	outline: none;
}

.ortega-video-slider-lightbox__player {
	aspect-ratio: 16 / 9;
	margin: 0 auto;
	max-height: calc(100vh - 96px);
	max-width: min(1200px, 100%);
	position: relative;
	width: 100%;
}

.ortega-video-slider-lightbox__player iframe {
	border: 0;
	display: block;
	height: 100%;
	inset: 0;
	position: absolute;
	width: 100%;
}

body.ortega-video-slider-lightbox-open {
	overflow: hidden;
}

@media (min-width: 782px) {
	.ortega-video-slider {
		--ortega-vs-pad-x: 32px;
		--ortega-vs-play-size: clamp(88px, 8vw, 116px);
		padding: clamp(2rem, 4vw, 4rem) 0;
	}

	.ortega-video-slider__inner {
		gap: 0;
	}

	.ortega-video-slider__frame {
		/* Desktop mask viewBox 1366×766 — width fills content, height follows AR */
		aspect-ratio: 1366 / 766;
		width: 100%;
	}

	.ortega-video-slider__viewport {
		mask-image: url("../images/video-slider/mask-desktop.svg");
		-webkit-mask-image: url("../images/video-slider/mask-desktop.svg");
	}

	.ortega-video-slider__nav {
		bottom: calc(clamp(1.25rem, 3vw, 2.25rem) + 40px);
		justify-content: flex-end;
		/* Align with the padded frame (absolute children ignore parent padding). */
		left: var(--ortega-vs-pad-x);
		padding-inline: clamp(1.5rem, 3vw, 2.5rem);
		padding-inline-end: calc(clamp(1.5rem, 3vw, 2.5rem) + 40px);
		pointer-events: none;
		position: absolute;
		right: var(--ortega-vs-pad-x);
		width: auto;
		z-index: 4;
	}

	.ortega-video-slider__pills {
		display: flex;
		flex-wrap: wrap;
		gap: 0.65rem;
		justify-content: flex-end;
		max-width: min(100%, 720px);
		pointer-events: auto;
	}

	.ortega-video-slider__dots {
		display: none;
	}

	.ortega-video-slider-lightbox__close,
	.ortega-video-slider-lightbox__close-icon {
		height: 48px;
		width: 48px;
	}
}

@media (min-width: 1200px) {
	.ortega-video-slider {
		--ortega-vs-pad-x: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ortega-video-slider__slide,
	.ortega-video-slider__video,
	.ortega-video-slider__play-icon,
	.ortega-video-slider__play-shape,
	.ortega-video-slider__dot,
	.ortega-video-slider__pill {
		transition: none;
	}

	.ortega-video-slider__play:hover .ortega-video-slider__play-icon,
	.ortega-video-slider__play:focus-visible .ortega-video-slider__play-icon {
		transform: none;
	}

	.ortega-video-slider__pill.is-active {
		transform: none;
	}
}
