/*
 * Slider (block style fvei-slider): scroll-snap track from inc/slider.php,
 * controls from assets/js/slider.js. Values from Avada and Revolution Slider.
 */

.is-style-fvei-slider {
	position: relative;
}

.fvei-slider__track {
	display: flex;
	gap: var(--fvei-gap, 0px);
	max-width: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
}

/* Without JS the scrollbar stays, so a mouse reaches every slide. */
.is-ready > .fvei-slider__track {
	scrollbar-width: none;
}

.fvei-slider__track > * {
	flex: 0 0 calc((100% - (var(--fvei-per-view, 1) - 1) * var(--fvei-gap, 0px)) / var(--fvei-per-view, 1));
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.fvei-slider__track img {
	width: 100%;
}

.fvei-slider__arrow {
	position: absolute;
	top: 50%;
	left: 0;
	z-index: 1;
	width: 30px;
	height: 30px;
	margin: -15px 0 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	cursor: pointer;
}

.fvei-slider__arrow:hover {
	background: rgba(0, 0, 0, 0.8);
}

.fvei-slider__next {
	right: 0;
	left: auto;
}

/* Chevron, shifted against the rotation */
.fvei-slider__arrow::before {
	content: "";
	display: block;
	width: 30%;
	height: 30%;
	margin: auto;
	border: solid;
	border-width: 2px 2px 0 0;
	transform: translateX(20%) rotate(-135deg);
}

.fvei-slider__next::before {
	transform: translateX(-20%) rotate(45deg);
}

.fvei-slider__dots {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin: 15px 0 0;
}

.fvei-slider__dots button {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.fvei-slider__dots [aria-current=true] {
	background: rgba(0, 0, 0, 0.9);
}

/* bilder: arrows on hover or focus only */
.fvei-slider--bilder:not(:hover, :focus-within) .fvei-slider__arrow {
	opacity: 0;
}

/* hero: 1240 x 420, round arrows 20px from the edge, dots on the image */
.fvei-slider--hero img {
	aspect-ratio: 62 / 21;
	object-fit: cover;
}

.fvei-slider--hero .fvei-slider__arrow {
	width: 40px;
	height: 40px;
	margin: -20px 20px 0;
	border-radius: 50%;
}

.fvei-slider--hero .fvei-slider__dots {
	position: absolute;
	inset: auto 0 20px;
	gap: 5px;
	margin: 0;
}

.fvei-slider--hero .fvei-slider__dots button {
	width: 17px;
	height: 17px;
	border: 3px solid #e5e5e5;
	background: #bbb;
}

.fvei-slider--hero .fvei-slider__dots [aria-current=true] {
	background: #666;
}

/* Text box over all hero slides; the editor has no track and shows it below */
.fvei-hero {
	position: relative;
}

.fvei-hero:has(.fvei-slider__track) > .fvei-hero__text {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0;
	padding: 0.16em;
	transform: translate(-50%, calc(-50% - 0.4em));
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: clamp(15px, 3.5vw, 50px);
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	white-space: nowrap;
	pointer-events: none;
}

/* logos: 6 / 3 / 2 per view, padding of the Fusion image carousel */
.fvei-slider--logos {
	--fvei-per-view: 6;
	--fvei-gap: 32px;
	padding-block: 10px;
}

@media (max-width: 1024px) {
	.fvei-slider--logos {
		--fvei-per-view: 3;
	}
}

@media (max-width: 600px) {
	.fvei-slider--logos {
		--fvei-per-view: 2;
	}
}
