/* =========================================================================
   CSA Hero Slider — Prentiss
   Geometry and control styling reproduce the Slide Anything / Owl "white"
   theme banner that is on pcepa.com today:
     · slide height = 35% of the slider width
     · banner drawn at 100% width from the top-left, no repeat
     · #eee frame with a 6px transparent inset
     · 30x40 arrows inset 10px, rgba(0,0,0,.3) -> .8 on hover
     · 10px dots, rgba(0,0,0,.2) -> .5 active, on a 22px strip below
   Everything else here is accessibility and theme-proofing.
   ====================================================================== */

.csap-hero-frame {
	--csap-frame-bg: #eeeeee;
	--csap-frame-border: 6px;

	box-sizing: border-box;
	background: var(--csap-frame-bg);
	border: var(--csap-frame-border) solid transparent;
	border-radius: 0;
}

.csap-hero,
.csap-hero *,
.csap-hero *::before,
.csap-hero *::after {
	box-sizing: border-box;
}

.csap-hero {
	--csap-ratio: 35%;
	--csap-pad: 5%;
	--csap-speed: 500ms;
	--csap-overlay: 0;
	--csap-img-size: 100% auto;
	--csap-img-pos: left top;

	position: relative;
	margin: 0;
	padding: 0;
	max-width: 100%;
}

/* ---------- Viewport & sizing ------------------------------------------ */

.csap-hero__viewport {
	position: relative;
	overflow: hidden;
}

/* Height is a percentage of the width, exactly like the slider it replaces.
   Padding-top on an empty box gives that with no JavaScript and no reflow. */
.csap-hero__sizer {
	display: block;
	width: 100%;
	padding-top: var(--csap-ratio);
	pointer-events: none;
}

.csap-hero__track {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.csap-hero__track::before,
.csap-hero__track::after {
	content: none;
}

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

.csap-hero__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: var(--csap-pad);
	list-style: none;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	z-index: 0;
	background-image: var(--csap-img);
	background-repeat: no-repeat;
	background-size: var(--csap-img-size);
	background-position: var(--csap-img-pos);
	backface-visibility: visible;
}

.csap-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

/* The outgoing slide stays on top while it flips away, as Owl did. */
.csap-hero__slide.is-leaving {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.csap-hero__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.csap-hero__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.csap-hero__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--csap-overlay));
	pointer-events: none;
}

/* Whole-slide click-through, the same behaviour as the old slide link. */
.csap-hero__link {
	position: absolute;
	inset: 0;
	display: block;
	z-index: 3;
	text-decoration: none;
	border: 0;
	box-shadow: none;
}

.csap-hero__link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
	box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.55);
}

/* ---------- Optional text overlay --------------------------------------- */

.csap-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	display: flex;
}

.csap-hero__slide--left   .csap-hero__inner { justify-content: flex-start; text-align: left; }
.csap-hero__slide--center .csap-hero__inner { justify-content: center;     text-align: center; }
.csap-hero__slide--right  .csap-hero__inner { justify-content: flex-end;   text-align: right; }

.csap-hero__content {
	max-width: 46rem;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.csap-hero__eyebrow {
	margin: 0 0 0.4em;
	font-size: 0.8125rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--csap-accent, currentColor);
}

.csap-hero__heading {
	margin: 0 0 0.35em;
	font-size: clamp(1.6rem, 3.4vw, 3rem);
	line-height: 1.12;
}

.csap-hero__sub {
	margin: 0 0 1em;
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	line-height: 1.5;
}

.csap-hero__actions {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.csap-hero__slide--center .csap-hero__actions { justify-content: center; }
.csap-hero__slide--right  .csap-hero__actions { justify-content: flex-end; }

.csap-hero__btn {
	display: inline-block;
	padding: 0.7em 1.5em;
	border-radius: 4px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.2;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.csap-hero__btn--primary {
	background: var(--csap-accent, #c8102e);
	color: #fff;
}

.csap-hero__btn--ghost {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	box-shadow: inset 0 0 0 2px #fff;
}

.csap-hero__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* ---------- Arrows ------------------------------------------------------ */

.csap-hero__arrow {
	position: absolute;
	top: 50%;
	margin-top: -20px;
	width: 30px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	z-index: 10;
	background-color: rgba(0, 0, 0, 0.3);
	background-repeat: no-repeat;
	background-position: center center;
	transition: background-color 0.3s ease-in-out;
	-webkit-appearance: none;
	appearance: none;
	color: transparent;
	text-shadow: none;
	box-shadow: none;
}

.csap-hero__arrow:hover,
.csap-hero__arrow:focus {
	background-color: rgba(0, 0, 0, 0.8);
}

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

.csap-hero__arrow--prev {
	left: 10px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20'%3E%3Cpath d='M9.7 1.6 2.3 10l7.4 8.4' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.csap-hero__arrow--next {
	right: 10px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20'%3E%3Cpath d='M2.3 1.6 9.7 10l-7.4 8.4' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.csap-hero__arrow[disabled] {
	display: none;
}

/* ---------- Dots -------------------------------------------------------- */

.csap-hero__dots {
	display: block;
	height: 22px;
	padding: 10px 0 0;
	margin: 0;
	text-align: center;
	font-size: 12px;
	line-height: 12px;
}

.csap-hero__dot {
	display: inline-block;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	line-height: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.csap-hero__dot > span {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin: 0 3px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.2);
	transition: background-color 0.3s ease-in-out;
}

.csap-hero__dot.is-active > span,
.csap-hero__dot:hover > span {
	background-color: rgba(0, 0, 0, 0.5);
}

.csap-hero__dot:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 50%;
}

/* Dots turned off in settings: still reachable by screen readers and the
   keyboard, but they take no space and are not seen. */
.csap-hero__dots--hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Screen-reader helpers --------------------------------------- */

.csap-hero__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* WCAG 2.2.2 pause control. Invisible until it is tabbed to, so nothing
   about the page changes for a visitor using a mouse. */
.csap-hero__sr-focusable {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 20;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	background: #000;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.csap-hero__sr-focusable:focus,
.csap-hero__sr-focusable:focus-visible {
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	padding: 0.5em 0.9em;
	border-radius: 4px;
	font-size: 0.875rem;
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* ---------- Transitions ------------------------------------------------- */

.csap-hero--flip .csap-hero__slide.is-entering {
	animation: csap-fade-in var(--csap-speed) both;
}

.csap-hero--flip .csap-hero__slide.is-leaving {
	animation: csap-flip-out-x var(--csap-speed) both;
	transform-origin: center;
}

.csap-hero--fade .csap-hero__slide.is-entering {
	animation: csap-fade-in var(--csap-speed) both;
}

.csap-hero--fade .csap-hero__slide.is-leaving {
	animation: csap-fade-out var(--csap-speed) both;
}

@keyframes csap-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes csap-fade-out {
	from { opacity: 1; }
	to   { opacity: 0; }
}

/* Same curve Animate.css uses for flipOutX, which is what Owl was running. */
@keyframes csap-flip-out-x {
	from {
		transform: perspective(400px);
		opacity: 1;
	}
	30% {
		transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
		opacity: 1;
	}
	to {
		transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
		opacity: 0;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.csap-hero__slide,
	.csap-hero__arrow,
	.csap-hero__dot > span {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Small screens ----------------------------------------------- */

@media (max-width: 480px) {
	.csap-hero__arrow {
		width: 26px;
		height: 36px;
		margin-top: -18px;
	}
}
