/**
 * Hero slider.
 */

.wpx-slider {
	position: relative;
	min-height: var(--wpx-hero-height, 420px);
	margin-block-end: var(--wpx-space-6);
	border-radius: var(--wpx-radius-lg);
	overflow: hidden;
	background: var(--wpx-surface-2);
}

.wpx-slider__track { position: relative; height: 100%; min-height: inherit; }

.wpx-slide {
	position: absolute;
	inset: 0;
	display: grid;
	align-items: end;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--wpx-duration) var(--wpx-ease), visibility var(--wpx-duration);
}

.wpx-slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
}

.wpx-slide__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wpx-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgb(from var(--wpx-bg) r g b / 0.95),
		rgb(from var(--wpx-bg) r g b / var(--wpx-hero-overlay, 55%)) 55%,
		rgb(from var(--wpx-bg) r g b / 0.25)
	);
}

.wpx-slide__body {
	position: relative;
	z-index: 1;
	width: min(100%, 620px);
	padding: var(--wpx-space-6);
}

.wpx-slide__title {
	margin-block-end: var(--wpx-space-2);
	font-size: var(--wpx-text-3xl);
	text-shadow: 0 2px 14px rgb(0 0 0 / 0.5);
}

.wpx-slide__excerpt {
	margin-block-end: var(--wpx-space-4);
	color: var(--wpx-text-muted);
}

/* --- Controls ----------------------------------------------------------- */

.wpx-slider__nav,
.wpx-slider__pause {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	background: rgb(from var(--wpx-bg) r g b / 0.55);
	color: var(--wpx-text);
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: var(--wpx-radius-pill);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background var(--wpx-transition), transform var(--wpx-transition);
}

.wpx-slider__nav:hover,
.wpx-slider__pause:hover {
	background: var(--wpx-accent);
	transform: scale(1.06);
}

.wpx-slider__nav { top: 50%; margin-top: -21px; }
.wpx-slider__nav--prev { inset-inline-start: var(--wpx-space-4); }
.wpx-slider__nav--next { inset-inline-end: var(--wpx-space-4); }

.wpx-slider__pause {
	top: var(--wpx-space-4);
	inset-inline-end: var(--wpx-space-4);
	width: 34px;
	height: 34px;
	font-size: 12px;
	letter-spacing: 1px;
}

.wpx-slider__pause.is-paused::before { content: "▶"; }
.wpx-slider__pause.is-paused { font-size: 14px; letter-spacing: 0; }
.wpx-slider__pause.is-paused > * { display: none; }

.wpx-slider__dots {
	position: absolute;
	z-index: 2;
	bottom: var(--wpx-space-4);
	inset-inline-end: var(--wpx-space-6);
	display: flex;
	gap: var(--wpx-space-2);
}

.wpx-slider__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	background: rgb(255 255 255 / 0.35);
	border: 0;
	border-radius: var(--wpx-radius-pill);
	cursor: pointer;
	transition: background var(--wpx-transition), width var(--wpx-transition);
}

.wpx-slider__dot.is-active {
	width: 26px;
	background: var(--wpx-accent);
}

@media (max-width: 600px) {
	.wpx-slide__body { padding: var(--wpx-space-4); }
	.wpx-slider__nav { display: none; }
}

/* --- Builder rows ------------------------------------------------------- */

.wpx-row-builder {
	display: flex;
	align-items: center;
	gap: var(--wpx-space-4);
	flex-wrap: wrap;
}

.wpx-slot {
	display: flex;
	align-items: center;
	gap: var(--wpx-space-3);
	min-width: 0;
}

.wpx-slot--left   { margin-inline-end: auto; }
.wpx-slot--center { flex: 1 1 auto; justify-content: center; }
.wpx-slot--right  { margin-inline-start: auto; }

/* A missing centre slot should not leave a gap that pushes the sides apart. */
.wpx-slot:empty { display: none; }

.wpx-header__top {
	border-block-end: 1px solid var(--wpx-border);
	font-size: var(--wpx-text-sm);
}

.wpx-header__top .wpx-row-builder { min-height: 40px; }

.wpx-builder-text { color: var(--wpx-text-muted); font-size: var(--wpx-text-sm); }

.wpx-button--header { padding: var(--wpx-space-2) var(--wpx-space-4); font-size: var(--wpx-text-sm); }

@media (max-width: 899px) {
	.wpx-row-builder { gap: var(--wpx-space-2); }
	.wpx-slot--center { order: 5; flex-basis: 100%; justify-content: flex-start; }
}
