/* Eigener Video-Player (inc/video-player.php, ADR-0028) – Wistia-Look in
   unseren Farben: stumme Vorschau-Schleife, grüner Play-Knopf mittig (überall
   gleich groß), runder Lautsprecher oben rechts, grüne Leiste unten (von
   Anfang an sichtbar; blendet sich beim Abspielen nach 2,5 s ohne Bewegung aus). */

.nsp {
	--nsp-leiste: color-mix(in srgb, var(--wp--preset--color--accent) 62%, transparent);
	--nsp-anteil: 0%;
	position: relative;
	isolation: isolate;
	/* Knöpfe wachsen mit dem Player (wie Wistia): Maße relativ zur kürzeren Seite */
	container-type: size;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.nsp__film {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--wp--preset--color--contrast);
}

/* Eigenes Seitenverhältnis, wo kein Rahmen die Größe vorgibt (Startseite, Impressum) */
.nsp--quer,
.nsp--hoch {
	height: auto;
	border-radius: var(--wp--custom--radius--md);
}

.nsp--quer {
	aspect-ratio: 16 / 9;
}

.nsp--hoch {
	aspect-ratio: 9 / 16;
}

/* ---------- Vor dem Start: Standbild / stumme Schleife ---------- */

.nsp__start {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

/* EWWW legt das Standbild für WebP in ein <picture> – das soll keine eigene
   Rasterzelle bekommen, sonst rutscht das Bild unter den Play-Knopf. */
.nsp__start picture {
	display: contents;
}

.nsp__bild,
.nsp__vorschau {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease, opacity 0.4s ease;
}

.nsp__vorschau {
	opacity: 0;
}

.nsp.vorschau-laeuft .nsp__vorschau {
	opacity: 1;
}

.nsp__start:hover .nsp__bild,
.nsp__start:hover .nsp__vorschau {
	transform: scale(1.03);
}

/* Grüner Play-Knopf wie bei allen Videos */
.nsp__play {
	grid-area: 1 / 1;
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
}

/* Vor dem Start weicht der Play-Knopf beim Drüberfahren dem Bild bzw. der
   Vorschau; „Ton an“ oben rechts bleibt als Hinweis (Elias 12.11.2026: bei
   allen Playern gleich). Nur mit Maus; mit Tastatur (focus-visible) bleibt er
   stehen. Der Knopf im Pause-Zustand (.nsp__mitte) bleibt sichtbar. */
.nsp__play {
	transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
	.nsp__start:hover:not(:focus-visible) .nsp__play {
		opacity: 0;
		transform: scale(0.8);
	}
}

.nsp__play .nsm-fassade__play,
.nsp__mitte .nsm-fassade__play {
	top: 0;
	width: 6.5rem;
	width: clamp(4rem, 35cqmin, 6.5rem);
}

/* Halbdurchsichtig wie bei Wistia auf dunklem Bild (Elias 03.10.): das Video
   scheint durch, auch über hellen Stellen. Beim Drüberfahren voll grün. */
.nsp .nsm-fassade__play {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 55%, transparent);
	backdrop-filter: blur(2px);
	transition: background-color 0.15s;
}

.nsp .nsm-fassade__play::before {
	content: none;
}

.nsp__start:hover .nsm-fassade__play,
.nsp__start:focus-visible .nsm-fassade__play,
.nsp__mitte:hover .nsm-fassade__play {
	background-color: var(--wp--preset--color--accent);
}

/* Runder Lautsprecher oben rechts – vor dem ersten Klick immer (auch wenn die
   Vorschau nicht läuft, z. B. im Stromsparmodus); danach übernimmt die Leiste. */
.nsp__laut {
	/* Pille „Ton an“ (Elias: noch prominenter als nur das Symbol) – dunkel,
	   grüner Lautsprecher, grüner Pulsring */
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	height: 2.75rem;
	padding: 0 1rem 0 0.8rem;
	border-radius: var(--wp--custom--radius--pill);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 88%, transparent);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--accent) 70%, transparent);
	animation: nsp-puls 2s ease-out infinite;
	transition: transform 0.2s ease;
}

