/* ==========================================================================
   CIMSPA Hero Slideshow — frontend styles  v1.0.0
   ========================================================================== */

/* ---- Container ---- */

.cimspa-hs {
	position: relative;
	height: 100%;
	min-height: 540px;
	overflow: hidden;
}

/* ---- Slides ---- */

/*
 * Each slide is absolutely positioned to fill the container.
 * Crossfade is driven by opacity; only the active slide has opacity: 1.
 * z-index: 1 on the active slide ensures it renders above the outgoing one
 * during the transition overlap.
 */
.cimspa-hs__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.9s ease;
	z-index: 0;
}

.cimspa-hs__slide.is-active {
	opacity: 1;
	z-index: 1;
}

/*
 * Override the Cover block's default sizing so it fills the slide container
 * instead of sizing itself by min-height.
 */
.cimspa-hs__slide > .wp-block-cover {
	position: absolute !important;
	inset: 0 !important;
	min-height: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border-radius: 0 !important;
}

/* ---- Slide content ---- */

/* Badge / pill at the bottom of each slide */
.cimspa-hs__slide .cimspa-hero-badge {
	display: inline-block;
	background: #00afd7;
	color: #fff;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 5px 12px;
	margin: 0 0 10px;
	line-height: 1.4;
}

/* Slide heading */
.cimspa-hs__slide .cimspa-hero-heading {
	color: #fff;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin: 0;
}

/* ---- Slide overlay link ---- */

/*
 * Invisible full-slide clickable area, injected by PHP when a URL is set.
 * z-index: 2 sits above the Cover block's inner container (z-index: 1) but
 * below the dots and pause button, which live in the parent stacking context
 * at z-index: 3 and are never children of .cimspa-hs__slide.
 */
.cimspa-hs__slide-link {
	position: absolute;
	inset: 0;
	z-index: 2;
	text-decoration: none;
}

.cimspa-hs__slide-link:focus-visible {
	outline: 3px solid #0090b4;
	outline-offset: -4px;
}

/* ---- Dot navigation ---- */

/*
 * Dots are centred horizontally, positioned at the bottom of the container.
 * pointer-events: none on the wrapper means only the dot buttons themselves
 * capture clicks (avoids accidentally blocking Cover block interactions).
 */
.cimspa-hs__dots {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 7px;
	pointer-events: none;
}

.cimspa-hs__dot {
	width: 8px;
	height: 8px;
	border-radius: 4px;
	border: none;
	background: rgba( 255, 255, 255, 0.55 );
	padding: 0;
	cursor: pointer;
	transition: background 0.2s, width 0.25s;
	flex-shrink: 0;
	pointer-events: auto;
}

.cimspa-hs__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.cimspa-hs__dot[aria-current="true"] {
	background: #fff;
	width: 24px;
}

/* ---- Pause / play button ---- */

/*
 * Small frosted-glass button at the top-right corner.
 * Injected by frontend.js — hidden until JS runs.
 */
.cimspa-hs__pause {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1.5px solid rgba( 255, 255, 255, 0.45 );
	background: rgba( 0, 0, 0, 0.32 );
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, border-color 0.15s;
	-webkit-backdrop-filter: blur( 4px );
	backdrop-filter: blur( 4px );
}

.cimspa-hs__pause:hover {
	background: rgba( 0, 0, 0, 0.55 );
	border-color: rgba( 255, 255, 255, 0.85 );
}

.cimspa-hs__pause:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---- Reduced motion ---- */

/*
 * When prefers-reduced-motion: reduce, remove the opacity transition so slides
 * cut instantly. JS reads the same media query and starts paused, so
 * auto-advance never fires unless the user clicks Play.
 */
@media ( prefers-reduced-motion: reduce ) {
	.cimspa-hs__slide {
		transition: none;
	}
}
