/**
 * XO Slider — structural front-end styles.
 *
 * This file owns mechanics only: layout, aspect ratios, transitions,
 * and functional control positioning. Colors, typography, button
 * appearance, shadows, border radii, and decorative overlays belong to
 * the active theme and are intentionally left unstyled (or minimally,
 * neutrally styled) here.
 */

.xo-slider {
	position: relative;
}

.xo-slider__track {
	position: relative;
}

.xo-slider.is-initialized .xo-slider__track {
	display: flex;
	transition: transform var(--xo-slider-transition-duration, 500ms) ease;
	will-change: transform;
}

.xo-slider.is-initialized .xo-slider__slide {
	display: block;
	flex: 0 0 100%;
	width: 100%;
}

.xo-slider__slide {
	position: relative;
	display: none;
}

/*
 * Before slider.js runs (e.g. the block editor preview, or the instant
 * before DOMContentLoaded on the front end), only the server-marked
 * active slide is shown, so the layout never shows every slide stacked.
 */
.xo-slider__slide.is-active {
	display: block;
}

/* Aspect ratios */

.xo-slider__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

@media (min-width: 48rem) {
	.xo-slider__media {
		aspect-ratio: 16 / 9;
	}
}

@media (min-width: 75rem) {
	.xo-slider__media {
		aspect-ratio: 9 / 4;
	}
}

.xo-slider__picture {
	display: block;
	width: 100%;
	height: 100%;
}

.xo-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Content */

.xo-slider__slide-inner {
	display: block;
}

a.xo-slider__slide-inner {
	color: inherit;
	text-decoration: none;
}

.xo-slider__content {
	position: relative;
}

.xo-slider__title {
	margin: 0;
}

.xo-slider__description {
	margin: 0;
}

.xo-slider__button {
	display: inline-block;
}

/* Controls */

.xo-slider__controls {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 2;
}

/*
 * Controls and pagination are reset to plain, unstyled buttons here —
 * only size, position, and hit-target layout are structural. Color,
 * background, shape (border-radius), and shadows are decorative and
 * belong to the active theme.
 */
.xo-slider__previous,
.xo-slider__next {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.xo-slider__previous:focus-visible,
.xo-slider__next:focus-visible,
.xo-slider__pagination-item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Pagination */

.xo-slider__pagination {
	position: absolute;
	bottom: 1rem;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	z-index: 2;
}

.xo-slider__pagination-item {
	width: 0.5rem;
	height: 0.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
	.xo-slider.is-initialized .xo-slider__track {
		transition-duration: 0ms;
	}
}
