/* Hero Banner Slider - frontend
   Every rule is scoped under .hbs-slider so theme and page builder styles
   do not win over it. */

.hbs-slider {
	--hbs-speed: 600ms;
	--hbs-radius: 0px;
	--hbs-nav-size: 44px;
	--hbs-nav-bg: rgba(17, 17, 17, 0.42);
	--hbs-nav-bg-hover: rgba(17, 17, 17, 0.72);
	--hbs-nav-color: #fff;
	--hbs-dot: rgba(255, 255, 255, 0.5);
	--hbs-dot-active: #fff;

	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
	padding: 0;
	line-height: 0;
}

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

.hbs-slider.hbs-full-width {
	width: calc(100vw - var(--hbs-sbw, 0px));
	max-width: calc(100vw - var(--hbs-sbw, 0px));
	margin-left: calc(50% - (100vw - var(--hbs-sbw, 0px)) / 2);
	margin-right: calc(50% - (100vw - var(--hbs-sbw, 0px)) / 2);
}

.hbs-slider .hbs-viewport {
	position: relative;
	overflow: hidden;
	width: 100%;
	border-radius: var(--hbs-radius);
	background: #f2f2f2;
}

.hbs-slider .hbs-track {
	position: relative;
	width: 100%;
}

/* The first banner stays in the normal flow, so its own image gives the
   slider its height. Nothing can collapse it. The rest sit on top. */
.hbs-slider .hbs-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	visibility: hidden;
	will-change: transform, opacity;
}

.hbs-slider .hbs-slide:first-child {
	position: relative;
	height: auto;
}

.hbs-slider .hbs-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.hbs-slider .hbs-slide.is-leaving {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.hbs-slider .hbs-picture,
.hbs-slider .hbs-link {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	text-decoration: none;
}

.hbs-slider .hbs-slide img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: center;
}

.hbs-slider .hbs-slide:first-child img {
	height: auto;
}

/* Fixed shape mode adds an aspect ratio and takes the first slide out of flow. */
.hbs-slider.hbs-fixed-shape .hbs-slide:first-child {
	position: absolute;
	height: 100%;
}

.hbs-slider.hbs-fixed-shape .hbs-slide:first-child img {
	height: 100%;
}

/* Slide effect: parked off to the right until called in, clipped by the viewport. */
.hbs-slider.hbs-effect-slide .hbs-slide {
	opacity: 1;
	visibility: visible;
	transform: translateX(100%);
	transition: transform var(--hbs-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.hbs-slider.hbs-effect-slide .hbs-slide.is-active {
	transform: translateX(0);
}

/* Fade effect */
.hbs-slider.hbs-effect-fade .hbs-slide {
	transition: opacity var(--hbs-speed) ease;
}

.hbs-slider.hbs-effect-fade .hbs-slide.is-leaving {
	opacity: 0;
}

/* Arrows. Reset hard, themes style bare buttons aggressively. */
.hbs-slider .hbs-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hbs-nav-size);
	height: var(--hbs-nav-size);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hbs-nav-bg);
	background-image: none;
	box-shadow: none;
	color: var(--hbs-nav-color);
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.hbs-slider .hbs-nav:hover,
.hbs-slider .hbs-nav:focus-visible {
	background: var(--hbs-nav-bg-hover);
	color: var(--hbs-nav-color);
}

.hbs-slider .hbs-nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.hbs-slider .hbs-nav svg {
	width: 22px;
	height: 22px;
	display: block;
}

.hbs-slider .hbs-prev {
	left: 16px;
}

.hbs-slider .hbs-next {
	right: 16px;
}

.hbs-slider .hbs-nav[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* Dots */
.hbs-slider .hbs-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	line-height: 1;
}

.hbs-slider .hbs-dot {
	width: 9px;
	height: 9px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hbs-dot);
	background-image: none;
	box-shadow: none;
	font-size: 0;
	cursor: pointer;
	transition: width 0.25s ease, background 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.hbs-slider .hbs-dot.is-active {
	width: 24px;
	border-radius: 9px;
	background: var(--hbs-dot-active);
}

.hbs-slider .hbs-dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.hbs-slider.hbs-single .hbs-nav,
.hbs-slider.hbs-single .hbs-dots {
	display: none;
}

@media (max-width: 767px) {
	.hbs-slider {
		--hbs-nav-size: 36px;
	}

	.hbs-slider .hbs-prev {
		left: 8px;
	}

	.hbs-slider .hbs-next {
		right: 8px;
	}

	.hbs-slider .hbs-dots {
		bottom: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hbs-slider .hbs-slide {
		transition-duration: 1ms !important;
	}
}
