/* TE Hero Slider – schlank, ohne Framework. Theming per CSS-Variablen. */

.ths-slider {
	--ths-height: 520px;
	--ths-overlay: 0.45;                  /* Stärke 0..1 (Element-Opazität) */
	--ths-overlay-color: #0c2022;         /* vollständige Farbe (Hex/rgb/rgba) */
	--ths-text: #ffffff;
	--ths-accent: #2a7d7b;                /* Wesertakt-Petrol als Default */
	--ths-radius: 16px;
	--ths-per-view: 1;
	--ths-img-pos: 50% 50%;               /* object-position der Hintergrundbilder */
	--ths-blur: 0px;                      /* Weichzeichnung Hintergrundbild */
	--ths-fg-w: 240px;                    /* Breite Zusatzbild */
	--ths-content-maxw: 640px;            /* max. Breite des Textblocks */
	--ths-hover: ;                        /* Hover-Farbe (leer = keine Änderung) */
	--ths-gap: 18px;
	--ths-anim: .6s;                      /* Übergangsdauer */
	--ths-ease: cubic-bezier(.22, .61, .36, 1);

	position: relative;
	width: 100%;
	color: var(--ths-text);
	box-sizing: border-box;
}
.ths-slider *,
.ths-slider *::before,
.ths-slider *::after { box-sizing: border-box; }

/* ---------- Viewport / Track ---------- */
.ths-viewport {
	position: relative;
	overflow: hidden;
	border-radius: var(--ths-radius);
	height: var(--ths-height);
}
.ths-layout-fullscreen .ths-viewport { height: 100svh; border-radius: 0; }
.ths-layout-cards .ths-viewport { height: auto; }

.ths-track {
	display: flex;
	height: 100%;
	will-change: transform;
	transition: transform var(--ths-anim) var(--ths-ease);
}
.ths-slide {
	position: relative;
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	display: block;
}

/* ---------- Fade / Ken-Burns: Slides stapeln ---------- */
.ths-effect-fade .ths-track,
.ths-effect-kenburns .ths-track {
	display: block;
	transition: none;
}
.ths-effect-fade .ths-slide,
.ths-effect-kenburns .ths-slide {
	position: absolute;
	inset: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity calc(var(--ths-anim) + .2s) var(--ths-ease);
	z-index: 1;
}
.ths-effect-fade .ths-slide.is-active,
.ths-effect-kenburns .ths-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

/* ---------- Medien ---------- */
.ths-media { position: absolute; inset: 0; overflow: hidden; }
.ths-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--ths-img-pos);
	display: block;
	filter: blur(var(--ths-blur, 0px));
}
/* Weichgezeichnete Bilder leicht vergrößern, damit keine transparenten Ränder entstehen. */
.ths-has-blur .ths-img { transform: scale(1.06); }
.ths-img--placeholder {
	background: linear-gradient(135deg, #24555a, #2a7d7b 60%, #e9645a);
}
.ths-effect-kenburns .ths-slide.is-active .ths-img {
	animation: ths-kb 12s ease-out both;
}
@keyframes ths-kb {
	from { transform: scale(1.02); }
	to   { transform: scale(1.14); }
}
.ths-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	/* Gewählte Farbe als Vollfläche, Stärke über die Element-Opazität.
	   Zusätzlich ein dezenter dunkler Verlauf unten für bessere Lesbarkeit. */
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .28) 100%),
		var(--ths-overlay-color);
	opacity: var(--ths-overlay);
}
/* Overlay-Stile */
.ths-ovl-solid  .ths-overlay { background: var(--ths-overlay-color); }
.ths-ovl-bottom .ths-overlay { background: linear-gradient(0deg,   var(--ths-overlay-color) 0%, rgba(0, 0, 0, 0) 72%); }
.ths-ovl-top    .ths-overlay { background: linear-gradient(180deg, var(--ths-overlay-color) 0%, rgba(0, 0, 0, 0) 72%); }

