/*
 * photo-carousel block (PublicContentPhotoCarouselBlock): full-width scroll-snap strip, one photo per view, fixed aspect
 * ratio (no layout shift). Without JS a plain horizontal scroller; js/public-content-photo-cards.js shows the buttons,
 * the dots and (autoplay only) the pause/play button, all absolutely positioned over the photo.
 */
.public-content .content-block.content-block--photo-carousel {
	width: 100%;
}
.public-content .content-photo-carousel-head {
	width: min(var(--content-width), 100% - 2rem);
	margin: 0 auto;
}
.public-content .content-photo-carousel-viewport {
	position: relative;
	background: var(--content-text);
}
.public-content .content-photo-carousel-track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}
/* With scripting the buttons and dots replace the scrollbar; decided in CSS so nothing shifts when the script runs. */
@media (scripting: enabled) {
	.public-content .content-photo-carousel-track { scrollbar-width: none; }
	.public-content .content-photo-carousel-track::-webkit-scrollbar { display: none; }
}
.public-content .content-photo-carousel-track:focus-visible {
	outline: 3px solid var(--content-primary);
	outline-offset: -3px;
}
.public-content .content-photo-carousel-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}
.public-content .content-photo-carousel-figure {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.public-content .content-photo-carousel-figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.public-content .content-photo-carousel-caption {
	position: absolute;
	inset: auto 0 0 0;
	padding: 2.5rem 1rem 2.25rem;
	background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
	color: #fff;
	font-size: .95rem;
	line-height: 1.4;
}

/* Prev/next buttons over the photo's edges at its vertical middle (hidden until the script runs): the shared
   .content-nav-button (public-content.css); the viewport is the positioned box. */
.public-content .content-photo-carousel-viewport { --content-nav-inset: .75rem; }

.public-content .content-photo-carousel-dots {
	position: absolute;
	left: 50%;
	bottom: .75rem;
	transform: translateX(-50%);
	display: flex;
	gap: .1rem;
}
.public-content .content-photo-carousel-dots[hidden] { display: none; }
.public-content .content-photo-carousel-dot {
	/* 24px hit area around a small dot */
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.public-content .content-photo-carousel-dot::before {
	content: "";
	width: .5rem;
	height: .5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .6);
	transition: width .2s ease, background-color .2s ease;
}
.public-content .content-photo-carousel-dot[aria-current="true"]::before { width: 1.5rem; background: #fff; }
.public-content .content-photo-carousel-dot:focus-visible { outline: 2px solid #fff; outline-offset: 0; border-radius: var(--content-radius); }

/* Pause/play button of the autoplay (hidden until the script runs); bottom right, on the line of the dots. */
.public-content .content-photo-carousel-toggle {
	position: absolute;
	/* first in the DOM (focus order), so it needs a stacking level above the photos and captions */
	z-index: 1;
	right: .75rem;
	bottom: .5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: var(--content-radius);
	background: rgba(0, 0, 0, .55);
	color: #fff;
	cursor: pointer;
}
.public-content .content-photo-carousel-toggle[hidden] { display: none; }
.public-content .content-photo-carousel-toggle:hover { border-color: #fff; background: rgba(0, 0, 0, .75); }
.public-content .content-photo-carousel-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--content-primary); }
/* Pause icon: two bars; paused: a play triangle. */
.public-content .content-photo-carousel-toggle::before {
	content: "";
	box-sizing: border-box;
	width: .625rem;
	height: .75rem;
	border-left: .2rem solid currentColor;
	border-right: .2rem solid currentColor;
}
.public-content .content-photo-carousel-toggle.is-paused::before {
	width: 0;
	height: 0;
	margin-left: .15rem;
	border-style: solid;
	border-width: .375rem 0 .375rem .625rem;
	border-color: transparent transparent transparent currentColor;
}

/* Size "compact": a contained carousel at content width (at most 48rem), centered, with rounded corners. */
.public-content .content-photo-carousel--compact {
	width: min(48rem, 100% - 2rem);
	margin: 0 auto;
}
.public-content .content-photo-carousel--compact .content-photo-carousel-head { width: 100%; }
.public-content .content-photo-carousel--compact .content-photo-carousel-viewport {
	border-radius: var(--content-radius);
	overflow: hidden;
}

@media (min-width: 48rem) {
	.public-content .content-photo-carousel-figure { aspect-ratio: 16 / 9; }
	.public-content .content-photo-carousel-caption { padding: 3rem 1.5rem 2.75rem; font-size: 1rem; }
	.public-content .content-photo-carousel-viewport { --content-nav-inset: 1rem; }
	.public-content .content-photo-carousel-toggle { right: 1rem; }
}
/* compact keeps a calmer 3:2 photo from 48rem on (group photos); its extra class outweighs the full-size ratios. */
@media (min-width: 48rem) {
	.public-content .content-photo-carousel--compact .content-photo-carousel-figure { aspect-ratio: 3 / 2; }
}
@media (min-width: 75rem) {
	.public-content .content-photo-carousel-figure { aspect-ratio: 2 / 1; }
}
@media (prefers-reduced-motion: reduce) {
	.public-content .content-photo-carousel-track { scroll-behavior: auto; }
	.public-content .content-photo-carousel-dot::before { transition: none; }
}
