/* ==========================================================
   HERO VIDEO – SWITCH FÜR ZWEI VIDEOS

   Für Grammatikthemen mit zwei Lernvideos (z. B. "Erklärung"
   und "Anwendung"). Liegt sichtbar auf dem Video-Poster,
   zeigt klar an, welche Option aktiv ist, schaltet aber
   selbst nur um – abgespielt wird weiterhin ausschließlich
   über Klick auf den Play-Button.

   Zugehöriges Script: /scripts/grammar-new/hero-video-switch.js
   Einfügen z. B. direkt nach dem Block "HERO VIDEO"
   (.sg-hero-video__label) in grammar-exercises-master_neu.css

   WICHTIG: .sg-hero-video-visual muss bei jedem Breakpoint
   dieselbe Breite haben wie .sg-hero-video selbst (siehe die
   3 bestehenden Breakpoints für .sg-hero-video weiter unten
   in grammar-exercises-master_neu.css) – sonst kollabiert der
   Wrapper auf 0×0, weil .sg-hero-video seine eigene Breite als
   "100%" von diesem Wrapper berechnet (zirkulärer Bezug).
   ========================================================== */

.sg-hero-video-visual {
  position: relative;

  width: min(100%, 420px);
}


.sg-hero-video-switch {
  position: absolute;

  top: 14px;
  left: 14px;
  z-index: 2;

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  padding: 3px;

  background: rgba(20, 22, 26, 0.42);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}


.sg-hero-video-switch__highlight {
  position: absolute;

  top: 3px;
  left: 3px;

  width: calc(50% - 3px);
  height: calc(100% - 6px);

  background: rgba(255, 255, 255, 0.97);

  border-radius: 999px;

  transition: transform 220ms ease;
}


.sg-hero-video-switch.is-secondary .sg-hero-video-switch__highlight {
  transform: translateX(100%);
}


.sg-hero-video-switch__option {
  position: relative;
  z-index: 1;

  min-width: 92px;

  padding: 7px 14px;

  background: transparent;

  color: rgba(255, 255, 255, 0.86);

  border: 0;

  cursor: pointer;

  text-align: center;
  white-space: nowrap;

  font-size: 0.74rem;
  font-weight: 680;

  transition: color 200ms ease;
}


.sg-hero-video-switch__option.is-active {
  color: #202124;
}


/* Mobile: minimal kompakter */

@media (max-width: 380px) {

  .sg-hero-video-switch {
    top: 10px;
    left: 10px;
  }


  .sg-hero-video-switch__option {
    min-width: 78px;

    padding: 6px 10px;

    font-size: 0.68rem;
  }

}


/* Hover (nur Geräte mit echtem Zeiger) */

@media (hover: hover) and (pointer: fine) {

  .sg-hero-video-switch__option:not(.is-active):hover {
    color: #fff;
  }

}


/* Dark Mode */

@media (prefers-color-scheme: dark) {

  .sg-hero-video-switch {
    border-color: rgba(255, 255, 255, 0.22);
  }

}


/* Reduzierte Bewegung */

@media (prefers-reduced-motion: reduce) {

  .sg-hero-video-switch__highlight {
    transition: none;
  }

}