/* ---------- Content ---------- */
.ths-content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;      /* vertikal – Default unten */
	justify-content: flex-start; /* horizontal – Default links */
	padding: clamp(20px, 5vw, 64px);
	z-index: 3;
	pointer-events: none;
}
.ths-content-inner {
	max-width: var(--ths-content-maxw, 640px);
	max-height: 100%;
	overflow: hidden;           /* verhindert, dass Text über die Kachel hinausläuft */
	pointer-events: auto;
	display: grid;
	gap: 14px;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.ths-noshadow .ths-content-inner { text-shadow: none; }

/* Hover-Farbe (nur wenn der Slide ein Link ist und eine Farbe gesetzt wurde).
   Gilt einheitlich für Übertitel, Titel, Beschreibungstext und Meta. */
a.ths-slide .ths-eyebrow,
a.ths-slide .ths-title,
a.ths-slide .ths-text,
a.ths-slide .ths-text p,
a.ths-slide .ths-slide-meta { transition: color .25s var(--ths-ease); }
a.ths-slide:hover .ths-eyebrow,
a.ths-slide:hover .ths-title,
a.ths-slide:hover .ths-text,
a.ths-slide:hover .ths-text p,
a.ths-slide:hover .ths-slide-meta { color: var(--ths-hover, inherit); opacity: 1; }
.ths-text a { transition: color .2s var(--ths-ease); }
.ths-text a:hover { color: var(--ths-hover, inherit); }

/* Horizontale Ausrichtung */
.ths-text-left   .ths-content { justify-content: flex-start; text-align: left; }
.ths-text-center .ths-content { justify-content: center;     text-align: center; }
.ths-text-right  .ths-content { justify-content: flex-end;   text-align: right; }
.ths-text-center .ths-content-inner { margin-inline: auto; }
.ths-text-right  .ths-content-inner { margin-left: auto; }

/* Vertikale Ausrichtung */
.ths-valign-top    .ths-content { align-items: flex-start; }
.ths-valign-center .ths-content { align-items: center; }
.ths-valign-bottom .ths-content { align-items: flex-end; }

.ths-eyebrow {
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ths-text);
	opacity: .92;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.ths-eyebrow::before {
	content: "";
	width: 26px;
	height: 2px;
	background: var(--ths-accent);
	display: inline-block;
}
.ths-text-center .ths-eyebrow { justify-content: center; }
.ths-text-right .ths-eyebrow { flex-direction: row-reverse; }

.ths-title {
	margin: 0;
	font-size: clamp(1.6rem, 4vw, 3.1rem);
	line-height: 1.08;
	font-weight: 800;
	color: var(--ths-text);
}
.ths-text {
	font-size: clamp(.95rem, 1.4vw, 1.12rem);
	line-height: 1.55;
	opacity: .95;
}
.ths-text p { margin: 0; }
.ths-text p + p { margin-top: .6em; }
.ths-text ul,
.ths-text ol { margin: .3em 0; padding-left: 1.25em; display: grid; gap: .3em; }
.ths-text li { line-height: 1.4; }
.ths-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ths-text hr {
	border: 0;
	height: 1px;
	margin: .9em 0;
	background: currentColor;
	opacity: .35;
}
.ths-text strong { font-weight: 700; }
.ths-slide-meta { font-size: .85rem; opacity: .85; }

/* ---------- Zusatz-/Vordergrundbild ---------- */
.ths-fg { display: block; width: var(--ths-fg-w, 240px); max-width: 100%; height: auto; }
.ths-fg-above .ths-fg { margin-bottom: 4px; }
.ths-text-center .ths-fg-above { display: flex; justify-content: center; }
.ths-text-right .ths-fg-above { display: flex; justify-content: flex-end; }

.ths-content.ths-has-fg-side {
	align-items: center;
	gap: clamp(16px, 4vw, 48px);
}
.ths-content.ths-fg-right { flex-direction: row-reverse; }
.ths-has-fg-side .ths-fg-side {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
}
.ths-has-fg-side .ths-fg-side .ths-fg { max-height: 82%; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .3)); }
.ths-has-fg-side .ths-content-inner { flex: 1 1 auto; }
@media (max-width: 720px) {
	.ths-content.ths-has-fg-side,
	.ths-content.ths-fg-right { flex-direction: column; align-items: flex-start; gap: 12px; }
	.ths-has-fg-side .ths-fg-side .ths-fg { max-height: 96px; }
}

.ths-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	padding: 12px 22px;
	background: var(--ths-accent);
	color: #fff;
	border-radius: 999px;
	font-weight: 700;
	font-size: .95rem;
	width: fit-content;
	transition: transform .2s var(--ths-ease), box-shadow .2s var(--ths-ease), filter .2s var(--ths-ease);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.ths-text-center .ths-button { margin-inline: auto; }
.ths-text-right .ths-button { margin-left: auto; }
.ths-slide:hover .ths-button { transform: translateY(-2px); filter: brightness(1.06); }
.ths-button svg { transition: transform .2s var(--ths-ease); }
.ths-slide:hover .ths-button svg { transform: translateX(3px); }

/* ---------- Split-Layout ---------- */
.ths-layout-split .ths-slide {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
}
.ths-layout-split .ths-media { position: relative; }
.ths-layout-split .ths-overlay {
	background: var(--ths-overlay-color);
	opacity: calc(var(--ths-overlay) * .55);
}
.ths-layout-split .ths-content {
	position: relative;
	inset: auto;
	align-items: center;
	background: #12222a;
	color: var(--ths-text);
}
.ths-layout-split .ths-content-inner { text-shadow: none; }
@media (max-width: 780px) {
	.ths-layout-split .ths-slide { grid-template-columns: 1fr; grid-template-rows: 55% 45%; }
}

