/* Image & Text block: auto-playing slideshow (inc/feature-slider.php). */

.feature-slider {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 2; /* stacked layout (phones): fixed shape, no jump when photos change */
	overflow: hidden;
	background-color: #e3e9df;
}

@media (min-width: 48rem) {
	/* Side by side with the text: fill the column, which is as tall as the text box. */
	.feature-slider {
		aspect-ratio: auto;
		min-height: 360px;
	}
}

.feature-slider__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.7s ease;
}

.feature-slider__slide.is-active {
	opacity: 1;
}

.feature-slider__img {
	display: block;
	width: 100%;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
}

.feature-slider__controls {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	border-radius: 50em;
	background: rgba(0, 0, 0, 0.28);
	transform: translateX(-50%);
}

.feature-slider__dot,
.feature-slider__toggle {
	display: block;
	padding: 0;
	border: 0;
	cursor: pointer;
	background: none;
}

.feature-slider__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.55);
	transition: background-color 0.2s, transform 0.2s;
}

.feature-slider__dot[aria-current="true"] {
	background-color: #fff;
	transform: scale(1.25);
}

/* Pause / play: two bars, or a triangle when paused. */
.feature-slider__toggle {
	position: relative;
	width: 10px;
	height: 11px;
}

.feature-slider__toggle::before,
.feature-slider__toggle::after {
	content: "";
	position: absolute;
	top: 0;
	width: 3px;
	height: 11px;
	background-color: #fff;
}

.feature-slider__toggle::before { left: 1px; }
.feature-slider__toggle::after { right: 1px; }

.feature-slider.is-paused .feature-slider__toggle::before {
	left: 1px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5.5px 0 5.5px 9px;
	border-color: transparent transparent transparent #fff;
	background: none;
}

.feature-slider.is-paused .feature-slider__toggle::after {
	display: none;
}

.feature-slider__dot:focus-visible,
.feature-slider__toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.feature-slider__slide {
		transition: none;
	}
}
