/* TS Video-Galerie – Frontend */
.tsv {
	--tsv-accent: #a50f0f;
	--tsv-text: #0b2a66;
	--tsv-radius: 28px;
	--tsv-tint: 226, 234, 247;
	position: relative;
	color: var(--tsv-text);
	font-family: inherit;
	margin: 0 auto;
	max-width: 1700px;
}
.tsv, .tsv *, .tsv *::before, .tsv *::after { box-sizing: border-box; }
/* Hintergrund aus dem Layout: heller Himmel, Horizontlinie, hellblauer Boden */
.tsv--bg { padding: clamp(32px, 5vw, 80px) clamp(16px, 5.5vw, 113px); }
.tsv--bg-layout {
	background: linear-gradient(180deg,
		#ffffff 0%, #f4f9ff 17%, #e9f3ff 34%, #ddeefe 51%, #d8eaff 61%,
		#e3f1fe 62.6%, #fcfdff 64.3%, #f6fbff 67.6%, #eef5ff 76%, #e3f0ff 84.5%, #d8eaff 93%, #d8eaff 100%);
}
.tsv--bg-image { background: #e9f3ff var(--tsv-bg-image) center / cover no-repeat; }
.tsv .tsv-inner { max-width: 1700px; margin: 0 auto; width: 100%; }

/* Volle Bildschirmbreite, auch innerhalb eines Seiten-Containers */
.tsv--full {
	--tsv-vw: calc(100vw - var(--tsv-sbw, 0px));
	width: var(--tsv-vw) !important;
	max-width: none !important;
	margin-left: calc(50% - var(--tsv-vw) / 2) !important;
	margin-right: calc(50% - var(--tsv-vw) / 2) !important;
}
.tsv--full:not(.tsv--bg) { padding-left: clamp(16px, 5.5vw, 113px); padding-right: clamp(16px, 5.5vw, 113px); }
/* Mindestens Bildschirmhöhe, Inhalt mittig */
.tsv--screen { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }

/* Reiter */
.tsv .tsv-tabs {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0 0 30px;
	padding: 2px;
	overflow-x: auto;
	scrollbar-width: none;
}
.tsv .tsv-tabs::-webkit-scrollbar { display: none; }
.tsv .tsv-tabs .tsv-tab {
	flex: 0 0 auto;
	appearance: none;
	margin: 0;
	padding: 8px 26px;
	min-height: 0;
	border: 1.5px solid var(--tsv-accent);
	border-radius: 999px;
	background: rgba(255, 255, 255, .65);
	color: var(--tsv-accent);
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tsv .tsv-tabs .tsv-tab:hover { background: #fff; }
.tsv .tsv-tabs .tsv-tab.is-active { background: var(--tsv-accent); color: #fff; }
.tsv .tsv-tabs .tsv-tab:focus-visible,
.tsv button:focus-visible,
.tsv .tsv-details:focus-visible,
.tsv .tsv-track:focus-visible { outline: 2px solid var(--tsv-accent); outline-offset: 3px; }

/* Bühne mit Pfeilen */
.tsv .tsv-stage {
	display: grid;
	grid-template-columns: 44px minmax(0, 1020px) 44px;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
}
.tsv .tsv-nav {
	appearance: none;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1.5px solid var(--tsv-accent);
	border-radius: 50%;
	background: rgba(255, 255, 255, .5);
	color: var(--tsv-accent);
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .2s, color .2s;
}
.tsv .tsv-nav:hover { background: var(--tsv-accent); color: #fff; }
.tsv .tsv-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Karte */
.tsv .tsv-card {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--tsv-radius);
	overflow: hidden;
	background: #cfd9ea;
	box-shadow: 0 50px 60px -40px rgba(46, 92, 170, .35);
	isolation: isolate;
}
.tsv .tsv-media { position: absolute; inset: 0; overflow: hidden; }
.tsv .tsv-backdrop {
	position: absolute;
	inset: -40px;
	background: center / cover no-repeat;
	filter: blur(30px) saturate(1.1);
	opacity: 0;
	transition: opacity .3s;
}
.tsv .tsv-card.is-portrait .tsv-backdrop { opacity: .8; }
.tsv .tsv-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: transparent;
	cursor: pointer;
	transition: opacity .18s ease;
}
.tsv .tsv-card.is-portrait:not(.is-yt) .tsv-video { object-fit: contain; }
.tsv .tsv-card.is-switching .tsv-video { opacity: 0; }

/* Wechsel-Animation: ganze Karte als Karussell */
.tsv { overflow-x: clip; }
.tsv .tsv-stage { position: relative; }
.tsv .tsv-nav { position: relative; z-index: 3; }
.tsv {
	--tsv-gap: 50px;          /* Abstand zwischen zwei Karten beim Wechsel */
	--tsv-slide: .9s;         /* Dauer der Bewegung */
	--tsv-ease: cubic-bezier(.65, 0, .35, 1);
}
/* Einfahrende Karte: wird früh sichtbar und scharf */
.tsv .tsv-card {
	transition:
		transform var(--tsv-slide) var(--tsv-ease),
		opacity .45s ease,
		filter .5s ease;
	will-change: transform, opacity, filter;
}
.tsv .tsv-card.tsv-no-anim { transition: none; }
.tsv .tsv-card.is-enter-right { transform: translateX(var(--tsv-shift, 110%)); opacity: 0; filter: blur(10px); }
.tsv .tsv-card.is-enter-left { transform: translateX(calc(-1 * var(--tsv-shift, 110%))); opacity: 0; filter: blur(10px); }
/* Ausfahrende Karte: bewegt sich zuerst scharf, wird erst später unscharf und blass */
.tsv .tsv-ghost { position: absolute; margin: 0; z-index: 1; pointer-events: none; }
.tsv .tsv-card.tsv-ghost {
	transition:
		transform var(--tsv-slide) var(--tsv-ease),
		opacity .5s ease .4s,
		filter .5s ease .35s;
}
.tsv .tsv-card.tsv-ghost.is-leave-left { transform: translateX(calc(-1 * var(--tsv-shift, 110%))); opacity: 0; filter: blur(10px); }
.tsv .tsv-card.tsv-ghost.is-leave-right { transform: translateX(var(--tsv-shift, 110%)); opacity: 0; filter: blur(10px); }
.tsv .tsv-snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tsv .tsv-card.is-portrait .tsv-snap { object-fit: contain; }
.tsv .tsv-ghost .tsv-tools { display: none; }
/* Spulen beim Reiterwechsel: Streifen aller übersprungenen Videos */
.tsv .tsv-reel { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; z-index: 1; pointer-events: none; will-change: transform, filter, opacity; }
.tsv .tsv-reel .tsv-ghost { transition: none; transform: none; opacity: 1; filter: none; }

/* Play-Knopf */
.tsv .tsv-play {
	position: absolute;
	left: 50%;
	top: 46%;
	width: 84px;
	height: 84px;
	margin: -42px 0 0 -42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	color: var(--tsv-accent);
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(11, 42, 102, .2);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: transform .2s, opacity .2s;
	z-index: 3;
}
.tsv .tsv-play:hover { transform: scale(1.06); }
.tsv .tsv-play svg { width: 34px; height: 34px; margin-left: 4px; fill: currentColor; }
.tsv .tsv-card.is-playing .tsv-play { opacity: 0; pointer-events: none; }

/* Werkzeuge oben rechts */
.tsv .tsv-tools {
	position: absolute;
	top: 18px;
	right: 18px;
	display: flex;
	gap: 8px;
	z-index: 3;
	opacity: 0;
	transition: opacity .2s;
}
.tsv .tsv-card:hover .tsv-tools,
.tsv .tsv-card:focus-within .tsv-tools,
.tsv .tsv-card.is-muted .tsv-tools { opacity: 1; }
.tsv .tsv-tool {
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .75);
	color: var(--tsv-text);
	display: grid;
	place-items: center;
	cursor: pointer;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.tsv .tsv-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tsv .tsv-mute .tsv-ico-off { display: none; }
.tsv .tsv-card.is-muted .tsv-mute .tsv-ico-on { display: none; }
.tsv .tsv-card.is-muted .tsv-mute .tsv-ico-off { display: inline; }

/* Overlay unten */
.tsv .tsv-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 90px 16px 16px 36px;
	background: linear-gradient(to top, rgba(var(--tsv-tint), .9) 0%, rgba(var(--tsv-tint), .72) 55%, rgba(var(--tsv-tint), 0) 100%);
	z-index: 2;
	pointer-events: none;
}
.tsv .tsv-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	-webkit-mask-image: linear-gradient(to top, #000 45%, transparent 100%);
	mask-image: linear-gradient(to top, #000 45%, transparent 100%);
}
.tsv .tsv-text { padding-right: 140px; }
.tsv .tsv-label {
	margin: 0 0 6px;
	padding: 0;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--tsv-text);
	letter-spacing: 0;
	text-transform: none;
}
.tsv .tsv-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: clamp(16px, 1.6vw, 21px);
	line-height: 1.35;
	font-weight: 400;
	color: var(--tsv-text);
	letter-spacing: 0;
	text-transform: none;
}
.tsv .tsv-bar {
	display: flex;
	align-items: center;
	gap: 36px;
	margin-top: 14px;
	pointer-events: auto;
}
.tsv .tsv-track {
	position: relative;
	flex: 1;
	height: 18px;
	cursor: pointer;
}
.tsv .tsv-track::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 8px;
	height: 2px;
	background: rgba(255, 255, 255, .9);
	border-radius: 2px;
}
.tsv .tsv-fill {
	position: absolute;
	left: 0;
	top: 7px;
	height: 4px;
	width: 0;
	background: var(--tsv-accent);
	border-radius: 2px;
	transition: width .25s linear;
}
.tsv .tsv-details,
.tsv .tsv-details:visited {
	flex: 0 0 auto;
	display: inline-block;
	padding: 9px 29px;
	border-radius: 999px;
	background: var(--tsv-accent);
	color: #fff;
	font-size: 16px;
	line-height: 1.4;
	font-weight: 500;
	text-decoration: none;
	transition: filter .2s;
}
.tsv .tsv-details:hover { filter: brightness(1.15); color: #fff; }
.tsv .tsv-details[hidden] { display: none; }
.tsv .tsv-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	margin: 0;
}


/* Vorschaubild (für YouTube-Einträge) und YouTube-Player */
.tsv .tsv-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: none;
	cursor: pointer;
	margin: 0;
	max-width: none;
	border-radius: 0;
}
.tsv .tsv-card.is-yt .tsv-poster { display: block; }
.tsv .tsv-card.is-yt .tsv-video { visibility: hidden; }
.tsv .tsv-card.is-yt.is-portrait .tsv-poster { object-fit: cover; }
.tsv .tsv-yt { position: absolute; inset: 0; display: none; z-index: 2; background: #000; }
.tsv .tsv-card.is-yt-active .tsv-yt { display: block; }
.tsv .tsv-card.is-yt-active.is-portrait .tsv-poster { visibility: hidden; }
.tsv .tsv-card.is-portrait .tsv-yt { background: transparent; }
.tsv .tsv-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tsv .tsv-card.is-portrait .tsv-yt iframe { left: 50%; right: auto; width: auto; aspect-ratio: 9 / 16; transform: translateX(-50%); }
.tsv .tsv-card.is-yt-active .tsv-play,
.tsv .tsv-card.is-yt .tsv-tools,
.tsv .tsv-card.is-yt .tsv-track { visibility: hidden; }
.tsv .tsv-card.is-yt .tsv-track { pointer-events: none; }

/* Einwilligung YouTube */
.tsv .tsv-consent {
	position: absolute;
	left: 50%;
	top: 46%;
	transform: translate(-50%, -50%);
	z-index: 4;
	width: min(460px, calc(100% - 32px));
	padding: 22px 24px 18px;
	border-radius: 18px;
	background: rgba(255, 255, 255, .94);
	color: var(--tsv-text);
	box-shadow: 0 20px 50px rgba(11, 42, 102, .25);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
}
.tsv .tsv-consent[hidden] { display: none; }
.tsv .tsv-consent p { margin: 0 0 14px; font-size: 14px; color: var(--tsv-text); }
.tsv .tsv-consent a { color: var(--tsv-accent); text-decoration: underline; }
.tsv .tsv-consent .tsv-consent-ok {
	appearance: none;
	border: 0;
	margin: 0 0 12px;
	padding: 10px 28px;
	border-radius: 999px;
	background: var(--tsv-accent);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}
.tsv .tsv-consent label { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 12.5px; color: var(--tsv-text); cursor: pointer; }
.tsv .tsv-consent input { margin: 0; }

@media (min-width: 601px) {
	/* YouTube-Player nicht überdecken, solange er läuft */
	.tsv .tsv-card.is-yt-active .tsv-overlay { opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
}

/* Vollbild */
.tsv .tsv-card:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.tsv .tsv-card:fullscreen .tsv-video { object-fit: contain; background: #000; }

/* Tablet und Mobil */
@media (max-width: 900px) {
	.tsv .tsv-stage { grid-template-columns: 1fr 1fr; gap: 16px; }
	.tsv .tsv-card { grid-column: 1 / -1; grid-row: 1; }
	.tsv .tsv-prev { grid-row: 2; justify-self: end; }
	.tsv .tsv-next { grid-row: 2; justify-self: start; }
	.tsv .tsv-tabs { justify-content: flex-start; margin-bottom: 20px; }
}
@media (max-width: 600px) {
	.tsv { --tsv-radius: 18px; }
	/* Video oben, Text darunter – nichts verdeckt das Bild */
	.tsv .tsv-card { aspect-ratio: auto; display: flex; flex-direction: column; background: rgb(var(--tsv-tint)); }
	.tsv .tsv-media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
	.tsv .tsv-card.is-portrait .tsv-media { aspect-ratio: 4 / 5; }
	.tsv .tsv-play { top: 50%; }
	.tsv .tsv-track::before { background: rgba(11, 42, 102, .15); }
	.tsv .tsv-overlay { position: relative; padding: 14px 14px 14px 18px; background: rgb(var(--tsv-tint)); }
	.tsv .tsv-overlay::before { display: none; }
	.tsv .tsv-text { padding-right: 0; }
	.tsv .tsv-bar { gap: 16px; }
	.tsv .tsv-details { padding: 7px 20px; font-size: 14px; }
	.tsv .tsv-tabs .tsv-tab { padding: 7px 18px; font-size: 14px; }
	.tsv .tsv-play { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
	.tsv .tsv-tools { opacity: 1; top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.tsv * { transition: none !important; }
}
