/* TV Slider – Frontend (auch für die Backend-Vorschau genutzt).
   Responsive per Container Query: Breakpoints orientieren sich an Bootstrap 5 (768 / 992). */

.tvs {
	--tvs-dur: 600ms;
	--tvs-h-d: 520px;
	--tvs-h-t: 480px;
	--tvs-h-m: 640px;
	--tvs-nav: #19f0b4;
	--tvs-dot: #cfcfcf;
	--tvs-px: clamp(24px, 11cqw, 200px);
	position: relative;
	width: 100%;
	overflow: hidden;
	container-type: inline-size;
	container-name: tvs;
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.2;
	text-align: left;
}

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

.tvs.tvs--pending .tvs__viewport,
.tvs.tvs--pending .tvs__dots {
	visibility: hidden;
	/* Fallback: falls das JS nicht läuft, nach 1,5 s trotzdem anzeigen. */
	animation: tvs-reveal 0s linear 1.5s forwards;
}

@keyframes tvs-reveal {
	to {
		visibility: visible;
	}
}

.tvs__viewport {
	overflow: hidden;
	touch-action: pan-y;
}

.tvs__track {
	display: flex;
	transition: transform var(--tvs-dur) ease-in-out;
	will-change: transform;
}

.tvs__track.is-dragging {
	transition: none;
}

/* ---------- Slide ---------- */