.nsp__start:hover .nsp__laut,
.nsp__start:focus-visible .nsp__laut {
	transform: scale(1.06);
}

.nsp__laut svg {
	flex: none;
	width: 1.45rem;
	height: 1.45rem;
	color: var(--wp--preset--color--accent);
}

.nsp__welle {
	animation: nsp-welle 1.4s ease-in-out infinite;
}

.nsp__welle--2 {
	animation-delay: 0.2s;
}

@keyframes nsp-puls {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--accent) 70%, transparent); }
	70%, 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--wp--preset--color--accent) 0%, transparent); }
}

@keyframes nsp-welle {
	0%, 100% { opacity: 0.3; }
	50% { opacity: 1; }
}

.nsp.ist-gestartet .nsp__start {
	display: none;
}

/* Nach dem Klick, bis das Video wirklich läuft: Standbild bleibt stehen,
   der Play-Knopf wird zum Ladekreis (sonst am Handy erst einmal schwarz). */
.nsp.laedt .nsp__start {
	display: grid;
	cursor: progress;
}

.nsp.laedt .nsp__laut,
.nsp.laedt .nsp__mitte {
	display: none;
}

.nsp.laedt .nsp__play svg {
	opacity: 0;
}

.nsp.laedt .nsp__play .nsm-fassade__play::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 1.75rem;
	height: 1.75rem;
	margin: auto;
	border: 3px solid color-mix(in srgb, var(--wp--preset--color--base) 35%, transparent);
	border-top-color: var(--wp--preset--color--base);
	border-radius: 50%;
	animation: nsp-dreh 0.8s linear infinite;
}

@keyframes nsp-dreh {
	to { transform: rotate(360deg); }
}

/* ---------- „auto": der Film läuft von selbst stumm an ----------
   Für Seiten, die nur aus dem Video bestehen (/lp/platz-1-formel/). Browser
   lassen Ton erst nach einem Klick zu. Das Standbild liegt deshalb oben, bis
   der Film wirklich läuft – dann blendet es weg und man sieht den stummen
   Film. „Ton an" und der Play-Knopf bleiben darüber: ein Klick spielt mit Ton
   von vorn. Klappt der stumme Start nicht (iPhone im Stromsparmodus), bleibt
   alles so, wie es vor dem Klick aussieht. */

.nsp--auto.auto-laeuft .nsp__bild {
	opacity: 0;
}

/* Leichter Schleier über dem laufenden Film, damit „Ton an" und der Knopf
   darauf lesbar bleiben. */
.nsp--auto.auto-laeuft .nsp__start {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent);
}

/* ---------- Pausiert: großer Knopf in der Mitte ---------- */

.nsp__mitte {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: none;
	place-items: center;
	padding: 0;
	border: 0;
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 20%, transparent);
	cursor: pointer;
}

.nsp.ist-gestartet.ist-pausiert .nsp__mitte {
	display: grid;
}

/* ---------- Leiste: eine durchgehende grüne Leiste ----------
   Nur sichtbar, solange die Maus über dem Video ist (oder die Tastatur
   darin). Ist die Maus weg oder wird die Seite gescrollt, blendet sie sofort
   aus – auch wenn das Video läuft oder pausiert ist. Am Handy erscheint sie
   nach dem Start. Läuft das Video, blendet das Skript sie nach 2,5 s ohne
   Bewegung aus (Klasse leiste-weg). Elias 11.11.2026: dauernd sichtbar ist
   unnötig, und sie soll schnell weg sein. */