/* ---------- Karten-Karussell ---------- */
.ths-layout-cards .ths-track {
	gap: var(--ths-gap);
	transition: transform var(--ths-anim) var(--ths-ease);
}
.ths-layout-cards .ths-slide {
	flex: 0 0 calc((100% - (var(--ths-per-view) - 1) * var(--ths-gap)) / var(--ths-per-view));
	height: var(--ths-height);
	border-radius: var(--ths-radius);
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.ths-layout-cards .ths-content { padding: 22px; }
.ths-layout-cards .ths-title { font-size: clamp(1.1rem, 1.6vw, 1.5rem); }
@media (max-width: 1024px) { .ths-layout-cards { --ths-per-view: 2; } }
@media (max-width: 640px) { .ths-layout-cards { --ths-per-view: 1; } }

/* ---------- Pfeile ---------- */
.ths-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 46px;
	height: 46px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #12222a;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background .2s, transform .2s, opacity .2s;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.ths-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.ths-arrow:focus-visible { outline: 3px solid var(--ths-accent); outline-offset: 2px; }
.ths-prev { left: 16px; }
.ths-next { right: 16px; }
.ths-arrow[disabled] { opacity: .35; cursor: default; pointer-events: none; }
@media (max-width: 640px) { .ths-arrow { width: 38px; height: 38px; } .ths-prev { left: 8px; } .ths-next { right: 8px; } }

/* ---------- Punkte ---------- */
.ths-dots {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	gap: 9px;
	padding: 6px 10px;
	background: rgba(0, 0, 0, .18);
	border-radius: 999px;
	backdrop-filter: blur(4px);
}
.ths-layout-cards .ths-dots,
.ths-layout-split .ths-dots { position: static; transform: none; margin: 16px auto 0; width: fit-content; background: transparent; backdrop-filter: none; }
.ths-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	cursor: pointer;
	transition: width .25s var(--ths-ease), background .25s;
}
.ths-layout-cards .ths-dot,
.ths-layout-split .ths-dot { background: rgba(18, 34, 42, .3); }
.ths-dot.is-active { width: 26px; border-radius: 999px; background: var(--ths-accent); }
.ths-dot:focus-visible { outline: 2px solid var(--ths-accent); outline-offset: 2px; }

/* Punkte-Positionen */
.ths-dots-bottom-left .ths-dots { left: 16px; transform: none; }
.ths-dots-bottom-right .ths-dots { left: auto; right: 16px; transform: none; }
.ths-dots-below .ths-dots {
	position: static;
	transform: none;
	margin: 14px auto 0;
	background: transparent;
	backdrop-filter: none;
}
.ths-dots-below .ths-dot { background: rgba(18, 34, 42, .3); }
.ths-dots-below .ths-dot.is-active { background: var(--ths-accent); }

/* Pfeil-Positionen */
.ths-arrows-outside { padding-inline: 58px; }
.ths-arrows-outside .ths-prev { left: 4px; }
.ths-arrows-outside .ths-next { right: 4px; }
.ths-arrows-bottom .ths-arrow { top: auto; bottom: 16px; transform: none; }
.ths-arrows-bottom .ths-arrow:hover { transform: scale(1.06); }
.ths-arrows-bottom .ths-prev { left: auto; right: 72px; }
.ths-arrows-bottom .ths-next { right: 16px; }
@media (max-width: 640px) {
	.ths-arrows-outside { padding-inline: 0; }
	.ths-arrows-outside .ths-prev { left: 8px; }
	.ths-arrows-outside .ths-next { right: 8px; }
}

/* ---------- Fortschritt ---------- */
.ths-progress {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 4px;
	z-index: 5;
	background: rgba(255, 255, 255, .25);
}
.ths-layout-cards .ths-progress,
.ths-layout-split .ths-progress { position: static; margin-top: 12px; border-radius: 999px; }
.ths-progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: var(--ths-accent);
	transform-origin: left;
}

/* ---------- Zustände ---------- */
.ths-empty {
	padding: 22px;
	border: 1px dashed #b7c6c6;
	border-radius: 12px;
	background: #f2f7f7;
	color: #365a5a;
	font-size: .95rem;
}
.ths-slider:not(.ths-init) .ths-track { }        /* vor JS: erster Slide sichtbar (Flex) */

/* Ohne JS bleibt der erste Slide der Fade-Variante sichtbar. */
.ths-effect-fade:not(.ths-init) .ths-slide:first-child,
.ths-effect-kenburns:not(.ths-init) .ths-slide:first-child { opacity: 1; visibility: visible; }

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
	.ths-track { transition: none !important; }
	.ths-effect-fade .ths-slide,
	.ths-effect-kenburns .ths-slide { transition: opacity .01ms; }
	.ths-effect-kenburns .ths-slide.is-active .ths-img { animation: none; }
}