.tvs .tvs__slide {
	position: relative;
	flex: 0 0 100%;
	min-width: 0;
	min-height: var(--tvs-h-d);
	display: flex;
	overflow: hidden;
	background: var(--tvs-g1, #1f8a14);
	color: var(--tvs-dc, #fff);
}

.tvs .tvs__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

.tvs .tvs__ov {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(var(--tvs-angle, 160deg), var(--tvs-g1, #1f8a14), var(--tvs-g2, #3aaeaa));
	opacity: var(--tvs-ov, 1);
}

.tvs .tvs__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	grid-template-rows: auto auto;
	grid-template-areas:
		"text media"
		"action media";
	align-content: center;
	column-gap: 4cqw;
	padding: clamp(40px, 5cqw, 72px) var(--tvs-px) clamp(88px, 12cqw, 180px);
}

/* ---------- Text ---------- */

.tvs .tvs__text {
	grid-area: text;
	align-self: end;
	min-width: 0;
}

.tvs .tvs__desc {
	margin: 0 0 clamp(10px, 1.4cqw, 20px);
	padding: 0;
	font-family: inherit;
	font-size: clamp(15px, 1.7cqw, 24px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	color: var(--tvs-dc, #fff);
}

.tvs .tvs__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: clamp(26px, 3.4cqw, 52px);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: normal;
	text-transform: none;
	color: var(--tvs-hc, #fff);
	overflow-wrap: break-word;
	hyphens: auto;
}

/* ---------- Button ---------- */

.tvs .tvs__action {
	grid-area: action;
	align-self: start;
	margin-top: clamp(20px, 2.4cqw, 36px);
}

.tvs .tvs__btn {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: clamp(12px, 1.3cqw, 18px) clamp(18px, 1.7cqw, 24px);
	border: 0;
	border-radius: 16px;
	color: var(--tvs-bc, #000);
	font-family: inherit;
	font-size: clamp(14px, 1.4cqw, 20px);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: transform 0.2s ease, filter 0.2s ease;
}

.tvs .tvs__btn.tvs__btn--custom {
	background: linear-gradient(90deg, var(--tvs-bbg, #fff), var(--tvs-bbg2, var(--tvs-bbg, #fff)));
}

.tvs .tvs__btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
	color: var(--tvs-bc, #000);
	text-decoration: none;
}

.tvs .tvs__btn:focus-visible,
.tvs .tvs__dot:focus-visible,
.tvs .tvs__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
	box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.35);
}

.tvs .tvs__chev {
	flex: none;
}

/* ---------- Icon rechts ---------- */

.tvs .tvs__media {
	grid-area: media;
	align-self: center;
	justify-self: end;
	width: clamp(200px, 30cqw, 440px);
	max-width: 100%;
}

.tvs .tvs__media img,
.tvs .tvs__icon {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0;
}

/* ---------- Dots + Pfeile ---------- */

.tvs .tvs__dots {
	position: absolute;
	z-index: 5;
	left: var(--tvs-px);
	bottom: clamp(24px, 6cqw, 90px);
	display: flex;
	gap: 12px;
}

.tvs .tvs__dot {
	appearance: none;
	width: 14px;
	height: 14px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--tvs-dot);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.2s ease;
}

.tvs .tvs__dot.is-active {
	background: var(--tvs-dot);
}

.tvs .tvs__arrows {
	position: absolute;
	z-index: 5;
	right: var(--tvs-px);
	bottom: clamp(20px, 5.2cqw, 80px);
	display: flex;
	gap: 12px;
}

.tvs .tvs__arrow {
	appearance: none;
	width: clamp(40px, 4.4cqw, 64px);
	height: clamp(40px, 4.4cqw, 64px);
	min-width: 0;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--tvs-nav);
	border-radius: 14px;
	background: transparent;
	color: var(--tvs-nav);
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tvs .tvs__arrow:hover {
	background: var(--tvs-nav);
	color: #000;
}

.tvs .tvs__arrow:disabled {
	opacity: 0.35;
	cursor: default;
	background: transparent;
	color: var(--tvs-nav);
}

/* ---------- Tablet (< 992px) ---------- */

@container tvs (max-width: 991.98px) {
	.tvs .tvs__slide {
		min-height: var(--tvs-h-t);
	}

	.tvs .tvs__inner {
		--tvs-px: clamp(24px, 6cqw, 64px);
	}

	.tvs .tvs__dots,
	.tvs .tvs__arrows {
		--tvs-px: clamp(24px, 6cqw, 64px);
	}

	.tvs .tvs__title {
		font-size: clamp(26px, 4.6cqw, 40px);
	}

	.tvs .tvs__desc {
		font-size: clamp(15px, 2.2cqw, 20px);
	}

	.tvs .tvs__btn {
		font-size: 16px;
		padding: 14px 20px;
	}

	.tvs .tvs__media {
		width: clamp(180px, 34cqw, 320px);
	}

	.tvs .tvs__arrow {
		width: 44px;
		height: 44px;
	}
}

/* ---------- Mobile (< 768px): gestapelt, Button wird Text-Link ---------- */

@container tvs (max-width: 767.98px) {
	.tvs .tvs__slide {
		min-height: var(--tvs-h-m);
	}

	.tvs .tvs__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto 1fr auto;
		grid-template-areas:
			"text"
			"media"
			"action";
		align-content: stretch;
		column-gap: 0;
		padding: 64px 24px 28px;
	}

	.tvs .tvs__text {
		align-self: start;
	}

	.tvs .tvs__desc {
		font-size: 17px;
		margin-bottom: 14px;
	}

	.tvs .tvs__title {
		font-size: clamp(28px, 8.4cqw, 38px);
	}

	.tvs .tvs__media {
		justify-self: center;
		align-self: center;
		width: min(72%, 300px);
		margin: 24px 0;
	}

	.tvs .tvs__action {
		align-self: end;
		margin-top: 0;
	}

	.tvs .tvs__btn,
	.tvs .tvs__btn.tvs__btn--custom {
		padding: 8px 0;
		border-radius: 0;
		background: none;
		color: var(--tvs-hc, #fff);
		font-size: 17px;
	}

	.tvs .tvs__btn:hover {
		color: var(--tvs-hc, #fff);
		transform: none;
		filter: none;
	}

	.tvs .tvs__dots {
		left: 50%;
		bottom: auto;
		top: 24px;
		transform: translateX(-50%);
	}

	.tvs .tvs__arrows {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tvs__track {
		transition-duration: 0.01ms;
	}
}
