/* Qaiyo Content Slider — Frontend */

.qcs-slider {
	position: relative;
	width: 100%;
	min-height: var(--qcs-min-height, 420px);
	border-radius: 8px;
	overflow: hidden;
	background: #1d2327;
}

.qcs-slides {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: var(--qcs-min-height, 420px);
}

.qcs-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.6s ease;
}

.qcs-slide.qcs-slide-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

[data-transition="slide"] .qcs-slide {
	opacity: 1;
	visibility: visible;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
	transform: translateX(100%);
}

[data-transition="slide"] .qcs-slide.qcs-slide-active {
	transform: translateX(0);
}

[data-transition="slide"] .qcs-slide.qcs-slide-before {
	transform: translateX(-100%);
}

[data-transition="slide"] .qcs-slide.qcs-slide-after {
	transform: translateX(100%);
}

.qcs-slide-media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.qcs-slide-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Background video sits on top of the poster image and fills the media box. */
.qcs-slide-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	pointer-events: none;
}

/* Visually-hidden live region for screen-reader slide announcements. */
.qcs-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Ken Burns: a slow, continuous zoom/pan on the active slide's image. The
   .qcs-slide-media wrapper clips the scaled image to its own panel so the
   effect never bleeds into a neighbouring split-layout text panel. */
@keyframes qcs-kenburns-a {
	from { transform: scale(1) translate(0, 0); }
	to   { transform: scale(1.12) translate(-2%, -1%); }
}

@keyframes qcs-kenburns-b {
	from { transform: scale(1) translate(0, 0); }
	to   { transform: scale(1.12) translate(2%, 1%); }
}

[data-ken-burns="1"] .qcs-slide.qcs-slide-active .qcs-slide-img {
	animation: qcs-kenburns-a 9s ease-out forwards;
}

[data-ken-burns="1"] .qcs-slide:nth-child(even).qcs-slide-active .qcs-slide-img {
	animation-name: qcs-kenburns-b;
}

.qcs-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 45%);
	pointer-events: none;
}

.qcs-slide[data-position="left"] {
	justify-content: flex-start;
}

.qcs-slide[data-position="right"] {
	justify-content: flex-end;
}

