.cdg-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	height: var( --cdg-h-desktop, 600px );
	box-sizing: border-box;
}

@media ( max-width: 1024px ) {
	.cdg-slider {
		height: var( --cdg-h-tablet, 480px );
	}
}

@media ( max-width: 600px ) {
	.cdg-slider {
		height: var( --cdg-h-mobile, 380px );
	}
}

.cdg-slider *,
.cdg-slider *::before,
.cdg-slider *::after {
	box-sizing: border-box;
}

.cdg-slider__track {
	position: relative;
	width: 100%;
	height: 100%;
}

.cdg-mode-slide .cdg-slider__track {
	display: flex;
	width: calc( var( --cdg-count, 1 ) * 100% );
	height: 100%;
	transition: transform ease;
	transition-duration: 700ms;
	will-change: transform;
}

.cdg-slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 700ms ease;
	overflow: hidden;
}

.cdg-mode-fade .cdg-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.cdg-mode-slide .cdg-slide {
	position: relative;
	inset: auto;
	flex: 0 0 calc( 100% / var( --cdg-count, 1 ) );
	opacity: 1;
	visibility: visible;
	transition: none;
}

.cdg-slide__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	object-fit: cover;
	transform-origin: center center;
}

video.cdg-slide__media {
	object-fit: cover;
}

.cdg-kb-in {
	animation-name: cdgKenBurnsIn;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.cdg-kb-out {
	animation-name: cdgKenBurnsOut;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

@keyframes cdgKenBurnsIn {
	from { transform: scale( 1 ); }
	to   { transform: scale( 1.15 ); }
}

@keyframes cdgKenBurnsOut {
	from { transform: scale( 1.15 ); }
	to   { transform: scale( 1 ); }
}

.cdg-slide__overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.cdg-slide__content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	padding: 5% 7%;
	z-index: 3;
}

/* align-items positions each text/button layer (flex items in a column
   container) along the horizontal axis; each layer caps its own width
   (see .cdg-layer--heading / --subheading) so lines stay readable. */
.cdg-align-left   { align-items: flex-start; text-align: left; }
.cdg-align-center { align-items: center; text-align: center; }
.cdg-align-right  { align-items: flex-end; text-align: right; }

.cdg-valign-top    { justify-content: flex-start; }
.cdg-valign-middle { justify-content: center; }
.cdg-valign-bottom { justify-content: flex-end; }

.cdg-layer {
	opacity: 0;
	margin: 0 0 16px;
	color: #fff;
	animation-timing-function: cubic-bezier( 0.22, 0.61, 0.36, 1 );
	animation-fill-mode: both;
}

.cdg-layer--eyebrow {
	font-size: clamp( 12px, 1.4vw, 15px );
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0;
}

.cdg-layer--heading {
	font-size: clamp( 28px, 5vw, 56px );
	font-weight: 800;
	line-height: 1.12;
	max-width: 18ch;
}

.cdg-layer--subheading {
	font-size: clamp( 15px, 2vw, 20px );
	line-height: 1.5;
	max-width: 60ch;
	opacity: 0;
}

.cdg-btn {
	display: inline-block;
	padding: 0.85em 1.8em;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 3px;
	border: 2px solid #fff;
	transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cdg-btn--solid {
	background: #fff;
	color: #111;
}

.cdg-btn--solid:hover {
	transform: translateY( -2px );
	background: #eaeaea;
	color: #111;
}

.cdg-btn--outline {
	background: transparent;
	color: #fff;
}

.cdg-btn--outline:hover {
	transform: translateY( -2px );
	background: rgba( 255, 255, 255, 0.15 );
	color: #fff;
}

/* Per-button alignment override — independent of the slide's overall
   Content Position, since the layers are flex items in a column
   container, align-self repositions just this one without touching
   the heading/subheading/eyebrow. */
.cdg-self-left   { align-self: flex-start; }
.cdg-self-center { align-self: center; }
.cdg-self-right  { align-self: flex-end; }

/* Layer-in animations — combined with .cdg-layer--in via [data-animation]. */
.cdg-layer[data-animation="fade-in"].cdg-layer--in    { animation-name: cdgFadeIn; }
.cdg-layer[data-animation="fade-up"].cdg-layer--in     { animation-name: cdgFadeUp; }
.cdg-layer[data-animation="fade-down"].cdg-layer--in   { animation-name: cdgFadeDown; }
.cdg-layer[data-animation="slide-left"].cdg-layer--in  { animation-name: cdgSlideFromRight; }
.cdg-layer[data-animation="slide-right"].cdg-layer--in { animation-name: cdgSlideFromLeft; }
.cdg-layer[data-animation="zoom-in"].cdg-layer--in     { animation-name: cdgZoomIn; }

@keyframes cdgFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes cdgFadeUp {
	from { opacity: 0; transform: translateY( 34px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

@keyframes cdgFadeDown {
	from { opacity: 0; transform: translateY( -34px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

@keyframes cdgSlideFromRight {
	from { opacity: 0; transform: translateX( 70px ); }
	to   { opacity: 1; transform: translateX( 0 ); }
}

@keyframes cdgSlideFromLeft {
	from { opacity: 0; transform: translateX( -70px ); }
	to   { opacity: 1; transform: translateX( 0 ); }
}

@keyframes cdgZoomIn {
	from { opacity: 0; transform: scale( 0.85 ); }
	to   { opacity: 1; transform: scale( 1 ); }
}

/* Arrows */
.cdg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 4;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: rgba( 0, 0, 0, 0.35 );
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.cdg-arrow:hover {
	background: rgba( 0, 0, 0, 0.6 );
}

.cdg-arrow svg {
	width: 20px;
	height: 20px;
}

.cdg-arrow--prev { left: 20px; }
.cdg-arrow--next { right: 20px; }

/* Dots */
.cdg-dots {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
	z-index: 4;
	display: flex;
	gap: 10px;
}

.cdg-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: transparent;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.cdg-dot.is-active {
	background: #fff;
	transform: scale( 1.15 );
}

@media ( max-width: 600px ) {
	.cdg-slide__content {
		padding: 8% 6%;
		max-width: 100%;
	}
	.cdg-arrow {
		width: 38px;
		height: 38px;
	}
	.cdg-arrow--prev { left: 10px; }
	.cdg-arrow--next { right: 10px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.cdg-slide,
	.cdg-slider__track,
	.cdg-layer,
	.cdg-kb-in,
	.cdg-kb-out {
		animation: none !important;
		transition: none !important;
	}
	.cdg-layer {
		opacity: 1 !important;
		transform: none !important;
	}
}
