/*
 * Ventureheap Builder - carousel.
 * The layout is CSS; the JS only moves the track and manages state, so a
 * carousel with JS disabled degrades to a horizontally scrollable row.
 */

.vhb-carousel {
	position: relative;
	display: block;
}

.vhb-carousel-viewport {
	overflow: hidden;
	/* Without JS the viewport becomes a touch-scrollable row. */
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.vhb-carousel-viewport::-webkit-scrollbar { display: none; }

.vhb-carousel.is-ready .vhb-carousel-viewport {
	overflow-x: hidden;
	scroll-snap-type: none;
}

.vhb-carousel-track {
	display: flex;
	gap: var(--vhb-gap);
	align-items: stretch;
	will-change: transform;
}

.vhb-carousel.is-ready .vhb-carousel-track {
	transition: transform .4s cubic-bezier(.22, .61, .36, 1);
}

.vhb-carousel.is-dragging .vhb-carousel-track { transition: none; }

.vhb-slide {
	flex: 0 0 auto;
	width: 100%;
	min-width: 0;
	scroll-snap-align: start;
}

.vhb-carousel.is-ready .vhb-slide {
	width: calc((100% - (var(--vhb-slides-gap, 24px) * (var(--vhb-slides, 1) - 1))) / var(--vhb-slides, 1));
}

.vhb-slide > * { height: 100%; }

/* Arrows ------------------------------------------------------------------ */
.vhb-carousel-arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	transform: translateY(-50%);
	background: var(--vhb-bg);
	color: var(--vhb-secondary);
	border: 1px solid var(--vhb-border);
	border-radius: 50%;
	box-shadow: var(--vhb-shadow);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background var(--vhb-transition), color var(--vhb-transition);
}

.vhb-carousel.is-ready .vhb-carousel-arrow { display: inline-flex; }

.vhb-carousel-arrow:hover:not(:disabled) { background: var(--vhb-primary); color: #fff; border-color: var(--vhb-primary); }

.vhb-carousel-arrow:disabled { opacity: .35; cursor: default; }

.vhb-carousel-prev { left: -8px; }
.vhb-carousel-next { right: -8px; }

/* Dots -------------------------------------------------------------------- */
.vhb-carousel-dots {
	display: none;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.vhb-carousel.is-ready .vhb-carousel-dots { display: flex; }

.vhb-carousel-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--vhb-border);
	cursor: pointer;
	transition: background var(--vhb-transition), width var(--vhb-transition);
}

.vhb-carousel-dot[aria-selected="true"] { background: var(--vhb-primary); width: 26px; border-radius: 5px; }

.vhb-carousel-dot:focus-visible { outline: 2px solid var(--vhb-primary); outline-offset: 2px; }

@media (min-width: 1280px) {
	.vhb-carousel-prev { left: -22px; }
	.vhb-carousel-next { right: -22px; }
}
