/* Qaiyo Content Slider — Frontend */

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

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

/* The plate behind the slide. A slide with no photo of its own becomes a
   plain colour panel; one with a photo keeps it, since the image covers the
   whole slide anyway. */
.qcs-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	background: var( --qcs-slide-bg, transparent );
	transition: opacity var( --qcs-transition-duration, 600ms ) ease;
}

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

[data-transition="slide"] .qcs-slide {
	opacity: 1;
	visibility: visible;
	transition: transform var( --qcs-transition-duration, 600ms ) 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;
	/* Which part of a cropped photo stays visible. Set per slider or per
	   slide; the fallback is the browser's own centre. */
	object-position: var( --qcs-image-position, 50% 50% );
}

/* 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;
	object-position: var( --qcs-image-position, 50% 50% );
	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;
}

/* The scrim exists to lift the text off a photo. On a slide that has no photo
   — a plain background colour, say — it is just a smudge across the panel, so
   it goes. The .qcs-slider prefix is deliberate: it outranks the layout-scoped
   ::after rules in the add-on stylesheet, which loads after this one and would
   otherwise put their own scrim back. */
.qcs-slider .qcs-slide:not( :has( > .qcs-slide-media ) )::after {
	display: 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);
}

/* Heading and description colours are optional: left empty they inherit the
   box's font colour (or whatever the layout paints them with). */
.qcs-slide-heading {
	margin: 0 0 10px;
	font-size: var( --qcs-heading-size, 1.7em );
	line-height: 1.2;
	font-weight: 700;
	color: var( --qcs-heading-color, inherit );
}

/* Optional heading link: it must not repaint the heading, so it borrows every
   colour and only grows an underline once it is pointed at or focused. */
.qcs-slide-heading-link {
	color: inherit;
	text-decoration: none;
}

.qcs-slide-heading-link:hover,
.qcs-slide-heading-link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

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

/* The button keeps its own two colours, separate from the box's Font color —
   set them and every layout follows; leave them empty and each layout paints
   its button the way its own design intends. */
