/*
	Image slider (replaces LayerSlider and the Unite Gallery slider theme)
	Size: set --slider-ratio on the element, e.g. style="--slider-ratio: 1600 / 700"
*/
.image-slider {
	--slider-accent: var(--color-primary, #FFC412);
	position: relative;
	overflow: hidden;
	width: 100%;
	aspect-ratio: var(--slider-ratio, 16 / 9);
	background: #111;
	touch-action: pan-y;
	isolation: isolate;
}

.image-slider__slide {
	position: absolute;
	inset: 0;
	margin: 0;
}

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

/* Before the script runs (or without it) show the first slide only */
.image-slider:not(.is-ready) .image-slider__slide:not(:first-child) {
	visibility: hidden;
}

/* Fade */
.image-slider--fade .image-slider__slide {
	opacity: 0;
	transition: opacity .8s ease, visibility 0s linear .8s;
	visibility: hidden;
}
.image-slider--fade .image-slider__slide.is-active {
	opacity: 1;
	z-index: 2;
	transition: opacity .8s ease;
	visibility: visible;
}
.image-slider--fade .image-slider__slide.is-leaving {
	opacity: 1;
	z-index: 1;
	transition: none;
	visibility: visible;
}

/* Slide */
.image-slider--slide .image-slider__slide {
	transition: transform .6s cubic-bezier(.4, 0, .2, 1);
	will-change: transform;
}

/* Arrows */
.image-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%);
	transition: opacity .25s ease, background-color .25s ease;
}
.image-slider__arrow svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}
.image-slider__arrow--prev { left: 12px; }
.image-slider__arrow--next { right: 12px; }
.image-slider:hover .image-slider__arrow,
.image-slider__arrow:focus-visible {
	opacity: 1;
}
.image-slider__arrow:hover {
	background: rgba(0, 0, 0, .7);
}

/* Dots + play/pause */
.image-slider__dots {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .35);
	transform: translateX(-50%);
}
.image-slider__dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 2px solid var(--slider-accent);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.image-slider__dot[aria-current="true"] {
	background: var(--slider-accent);
}
.image-slider__play {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-left: 4px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--slider-accent);
	cursor: pointer;
}
.image-slider__play svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}
.image-slider__arrow:focus-visible,
.image-slider__dot:focus-visible,
.image-slider__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Progress bar */
.image-slider__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 3;
	width: 100%;
	height: 4px;
	background: var(--slider-accent);
	transform: scaleX(0);
	transform-origin: left center;
}
.image-slider__progress.is-running {
	animation-name: image-slider-progress;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}
@keyframes image-slider-progress {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* Home page banners */
.image-slider--hero {
	max-width: 1600px;
	margin: 0 auto;
}
.image-slider--content {
	border-radius: 10px;
}

@media (max-width: 575.98px) {
	.image-slider__arrow {
		width: 36px;
		height: 36px;
		opacity: 1;
	}
	.image-slider__dots {
		bottom: 8px;
		gap: 6px;
	}
	.image-slider__dot {
		width: 10px;
		height: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.image-slider__slide,
	.image-slider--fade .image-slider__slide,
	.image-slider--fade .image-slider__slide.is-active {
		transition: none;
	}
}
