/**
 * Vive Slideshow — shared front-end styles.
 *
 * The admin preview loads this very file, so anything changed here changes the
 * preview and the live slideshow together. Keep them impossible to drift apart.
 */

.vs-slideshow {
	--vs-text-color: #fff;
	--vs-sub-size: 13px;
	--vs-title-size: 47px;
	--vs-speed: 900ms;
	--vs-pad-x: 70px;
	--vs-pad-y: 80px;

	position: relative;
	width: 100%;
	overflow: hidden;
	background: #111;
}

.vs-viewport {
	position: relative;
	width: 100%;
	height: 70vh;
	overflow: hidden;
}

/* ---------------------------------------------------------------- slides */

.vs-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--vs-speed) ease, visibility 0s linear var(--vs-speed);
}

.vs-slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity var(--vs-speed) ease, visibility 0s;
	z-index: 2;
}

.vs-transition-slide .vs-slide {
	opacity: 1;
	visibility: visible;
	transform: translateX(100%);
	transition: transform var(--vs-speed) cubic-bezier(0.65, 0, 0.35, 1);
}

.vs-transition-slide .vs-slide.is-active {
	transform: translateX(0);
}

.vs-transition-slide .vs-slide.is-leaving-left {
	transform: translateX(-100%);
}

/*
 * The whole point of the plugin: the photo always covers the frame and the
 * focal point decides what survives the crop. No pixel offsets anywhere.
 */
.vs-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--vs-focus-x, 50%) var(--vs-focus-y, 50%);
}

.vs-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, calc(var(--vs-overlay, 0.25) * 1.6)) 0%,
		rgba(0, 0, 0, var(--vs-overlay, 0.25)) 45%,
		rgba(0, 0, 0, calc(var(--vs-overlay, 0.25) * 0.35)) 100%
	);
	pointer-events: none;
}

/* --------------------------------------------------------------- caption */

.vs-caption {
	position: absolute;
	inset: 0;
	display: flex;
	padding: var(--vs-pad-y) var(--vs-pad-x);
	pointer-events: none;
}

.vs-caption-inner {
	pointer-events: auto;
	max-width: 46rem;
}

.vs-text-bottom-left .vs-caption {
	align-items: flex-end;
	justify-content: flex-start;
	text-align: left;
}

.vs-text-bottom-center .vs-caption {
	align-items: flex-end;
	justify-content: center;
	text-align: center;
}

.vs-text-center .vs-caption {
	align-items: center;
	justify-content: center;
	text-align: center;
}

.vs-sub,
.vs-title,
.vs-btn {
	color: var(--vs-text-color);
}

.vs-sub {
	display: block;
	margin: 0 0 0.4em;
	font-size: var(--vs-sub-size);
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.vs-title {
	margin: 0;
	font-size: var(--vs-title-size);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -1px;
}

.vs-title a {
	color: inherit;
	text-decoration: none;
}

.vs-title a:hover,
.vs-title a:focus {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.vs-btn {
	display: inline-block;
	margin-top: 1.4em;
	padding: 0.85em 2em;
	border: 1px solid currentColor;
	font-size: 13px;
	line-height: 1;
	letter-spacing: 2px;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.vs-btn:hover,
.vs-btn:focus {
	background: var(--vs-text-color);
	color: #111;
}

/* ------------------------------------------------------------ navigation */

.vs-nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.28);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.vs-nav:hover,
.vs-nav:focus-visible {
	background: rgba(0, 0, 0, 0.6);
}

.vs-prev {
	left: 24px;
}

.vs-next {
	right: 24px;
}

.vs-nav-icon {
	display: block;
	width: 12px;
	height: 12px;
	border-top: 1px solid currentColor;
	border-right: 1px solid currentColor;
}

.vs-prev .vs-nav-icon {
	transform: rotate(-135deg);
	margin-left: 4px;
}

.vs-next .vs-nav-icon {
	transform: rotate(45deg);
	margin-right: 4px;
}

.vs-dots {
	position: absolute;
	right: 0;
	bottom: 26px;
	left: 0;
	z-index: 5;
	display: flex;
	gap: 10px;
	justify-content: center;
}

.vs-dot {
	width: 30px;
	height: 3px;
	padding: 0;
	border: 0;
	background: rgba(255, 255, 255, 0.42);
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.vs-dot.is-active,
.vs-dot:hover {
	background: #fff;
}

.vs-empty {
	padding: 3rem 1rem;
	color: #666;
	font-family: system-ui, sans-serif;
	text-align: center;
}

/* ----------------------------------------------------------- breakpoints */
/* These two widths must stay in sync with VS_Render::instance_css(). */

@media (max-width: 1024px) {
	.vs-slideshow {
		--vs-pad-x: 30px;
		--vs-pad-y: 50px;
	}

	.vs-nav {
		width: 44px;
		height: 44px;
	}

	.vs-prev {
		left: 12px;
	}

	.vs-next {
		right: 12px;
	}
}

@media (max-width: 767px) {
	.vs-slideshow {
		--vs-pad-x: 20px;
		--vs-pad-y: 40px;
	}

	/* The mobile focal point, which may differ from the desktop one. */
	.vs-img {
		object-position: var(--vs-focus-mx, var(--vs-focus-x, 50%)) var(--vs-focus-my, var(--vs-focus-y, 50%));
	}

	.vs-caption-inner {
		max-width: 100%;
	}

	.vs-btn {
		margin-top: 1.1em;
		padding: 0.75em 1.5em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vs-slide {
		transition-duration: 1ms;
	}
}
