.csb {
	--csb-gap: 1rem;
	--csb-inactive: 0.55;
	--csb-arrow-bg: rgba(255, 255, 255, 0.92);
	--csb-arrow-ink: #1a1a1a;
	position: relative;
	width: 100%;
}
.csb__stage { position: relative; }
.csb:not(.csb--single) { max-width: var(--csb-max, none); margin-left: auto; margin-right: auto; }
.csb--single .csb__stage { max-width: var(--csb-max, none); margin-left: auto; margin-right: auto; }
.csb__track {
	display: flex;
	gap: var(--csb-gap);
	margin: 0;
	padding: 0 calc((100% - var(--csb-w)) / 2);
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.csb__track::-webkit-scrollbar { display: none; }
.csb__track:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.csb__slide {
	flex: 0 0 var(--csb-w);
	margin: 0;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	aspect-ratio: var(--csb-ratio);
	overflow: hidden;
	opacity: var(--csb-inactive);
	transition: opacity 0.4s ease;
}
.csb__slide.is-active { opacity: 1; }
.csb__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	user-select: none;
	-webkit-user-drag: none;
}
.csb__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--csb-arrow-bg);
	color: var(--csb-arrow-ink);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease;
}
.csb__arrow--prev { left: 1rem; }
.csb__arrow--next { right: 1rem; }
.csb__arrow[disabled] { opacity: 0; pointer-events: none; }
.csb__thumbs {
	display: flex;
	gap: var(--csb-thumb-gap, 0.5rem);
	justify-content: flex-start;
	margin-top: 0.5rem;
	/* Room around the thumbnails so the outline and underline are not clipped by the scroll area. */
	padding: 0.75rem 1rem 1.75rem;
	overflow-x: auto;
	scrollbar-width: none;
}
.csb__thumbs::-webkit-scrollbar { display: none; }
/* Centre a short strip, but let a long one scroll from its first thumbnail (plain centring would cut the start off). */
.csb__thumb:first-child { margin-left: auto; }
.csb__thumb:last-child { margin-right: auto; }
.csb__thumb {
	flex: 0 0 var(--csb-thumb-w, 5.5rem);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	position: relative;
	aspect-ratio: 3 / 2;
	cursor: pointer;
	opacity: 0.5;
	outline: 3px solid transparent;
	outline-offset: 2px;
	transition: opacity 0.25s ease, outline-color 0.25s ease;
}
.csb__thumb::after {
	content: '';
	position: absolute;
	left: -3px;
	right: -3px;
	bottom: -1.1rem;
	height: 3px;
	background: currentColor;
	opacity: 0;
	transition: opacity 0.25s ease;
}
.csb__thumb.is-active::after { opacity: 1; }
.csb__thumb:hover { opacity: 0.8; }
.csb__thumb.is-active { opacity: 1; outline-color: currentColor; }
.csb__thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.csb__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1rem;
}
.csb__dot {
	width: 0.6rem;
	height: 0.6rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: currentColor;
	opacity: 0.35;
	cursor: pointer;
}
.csb__dot.is-active { opacity: 1; }
/* Single image: one full-width landscape image, plain arrows out in the side gutters. */
.csb--single { padding: 0 4rem; }
.csb--single .csb__track { padding: 0; }
.csb--single .csb__slide { flex-basis: 100%; opacity: 1; }
.csb--single .csb__arrow {
	width: 2.5rem;
	background: var(--csb-arrow-bg-single, transparent);
	color: var(--csb-arrow-ink-single, currentColor);
}
.csb--single .csb__arrow--prev { left: -3.25rem; }
.csb--single .csb__arrow--next { right: -3.25rem; }
.csb--single .csb__arrow svg { width: 2rem; height: 2rem; stroke-width: 2.5; }
@media (max-width: 767px) {
	.csb--single { padding: 0; }
	.csb__track { padding: 0 calc((100% - var(--csb-w-m)) / 2); }
	.csb__slide { flex-basis: var(--csb-w-m); }
	.csb--single .csb__slide { flex-basis: 100%; }
	.csb__arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.csb__slide { transition: none; }
}
