/* Home page carousel: [workscafe_carousel], see inc/carousel.php. */

/* Slides are transparent layers over the backdrop, which repeats at its
   natural size behind the whole carousel and stays put as slides move.
   --workscafe-carousel-clear: space above the slides that keeps them clear of
   the fixed header and logo; set by carousel.js. */
.workscafe-carousel {
	--workscafe-carousel-fg: #f6ecd3;
	position: relative;
	padding-top: var(--workscafe-carousel-clear, 0px);
	background-color: var(--workscafe-carousel-bg, #153f2a);
	background-image: var(--workscafe-carousel-backdrop, none);
	background-size: var(--workscafe-carousel-backdrop-size, auto);
	background-position: center top;
	background-repeat: repeat;
}

.workscafe-carousel__viewport {
	position: relative;
}

.workscafe-carousel__track {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

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

/* Each slide spans the carousel, so the transparent artwork travels across
   the whole width instead of being clipped at its own edges mid-transition. */
.workscafe-carousel__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.workscafe-carousel__art {
	max-width: 1050px;
	margin: 0 auto;
	aspect-ratio: 1050 / 600;
}

.workscafe-carousel__art picture,
.workscafe-carousel__link {
	display: block;
	width: 100%;
	height: 100%;
}

.workscafe-carousel .workscafe-carousel__image {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 600px) {
	.workscafe-carousel.has-mobile .workscafe-carousel__art {
		aspect-ratio: 3 / 4;
	}
}

/* Controls: a strip below the slides, so they never cover slide content.
   Hidden until the script is running; without it the track still swipes. */
.workscafe-carousel__controls {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 8px 12px;
}

.workscafe-carousel.is-ready .workscafe-carousel__controls {
	display: flex;
}

.workscafe-carousel button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--workscafe-carousel-fg);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.workscafe-carousel button:focus-visible {
	outline: 2px solid var(--workscafe-carousel-fg);
	outline-offset: 2px;
}

.workscafe-carousel button svg {
	display: block;
	fill: currentColor;
}

.workscafe-carousel__arrow,
.workscafe-carousel__toggle {
	width: 36px;
	height: 36px;
}

.workscafe-carousel__arrow svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.workscafe-carousel__arrow:hover,
.workscafe-carousel__toggle:hover {
	background: rgba(246, 236, 211, 0.15);
}

.workscafe-carousel__toggle {
	margin-right: 6px;
}

.workscafe-carousel__icon-play,
.workscafe-carousel.is-paused .workscafe-carousel__icon-pause {
	display: none !important;
}

.workscafe-carousel.is-paused .workscafe-carousel__icon-play {
	display: block !important;
}

/* 24px targets around a 10px dot. */
.workscafe-carousel__dot {
	width: 24px;
	height: 24px;
}

.workscafe-carousel__dot::before {
	content: "";
	width: 10px;
	height: 10px;
	border: 2px solid var(--workscafe-carousel-fg);
	border-radius: 50%;
	box-sizing: border-box;
	transition: background-color 0.2s;
}

.workscafe-carousel__dot:hover::before {
	background-color: rgba(246, 236, 211, 0.5);
}

.workscafe-carousel__dot[aria-current="true"]::before {
	background-color: var(--workscafe-carousel-fg);
}

.workscafe-carousel__arrow--prev {
	margin-right: 4px;
}

.workscafe-carousel__arrow--next {
	margin-left: 4px;
}

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

	.workscafe-carousel__dot::before {
		transition: none;
	}
}