.nsp__leiste {
	position: absolute;
	left: 0.5rem;
	right: 0.5rem;
	bottom: 0.5rem;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 0.125rem;
	height: 2.75rem;
	padding: 0 0.3rem;
	border-radius: 12px;
	background: var(--nsp-leiste);
	backdrop-filter: blur(6px);
	color: var(--wp--preset--color--base);
	opacity: 0;
	transform: translateY(0.5rem);
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Grüne Linie ganz unten, nur in den ersten 10 Sekunden nach dem Start (Elias
   12.11.2026): sie zieht schnell nach rechts und steht nach 10 Sekunden bei der
   Hälfte, dann blendet sie aus. Das Skript setzt --nsp-linie und die Klasse
   anfang. In dieser Zeit zeigt die Leiste weder Zeit noch Balken (Platz bleibt
   frei); beides kommt danach. */
.nsp::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 4;
	width: var(--nsp-linie, 0%);
	height: 5px;
	border-radius: 0 3px 3px 0;
	background: var(--wp--preset--color--accent);
	opacity: 0;
	transition: width 0.3s linear, opacity 0.6s ease;
	pointer-events: none;
}

.nsp.ist-gestartet.anfang::after {
	opacity: 1;
}

.nsp.anfang .nsp__zeit,
.nsp.anfang .nsp__balken {
	visibility: hidden;
}