.qcs-cta {
	display: inline-block;
	padding: 10px 24px;
	border-radius: 999px;
	background: var( --qcs-button-bg, #6c5ce7 );
	color: var( --qcs-button-color, #fff );
	text-decoration: none;
	font-weight: 600;
	font-size: var( --qcs-button-size, 0.9em );
	transition: filter 0.15s ease, background 0.15s ease;
}

/* Darkening the chosen colour keeps the hover feedback working whatever the
   editor picks, instead of jumping to one hard-coded shade. */
.qcs-cta:hover,
.qcs-cta:focus {
	background: var( --qcs-button-bg, #6c5ce7 );
	color: var( --qcs-button-color, #fff );
	filter: brightness( 0.9 );
}

/* =========================================================================
   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-slide-bg, 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 var( --qcs-transition-duration, 550ms ) 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: var( --qcs-radius, 18px );
	overflow: hidden;
	transition: opacity var( --qcs-transition-duration, 450ms ) ease, transform var( --qcs-transition-duration, 450ms ) 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);
	/* The round nav buttons take their own two colours; every layout below
	   plugs its own design default into the same two variables. */
	background: var( --qcs-arrow-bg, rgba(0, 0, 0, 0.25) );
	color: var( --qcs-arrow-color, #fff );
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	padding: 0;
}

/* The dim is what gives hover feedback once a custom colour is set, since the
   colour itself then stays put; on the default it simply adds to the darker
   plate below. */
.qcs-arrow:hover,
.qcs-pause:hover,
.qcs-arrow:focus,
.qcs-pause:focus {
	background: var( --qcs-arrow-bg, rgba(0, 0, 0, 0.45) );
	opacity: 0.85;
}

.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;
	}
}

/* =========================================================================
   Logo wall — partner logos drifting past in one or two rows.

   Without JavaScript, and for visitors who ask for reduced motion, this is a
   plain centred, wrapping list: every logo shown once and nothing moves. The
   runtime adds .is-running, clones each row's list until it overfills the
   row, and hands the track the exact distance and duration of one seamless
   lap.
   ========================================================================= */
.qcs-slider.qcs-logos {
	--qcs-logos-fade: clamp( 24px, 10%, 140px );
	display: flex;
	flex-direction: column;
	gap: clamp( 12px, 2.5vw, 28px );
	min-height: 0;
	overflow: visible;
	border-radius: 0;
	background: transparent;
}

.qcs-logos-row {
	position: relative;
	overflow: hidden;
	/* Room for a logo link's focus ring, which the clipping would cut off. */
	padding-block: 6px;
}

.qcs-logos-set {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: calc( var( --qcs-logo-gap, 64px ) / 2 ) var( --qcs-logo-gap, 64px );
	margin: 0;
	padding: 0;
	list-style: none;
}

.qcs-logo {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qcs-logo-img {
	display: block;
	width: auto;
	max-width: none;
	height: var( --qcs-logo-height, 48px );
	object-fit: contain;
}

/* JPEG logos carry an opaque background — usually white — that shows as a box
   against anything but a white page. Multiply drops it into the page, since
   white leaves the colour beneath unchanged. It has to sit on the root: the
   running track's transform and the faded row's mask each form a blending
   group of their own, and a logo blended inside one of them only meets the
   transparent track, so its white box stays. Set only when a logo is a JPEG. */
.qcs-logos--multiply {
	mix-blend-mode: multiply;
}

/* Windows high-contrast themes replace the page's own colours, so the blend
   would either hide the logos or paint them in the wrong colour. */
@media (forced-colors: active) {
	.qcs-logos--multiply {
		mix-blend-mode: normal;
	}
}

/* A slide with no image shows its Heading as a word-mark instead. */
.qcs-logo-text {
	display: block;
	font-size: calc( var( --qcs-logo-height, 48px ) * 0.42 );
	font-weight: 700;
	line-height: var( --qcs-logo-height, 48px );
	white-space: nowrap;
}

.qcs-logo-link {
	display: block;
	color: inherit;
	text-decoration: none;
	border-radius: 4px;
}

.qcs-logo-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ---- In motion ---------------------------------------------------------- */
.qcs-logos.is-running .qcs-logos-track {
	display: flex;
	width: max-content;
	animation: qcs-logos-scroll var( --qcs-logos-duration, 40s ) linear infinite;
	will-change: transform;
}

/* One list is one lap. Its trailing gap is padding rather than flex gap, so
   the next copy starts exactly one gap later and the loop has no seam. */
.qcs-logos.is-running .qcs-logos-set {
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: var( --qcs-logo-gap, 64px );
	padding-right: var( --qcs-logo-gap, 64px );
}

.qcs-logos.is-running .qcs-logos-row[data-direction="right"] .qcs-logos-track {
	animation-direction: reverse;
}

/* Pointing at a row, or tabbing into one, stops it (WCAG 2.2.2). */
.qcs-logos.is-running .qcs-logos-row:hover .qcs-logos-track,
.qcs-logos.is-running .qcs-logos-row:focus-within .qcs-logos-track {
	animation-play-state: paused;
}

.qcs-logos.is-running[data-fade="1"] .qcs-logos-row {
	-webkit-mask-image: linear-gradient( to right, transparent 0, #000 var( --qcs-logos-fade ), #000 calc( 100% - var( --qcs-logos-fade ) ), transparent 100% );
	mask-image: linear-gradient( to right, transparent 0, #000 var( --qcs-logos-fade ), #000 calc( 100% - var( --qcs-logos-fade ) ), transparent 100% );
}

@keyframes qcs-logos-scroll {
	from {
		transform: translate3d( 0, 0, 0 );
	}
	to {
		transform: translate3d( var( --qcs-logos-shift, -50% ), 0, 0 );
	}
}

@media (max-width: 600px) {
	.qcs-logos-set,
	.qcs-logos.is-running .qcs-logos-set {
		column-gap: calc( var( --qcs-logo-gap, 64px ) * 0.6 );
	}

	.qcs-logos.is-running .qcs-logos-set {
		padding-right: calc( var( --qcs-logo-gap, 64px ) * 0.6 );
	}

	.qcs-logo-img {
		height: calc( var( --qcs-logo-height, 48px ) * 0.8 );
	}
}

/* The runtime never starts the loop under reduced motion; this is the safety
   net should a stylesheet or a cached page have it running anyway. */
@media (prefers-reduced-motion: reduce) {
	.qcs-logos.is-running .qcs-logos-track {
		animation: none;
	}
}
