/**
 * Viewport Image Transition — frontend styles.
 *
 * All animation is GPU-friendly (opacity / transform only).
 */

.vit-wrapper {
	position: relative;
	width: 100%;
	height: var(--vit-height, 600px);
	overflow: hidden;
	isolation: isolate;
	/* Default custom-property values (overridden by Elementor selectors). */
	--vit-duration: 1000ms;
	--vit-scale: 1.1;
	--vit-kb-scale: 1.15;
	--vit-kb-time: 6s;
}

.vit-slides {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.vit-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	will-change: opacity;
	transition: opacity var(--vit-duration) ease;
	z-index: 1;
}

.vit-image.active {
	opacity: 1;
	z-index: 2;
}

.vit-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-select: none;
	user-select: none;
}

/* ---- Fade Scale ---- */
.vit-effect-fade-scale .vit-image {
	transform: scale(var(--vit-scale, 1.1));
	transition: opacity var(--vit-duration) ease, transform var(--vit-duration) ease;
}

.vit-effect-fade-scale .vit-image.active {
	transform: scale(1);
}

/* ---- Cross Fade (both layers transition simultaneously; default opacity fade already cross-fades) ---- */
.vit-effect-cross-fade .vit-image {
	transition: opacity var(--vit-duration) ease-in-out;
}

/* ---- Ken Burns ---- */
.vit-kenburns .vit-image.active .vit-img {
	animation: vit-kenburns var(--vit-kb-time, 6s) ease forwards;
}

@keyframes vit-kenburns {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(var(--vit-kb-scale, 1.15));
	}
}

/* ---- Overlay ---- */
.vit-overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background-color: transparent;
}

/* ---- Link ---- */
.vit-link {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: block;
	text-decoration: none;
}

/* ---- Caption ---- */
.vit-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	margin: 0;
	color: #fff;
}

/* ---- Progress ---- */
.vit-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	z-index: 6;
	background-color: rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.vit-progress-bar {
	display: block;
	width: 100%;
	height: 100%;
	transform: scaleX(0);
	transform-origin: left center;
	background-color: #fff;
	will-change: transform;
}

/* ---- Dots ---- */
.vit-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	z-index: 7;
	display: flex;
	gap: 8px;
	justify-content: center;
	align-items: center;
	padding: 0;
	margin: 0;
}

.vit-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background-color: rgba(255, 255, 255, 0.5);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.vit-dot:hover,
.vit-dot:focus-visible {
	transform: scale(1.15);
	outline: none;
}

.vit-dot.active {
	background-color: #fff;
	transform: scale(1.2);
}

/* ---- Scroll / swipe lock ----
   Intentionally NO CSS here. Holding the page is done entirely in JS via a
   selective preventDefault(), and is dropped the moment the first/last image
   is reached. Do NOT add "overscroll-behavior" or "touch-action" to the
   wrapper: combined with its "overflow: hidden" the browser would treat it as
   a scroll port and swallow the wheel/touch, so the page could never scroll
   past the widget even when the JS has stopped intercepting. */

/* ---- Reduced motion: show first image only, no transitions ---- */
@media (prefers-reduced-motion: reduce) {
	.vit-image,
	.vit-effect-fade-scale .vit-image {
		transition: none !important;
		transform: none !important;
	}

	.vit-kenburns .vit-image.active .vit-img {
		animation: none !important;
	}

	.vit-image {
		opacity: 0;
	}

	.vit-image.active {
		opacity: 1;
	}

	.vit-progress {
		display: none;
	}
}