/* Handy und Tablet (kein Drüberfahren): nach dem Start */
@media (hover: none) {
	.nsp.ist-gestartet:not(.leiste-weg) .nsp__leiste {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

/* Maus über dem Video. Nicht, während die Seite gescrollt wird: :hover bliebe
   sonst hängen, bis sich die Maus bewegt (html.nsp-rollt setzt das Skript). */
@media (hover: hover) {
	html:not(.nsp-rollt) .nsp:hover:not(.leiste-weg) .nsp__leiste {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

/* Tastatur */
.nsp:has(:focus-visible):not(.leiste-weg) .nsp__leiste {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.nsp.leiste-weg {
	cursor: none;
}

.nsp__knopf {
	flex: none;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s;
}

.nsp__knopf:hover,
.nsp__knopf:focus-visible {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 14%, transparent);
}

.nsp__knopf:focus-visible,
.nsp__balken:focus-visible {
	outline: 2px solid var(--wp--preset--color--base);
	outline-offset: 1px;
}

.nsp__knopf svg {
	width: 1.25rem;
	height: 1.25rem;
}

.nsp__zeit {
	flex: none;
	padding: 0 0.3rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Vor dem Start keine Gesamtlänge in der Leiste (Elias 12.11.2026: „3:30“
   schreckt ab, bevor jemand angefangen hat). Ab dem Start steht dort die
   laufende Position; die Länge sieht man dann nur noch am Balken. */
.nsp:not(.ist-gestartet) .nsp__zeit {
	display: none;
}

/* Tempo als Text („1,25×“), feste Breite für die längste Stufe – sonst
   springt der Balken bei jedem Klick */
.nsp__tempo {
	width: 3rem;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	white-space: nowrap;
}

/* Symbol je Zustand */
.nsp .nsp__s-play,
.nsp.ist-pausiert .nsp__s-pause,
.nsp .nsp__s-stumm,
.nsp.ist-stumm .nsp__s-ton {
	display: none;
}

.nsp.ist-pausiert .nsp__s-play,
.nsp.ist-stumm .nsp__s-stumm {
	display: block;
}

.nsp__balken {
	flex: 1;
	min-width: 0;
	height: 1.25rem;
	margin: 0 0.3rem;
	background: transparent;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.nsp__balken::-webkit-slider-runnable-track {
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--wp--preset--color--base) var(--nsp-anteil), color-mix(in srgb, var(--wp--preset--color--base) 45%, transparent) var(--nsp-anteil));
}

.nsp__balken::-moz-range-track {
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--wp--preset--color--base) var(--nsp-anteil), color-mix(in srgb, var(--wp--preset--color--base) 45%, transparent) var(--nsp-anteil));
}

.nsp__balken::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 11px;
	height: 11px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
}

.nsp__balken::-moz-range-thumb {
	width: 11px;
	height: 11px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
}

/* Vollbild: Video ganz zeigen statt beschneiden */
.nsp:fullscreen {
	border-radius: 0;
	background: var(--wp--preset--color--contrast);
}

.nsp:fullscreen .nsp__film {
	object-fit: contain;
}

/* Schmale Player (Kundenstimme im Hochformat, Tablet 256 px): Knöpfe enger,
   damit der Balken mit Tempo-Knopf noch greifbar bleibt */
@container (max-width: 300px) {
	.nsp__knopf {
		width: 2rem;
	}

	.nsp__tempo {
		width: 2.5rem;
	}

	.nsp__zeit {
		padding: 0 0.15rem;
	}

	.nsp__zeit,
	.nsp__tempo {
		font-size: var(--wp--preset--font-size--xs);
	}

	.nsp__balken {
		margin: 0 0.2rem;
	}
}

/* Kleine Player (Querformat am Handy): Leiste und Lautsprecher kompakter */
@container (max-height: 260px) {
	.nsp__laut {
		top: 0.5rem;
		right: 0.5rem;
		height: 2.1rem;
		padding: 0 0.75rem 0 0.6rem;
		gap: 0.35rem;
		font-size: var(--wp--preset--font-size--xs);
	}

	.nsp__laut svg {
		width: 1.15rem;
		height: 1.15rem;
	}

	/* schmal am unteren Rand, damit eingebrannte Untertitel frei bleiben */
	.nsp__leiste {
		left: 0.3rem;
		right: 0.3rem;
		bottom: 0.3rem;
		height: 2rem;
		border-radius: 9px;
	}

	.nsp__knopf {
		width: 1.75rem;
		height: 1.75rem;
	}

	.nsp__knopf svg {
		width: 1.1rem;
		height: 1.1rem;
	}

	.nsp__tempo {
		width: 2.5rem;
	}

	.nsp__zeit,
	.nsp__tempo {
		font-size: var(--wp--preset--font-size--xs);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nsp__laut,
	.nsp__welle {
		animation: none;
	}
}

/* ---------- Rahmen ums Video, kippt mit der Maus ----------
   (Elias 12.11.2026, Vorbild heartbeat-consulting.com.) Aufbau:
   .nsp-buehne > .nsp-rahmen[data-nsp-kippen] > Player. Heller Rand, grüner
   Schein. Am Desktop neigt sich der Rahmen zur Maus – video-player.js setzt
   --nsp-kipp-x/-y und den Lichtfleck. Ohne Maus, bei „Bewegung reduzieren“ und
   solange das Video mit Ton läuft, steht er gerade. Genutzt im Hero der
   Audit-Landingpage und im Video-Abschnitt der Startseite. */
.nsp-buehne {
	perspective: 1100px;
}

.nsp-rahmen {
	--nsp-kipp-x: 0deg;
	--nsp-kipp-y: 0deg;
	--nsp-licht-x: 50%;
	--nsp-licht-y: 0%;
	--nsp-licht: 0;
	position: relative;
	padding: 0.625rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast-light) 16%, transparent);
	border-radius: calc(var(--wp--custom--radius--md) + 0.625rem);
	background: color-mix(in srgb, var(--wp--preset--color--contrast-light) 6%, transparent);
	box-shadow:
		calc(var(--nsp-kipp-y) / 1deg * -2px) calc(1.5rem + var(--nsp-kipp-x) / 1deg * 2px) 4rem -1rem color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent),
		inset 0 1px 0 color-mix(in srgb, var(--wp--preset--color--contrast-light) 18%, transparent);
	transform: rotateX(var(--nsp-kipp-x)) rotateY(var(--nsp-kipp-y));
}

/* Lichtfleck, der der Maus folgt */
.nsp-rahmen::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	border-radius: inherit;
	background: radial-gradient(circle 22rem at var(--nsp-licht-x) var(--nsp-licht-y), color-mix(in srgb, var(--wp--preset--color--contrast-light) 14%, transparent), transparent 70%);
	opacity: var(--nsp-licht);
	transition: opacity 0.3s ease;
	pointer-events: none;
}

@media (max-width: 767px) {
	.nsp-rahmen {
		padding: 0.4rem;
		border-radius: calc(var(--wp--custom--radius--md) + 0.4rem);
	}
}
