/**
 * Generic horizontal card slider mechanics (arrows, scroll viewport, dot
 * pager). Section-specific card styling (colors, badges, etc) lives in
 * that section's own stylesheet — see milestones.css for the current use.
 */

.card-slider {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
}

.card-slider__viewport {
	flex: 1 1 auto;
	min-width: 0;
}

.card-slider__track {
	display: flex;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0.25rem 0.25rem 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.card-slider__track::-webkit-scrollbar {
	display: none;
}

.card-slider__item {
	scroll-snap-align: start;
	flex: 0 0 calc((100% - 2 * 1.5rem) / 3);
	min-width: 0;
}

.card-slider__arrow {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background-color: var(--color-white);
	color: var(--color-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: background-color var(--transition-base);
}

.card-slider__arrow:hover,
.card-slider__arrow:focus-visible {
	background-color: var(--color-primary-tint);
}

.card-slider__arrow svg {
	width: 18px;
	height: 18px;
}

.card-slider__dots {
	position: absolute;
	left: 50%;
	bottom: -1.75rem;
	transform: translateX(-50%);
	display: flex;
	gap: 0.5rem;
}

/* Dots default to light-on-dark (for a navy section background like
   milestones.css). A slider on a light background should override these
   two colors in its own stylesheet. */

.card-slider__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background-color: rgba(255, 255, 255, 0.4);
	cursor: pointer;
}

.card-slider__dot.is-active {
	background-color: var(--color-white);
}

@media (max-width: 1000px) {
	.card-slider__item {
		flex-basis: calc((100% - 1.5rem) / 2);
	}
}

@media (max-width: 640px) {
	.card-slider__item {
		flex-basis: 88%;
	}

	.card-slider__arrow {
		width: 34px;
		height: 34px;
	}
}
