/* Bedienleiste für die Filme in ReZuKi-Blau, Fassung 3 (Test, 30.10.2026).
   Gehört zu assets/js/videosteuerung3.js: Startseite, Für Unternehmen, Partner.
   Flach und einzeilig wie Fassung 1: durchgehendes Blau ohne Verlauf,
   48 px hoch. Neu gegenüber Fassung 1: Lautstärke, Bild im Bild und das
   Menü „Weitere Optionen“ mit Geschwindigkeit und Herunterladen.
   Weiß auf #024B89: 8,9:1. */
.vs { container-type: inline-size; }
.vs .film__video { cursor: pointer; }

.vs-leiste {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 8px;
  color: #fff;
  background: var(--blau);
  transition: opacity .25s ease, transform .25s ease;
}
/* Ausgeblendet: beim Abspielen ohne Bewegung und vor dem ersten Start.
   Mit Tastaturfokus oder offenem Menü bleibt sie sichtbar. */
.vs--laeuft:not(.vs--aktiv):not(.vs--menu):not(:focus-within) .vs-leiste,
.vs--bereit:not(.vs--ende):not(.vs--menu):not(:focus-within) .vs-leiste {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.vs-zeile {
  display: flex;
  align-items: center;
  gap: 2px;
}

.vs-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.vs-btn:hover, .vs-btn[aria-expanded="true"] { background: var(--blau-dark); }
.vs-btn[hidden] { display: none; }
.vs svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.vs .vs-strich {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vs-btn [data-icon] { display: none; }
.vs-btn[data-aktion="pip"] [data-icon],
.vs-btn[data-aktion="mehr"] [data-icon],
.vs-btn[data-state="paused"]  [data-icon="play"],
.vs-btn[data-state="playing"] [data-icon="pause"],
.vs-btn[data-state="an"]      [data-icon="ton"],
.vs-btn[data-state="aus"]     [data-icon="stumm"],
.vs-btn[data-aktion="voll"][data-state="aus"] [data-icon="voll"],
.vs-btn[data-aktion="voll"][data-state="an"]  [data-icon="vollaus"] { display: block; }

.vs-zeit, .vs-tempo-anzeige {
  flex: none;
  padding: 0 6px;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vs-tempo-anzeige[hidden] { display: none; }

/* Schieberegler (Fortschritt und Lautstärke): Weiß für den Wert,
   halbes Weiß für den Rest (3,4:1). */
.vs-fortschritt, .vs-lautstaerke {
  --fortschritt: 0%;
  display: block;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
          appearance: none;
  cursor: pointer;
}
.vs-fortschritt { flex: 1 1 auto; min-width: 48px; margin: 0 8px; }
.vs-fortschritt::-webkit-slider-runnable-track,
.vs-lautstaerke::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #fff var(--fortschritt), rgba(255, 255, 255, .5) var(--fortschritt));
}
.vs-fortschritt::-webkit-slider-thumb,
.vs-lautstaerke::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.vs-fortschritt::-moz-range-track,
.vs-lautstaerke::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .5); }
.vs-fortschritt::-moz-range-progress,
.vs-lautstaerke::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.vs-fortschritt::-moz-range-thumb,
.vs-lautstaerke::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.vs-fortschritt:focus-visible, .vs-lautstaerke:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* Lautstärke: klappt beim Zeigen auf den Tonknopf nach links auf und nimmt
   den Platz vom Fortschrittsbalken, die Leiste bleibt gleich hoch. */
.vs-ton { flex: none; display: flex; align-items: center; }
.vs-lautstaerke {
  width: 0;
  opacity: 0;
  transition: width .2s ease, opacity .2s ease, margin .2s ease;
}
.vs-ton:hover .vs-lautstaerke,
.vs-ton:focus-within .vs-lautstaerke { width: 72px; margin: 0 4px 0 6px; opacity: 1; }
/* Touch-Geräte: Lautstärke regelt das Gerät, nur der Tonknopf bleibt */
@media (hover: none) { .vs-lautstaerke { display: none; } }

/* Menü „Weitere Optionen“: öffnet über der Leiste */
.vs-menu {
  position: absolute;
  right: 8px; bottom: 56px;
  width: 216px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(27, 31, 35, .22);
}
.vs-menu[hidden] { display: none; }
.vs-menu-titel {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-mute);
}
.vs-tempi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.vs-tempo {
  height: 32px;
  padding: 0;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--offwhite);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.vs-tempo:hover { background: #e9e6dd; }
.vs-tempo[aria-pressed="true"] { color: #fff; background: var(--blau); }
.vs-menu-punkt {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 8px;
  font-size: var(--fs-md);
  color: var(--text);
  text-decoration: none;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.vs-menu-punkt:hover { color: var(--blau); }
.vs-menu-punkt svg { width: 18px; height: 18px; }
.vs-menu :focus-visible { outline: 2px solid var(--blau); outline-offset: 1px; }

/* Startknopf vor dem ersten Abspielen und am Ende. Unten links, weil die
   Startbilder dort frei sind; mittig läge er über Logo oder Text. */
.vs-start {
  position: absolute;
  left: 24px; bottom: 24px;
  display: none;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px 0 16px;
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: var(--blau);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(27, 31, 35, .14);
  cursor: pointer;
}
.vs-start svg { width: 18px; height: 18px; }
.vs-start:hover { background: var(--blau-dark); }
.vs--bereit .vs-start { display: inline-flex; }
/* Ist die Leiste vor dem Start per Tastatur sichtbar, rückt der Knopf darüber */
.vs--bereit:has(.vs-leiste:focus-within) .vs-start { bottom: 64px; }

/* Vollbild: Film ganz zeigen, Fläche wie im Film */
.vs:fullscreen { border: 0; border-radius: 0; background: var(--offwhite); }
.vs:fullscreen .film__video { object-fit: contain; }
.vs:-webkit-full-screen { border: 0; border-radius: 0; background: var(--offwhite); }
.vs:-webkit-full-screen .film__video { object-fit: contain; }

/* Schmale Filme (Handy): Zeit und Bild im Bild entfallen, damit der
   Fortschrittsbalken Platz hat. Das Menü liegt über der Leiste. */
@container (max-width: 420px) {
  .vs-leiste { padding: 2px 4px; }
  .vs-zeit, .vs-btn[data-aktion="pip"] { display: none; }
  .vs-fortschritt { margin: 0 6px; }
  .vs-menu { right: 4px; bottom: 4px; }
  .vs--bereit:has(.vs-leiste:focus-within) .vs-start { bottom: 54px; }
  /* Auf dem Handy nur das Symbol, die Beschriftung bleibt für Screenreader */
  .vs-start { left: 10px; bottom: 10px; width: 44px; height: 44px; padding: 0; justify-content: center; }
  .vs-start svg { margin-left: 2px; }
  .vs-start-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vs-leiste, .vs-lautstaerke { transition: none; }
}
