/**
 * MDA Site Tools: lightweight carousel. Colors come from The7's theme options.
 *
 * .mda-carousel (--mda-per-view: slides visible; --mda-carousel-gap)
 *   .mda-carousel__track, .mda-carousel__slide
 *   .mda-carousel__nav (arrows + dots), .mda-carousel__arrow (--prev / --next),
 *   .mda-carousel__dots, .mda-carousel__dot (.is-active)
 * Wide screens: arrows at the sides (or below with .mda-carousel--arrows-below).
 * Narrower: arrows beside the dots, below.
 */

.mda-carousel {
	--mda-per-view: 1;
	--mda-carousel-gap: 30px;
	--mda-carousel-accent: var(--the7-accent-bg-color, var(--the7-accent-color, #1e73be));
	position: relative;
	margin: 0 0 1.5em;
}

.mda-carousel__track {
	display: flex;
	gap: var(--mda-carousel-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.mda-carousel__track::-webkit-scrollbar {
	display: none;
}

.mda-carousel__slide {
	flex: 0 0 calc((100% - (var(--mda-per-view) - 1) * var(--mda-carousel-gap)) / var(--mda-per-view));
	min-width: 0;
	scroll-snap-align: start;
}

/* Controls bar under the slides (dots; arrows too on narrower screens) */
.mda-carousel__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 18px;
}

/* Arrows: round buttons in the accent color */
.mda-carousel__arrow {
	z-index: 2;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mda-carousel-accent);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mda-carousel__arrow:hover,
.mda-carousel__arrow:focus-visible {
	transform: scale(1.08);
}

.mda-carousel__arrow:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

.mda-carousel__arrow::before {
	content: "";
	width: 10px;
	height: 10px;
	border-top: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

.mda-carousel__arrow--prev::before {
	margin-left: 4px;
	transform: rotate(-135deg);
}

.mda-carousel__arrow--next::before {
	margin-right: 4px;
	transform: rotate(45deg);
}

/* Wide screens: arrows move out to the sides, vertically centered on the slides */
@media (min-width: 1101px) {
	.mda-carousel:not(.mda-carousel--arrows-below) .mda-carousel__nav.has-arrows .mda-carousel__arrow {
		position: absolute;
		top: calc(50% - 14px); /* centered on the slides, above the dots */
		margin-top: -22px;
	}

	.mda-carousel:not(.mda-carousel--arrows-below) .mda-carousel__nav.has-arrows {
		margin-top: 0;
		min-height: 0;
	}

	.mda-carousel:not(.mda-carousel--arrows-below) .mda-carousel__nav.has-arrows .mda-carousel__dots {
		margin-top: 18px;
	}

	.mda-carousel__arrow--prev {
		left: -22px;
	}

	.mda-carousel__arrow--next {
		right: -22px;
	}

	.mda-carousel__nav.has-arrows .mda-carousel__arrow:hover,
	.mda-carousel__nav.has-arrows .mda-carousel__arrow:focus-visible {
		transform: scale(1.08);
	}
}

/* Dots */
.mda-carousel__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.mda-carousel__dots[hidden] {
	display: none;
}

.mda-carousel__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mda-carousel-accent);
	opacity: 0.3;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mda-carousel__dot.is-active {
	opacity: 1;
	transform: scale(1.2);
}

.mda-carousel.is-single .mda-carousel__nav {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.mda-carousel__track {
		scroll-behavior: auto;
	}
}