.qcs-slide-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	margin: 72px 32px 32px;
	padding: 28px 32px;
	border-radius: 16px;
	box-sizing: border-box;
	background: var(--qcs-box-bg, #ffffff);
	color: var(--qcs-font-color, #1d2327);
	font-family: var(--qcs-font-family, inherit);
	font-size: var(--qcs-font-size, 16px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.qcs-slide-heading {
	margin: 0 0 10px;
	font-size: var( --qcs-heading-size, 1.7em );
	line-height: 1.2;
	font-weight: 700;
}

.qcs-slide-text {
	margin: 0 0 18px;
	line-height: 1.5;
	font-size: var( --qcs-text-size, 1em );
}

.qcs-cta {
	display: inline-block;
	padding: 10px 24px;
	border-radius: 999px;
	background: #6c5ce7;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: var( --qcs-button-size, 0.9em );
	transition: background 0.15s ease;
}

.qcs-cta:hover,
.qcs-cta:focus {
	background: #5a4bd1;
	color: #fff;
}

/* =========================================================================
   Split layouts — image and text box live in two separate panels instead of
   the text box overlaying a full-bleed image.
   - split-horizontal: two columns (landscape). data-position left/right places
     the TEXT box; the image takes the opposite side.
   - split-vertical: two rows (portrait). data-position top/bottom places the
     TEXT box; the image takes the opposite side.
   The .qcs-slide itself stays absolutely positioned inside .qcs-slides (so the
   fade / slide transition engine is unchanged); only its inner arrangement
   changes here.
   ========================================================================= */
[data-layout="split-horizontal"] .qcs-slide,
[data-layout="split-vertical"] .qcs-slide {
	align-items: stretch;
	background: var(--qcs-box-bg, #ffffff);
}

[data-layout="split-horizontal"] .qcs-slide {
	flex-direction: row;
}

/* Text box on the left → image on the right. */
[data-layout="split-horizontal"] .qcs-slide[data-position="left"] {
	flex-direction: row-reverse;
}

[data-layout="split-vertical"] .qcs-slide {
	flex-direction: column;
}

/* Text box on the top → image on the bottom. */
[data-layout="split-vertical"] .qcs-slide[data-position="top"] {
	flex-direction: column-reverse;
}

/* The image becomes a real panel, not an absolute background. */
[data-layout="split-horizontal"] .qcs-slide-media,
[data-layout="split-vertical"] .qcs-slide-media {
	position: relative;
	inset: auto;
	flex: 1 1 50%;
	min-width: 0;
	min-height: 180px;
}

[data-layout="split-vertical"] .qcs-slide-media {
	flex: 1 1 56%;
}

/* No darkening gradient when the image is on its own panel. */
[data-layout="split-horizontal"] .qcs-slide::after,
[data-layout="split-vertical"] .qcs-slide::after {
	display: none;
}

/* The text panel fills its half — no floating card, no shadow. */
[data-layout="split-horizontal"] .qcs-slide-box,
[data-layout="split-vertical"] .qcs-slide-box {
	flex: 1 1 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	max-width: none;
	margin: 0;
	padding: 40px 48px;
	border-radius: 0;
	box-shadow: none;
}

[data-layout="split-vertical"] .qcs-slide-box {
	flex: 1 1 44%;
}

/* Indicators / controls sit over light panels in split layouts — darken them. */
[data-layout="split-horizontal"] .qcs-indicator,
[data-layout="split-vertical"] .qcs-indicator {
	background: rgba(0, 0, 0, 0.22);
}

[data-layout="split-horizontal"] .qcs-indicator-active,
[data-layout="split-vertical"] .qcs-indicator-active {
	background: #1d2327;
}

/* =========================================================================
   Carousel layout — the active slide is a centered card and the previous /
   next slides peek in at the sides. The JS engine translates the .qcs-slides
   track so the active slide stays centered; everything else here is styling.
   Slides reuse the overlay inner rendering (image fills the card, text box
   floats on top), so box position is left/right.
   ========================================================================= */
[data-layout="carousel"] .qcs-slides {
	display: flex;
	gap: 22px;
	align-items: stretch;
	min-height: var(--qcs-min-height, 420px);
	transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: transform;
}

[data-layout="carousel"] .qcs-slide {
	position: relative;
	inset: auto;
	flex: 0 0 72%;
	opacity: 0.45;
	visibility: visible;
	pointer-events: none;
	transform: scale(0.92);
	border-radius: 18px;
	overflow: hidden;
	transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-layout="carousel"] .qcs-slide.qcs-slide-before,
[data-layout="carousel"] .qcs-slide.qcs-slide-after {
	opacity: 0.45;
	transform: scale(0.92);
}

[data-layout="carousel"] .qcs-slide.qcs-slide-active {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

/* Centered dot indicators at the bottom; arrows/pause top-right (Telekom-style). */
[data-layout="carousel"] .qcs-indicators {
	top: auto;
	bottom: 16px;
	left: 0;
	right: 0;
	justify-content: center;
}

[data-layout="carousel"] .qcs-indicator {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	min-width: 0;
	border-radius: 50%;
}

[data-layout="carousel"] .qcs-controls {
	top: 16px;
	right: 20px;
	left: auto;
	bottom: auto;
}

.qcs-indicators {
	position: absolute;
	top: 20px;
	left: 28px;
	right: 28px;
	display: flex;
	gap: 6px;
	z-index: 2;
}

.qcs-indicator {
	flex: 1 1 0;
	height: 3px;
	min-width: 16px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.4);
	border: 0;
	padding: 0;
	cursor: pointer;
}

.qcs-indicator-active {
	background: #ffffff;
}

/* ---- Autoplay progress fill on the active top-bar indicator (#5) ----------
   Only the bar-style indicators (overlay + split layouts) get this; the
   carousel dots are excluded. When autoplay is actually running
   the root carries .qcs-playing, so the fill animates in sync with the timer
   and resets whenever it pauses. */
.qcs-slider {
	--qcs-progress: #ffffff;
}

[data-layout="split-horizontal"],
[data-layout="split-vertical"] {
	--qcs-progress: #1d2327;
}

[data-autoplay="1"]:not([data-layout="carousel"]) .qcs-indicator {
	position: relative;
	overflow: hidden;
}

[data-autoplay="1"]:not([data-layout="carousel"]) .qcs-indicator-active {
	background: rgba(255, 255, 255, 0.4);
}

[data-autoplay="1"][data-layout="split-horizontal"] .qcs-indicator-active,
[data-autoplay="1"][data-layout="split-vertical"] .qcs-indicator-active {
	background: rgba(0, 0, 0, 0.22);
}

[data-autoplay="1"]:not([data-layout="carousel"]) .qcs-indicator-active::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: scaleX(1);
	transform-origin: left center;
	background: var(--qcs-progress, #ffffff);
}

.qcs-playing[data-autoplay="1"]:not([data-layout="carousel"]) .qcs-indicator-active::after {
	transform: scaleX(0);
	animation: qcs-progress var(--qcs-speed, 6000ms) linear forwards;
}

@keyframes qcs-progress {
	to { transform: scaleX(1); }
}

.qcs-controls {
	position: absolute;
	bottom: 24px;
	left: 28px;
	display: flex;
	gap: 10px;
	align-items: center;
	z-index: 2;
}

.qcs-arrow,
.qcs-pause {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.6);
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	padding: 0;
}

.qcs-arrow:hover,
.qcs-pause:hover,
.qcs-arrow:focus,
.qcs-pause:focus {
	background: rgba(0, 0, 0, 0.45);
}

.qcs-pause .qcs-play-icon {
	display: none;
}

.qcs-pause.qcs-paused .qcs-pause-icon {
	display: none;
}

.qcs-pause.qcs-paused .qcs-play-icon {
	display: inline;
}

@media (max-width: 600px) {
	/* Optional separate mobile height (#4); falls back to the desktop value. */
	.qcs-slider,
	.qcs-slides {
		min-height: var(--qcs-min-height-mobile, var(--qcs-min-height, 420px));
	}

	.qcs-slide-box {
		max-width: none;
		margin: 60px 16px 16px;
		padding: 20px 22px;
	}

	.qcs-indicators {
		left: 16px;
		right: 16px;
		top: 14px;
	}

	.qcs-controls {
		left: 16px;
		bottom: 16px;
	}

	.qcs-slide-heading {
		font-size: var( --qcs-heading-size, 1.4em );
	}

	/* Side-by-side collapses to stacked (image on top) on small screens. */
	[data-layout="split-horizontal"] .qcs-slide,
	[data-layout="split-horizontal"] .qcs-slide[data-position="left"] {
		flex-direction: column;
	}

	[data-layout="split-horizontal"] .qcs-slide-box,
	[data-layout="split-vertical"] .qcs-slide-box {
		margin: 0;
		padding: 24px 22px;
		flex-basis: auto;
	}

	/* More of the active card on small screens. */
	[data-layout="carousel"] .qcs-slides {
		gap: 14px;
	}

	[data-layout="carousel"] .qcs-slide {
		flex-basis: 86%;
	}

}

@media (prefers-reduced-motion: reduce) {
	.qcs-slide,
	[data-transition="slide"] .qcs-slide {
		transition: none !important;
	}

	[data-ken-burns="1"] .qcs-slide-img {
		animation: none !important;
		transform: none !important;
	}

	/* Show the poster image instead of an autoplaying video (#8). */
	.qcs-slide-video {
		display: none !important;
	}

	/* Freeze the autoplay progress fill at full (#5). */
	.qcs-indicator-active::after {
		animation: none !important;
		transform: scaleX(1) !important;
	}
}
