/* =========================================================================
   HyperVision by Erik – Videos (videos.css)
   Ergänzt base.css. Bewegung nur über --p aus js/main.js (data-scroll="reveal"),
   nichts zeitgesteuert.
   ========================================================================= */

/* ---------- Seitenkopf ---------- */
/* Kopf und erste Gruppe enger, damit auf dem Desktop schon im ersten Bild Videos anlaufen */
.video-head { padding-block: clamp(2.5rem, 8vw, 6.5rem) clamp(2.5rem, 5vw, 4rem); }
/* Gruppen im gleichen Takt wie die Serien auf fotos.html (vorher volle Sektionshöhe:
   auf dem Desktop rund 340 px Leere zwischen Gfeller und Sorpreza) */
.video-head ~ .section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.video-head + .section { padding-top: clamp(3rem, 6vw, 5rem); }
.video-head .t-exif {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.video-head .t-lead { margin-top: 1.25rem; }

/* ---------- Raster: Handy 1 Spalte (max. 420 px, zentriert), Tablet 2, Desktop 3 ---------- */
.video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 3rem) var(--gap);
  align-items: start;
  max-width: 420px;
  margin-inline: auto;
}
@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
  /* Tablet: die dritte Karte einer Gruppe steht allein, darum mittig statt links */
  .video-grid > .video-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - var(--gap)) / 2);
  }
}
@media (min-width: 1100px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .video-grid > .video-card:last-child:nth-child(odd) {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
}

/* ---------- Eine Gruppe mit nur einem Video (Gfeller Rent): Text links, Video rechts ---------- */
.video-grid.video-grid-solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 380px;
  margin-inline: auto;
}
.video-grid-solo > .video-card:last-child:nth-child(odd) { grid-column: auto; width: auto; justify-self: stretch; }
@media (min-width: 900px) {
  .video-solo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: clamp(2.5rem, 7vw, 6rem);
    align-items: center;
  }
  .video-solo .section-head { margin-bottom: 0; }
  .video-solo .video-grid-solo { margin-inline: 0; }
}

/* Karte: Titel und Werkzeug-Zeile dürfen umbrechen, Werte bleiben ganz (&nbsp;) */
.video-card .t-h3 { text-wrap: balance; }
/* Der Trennpunkt hängt per &nbsp; am vorherigen Wert: keine Zeile beginnt mit «·».
   balance: zwei ähnlich lange Zeilen statt «Remotion» allein */
.video-card .t-exif { overflow-wrap: anywhere; text-wrap: balance; }

/* Sucher-Ecken wie bei den Fotos: nur bei Hover und Tastaturfokus, nicht während das Video läuft */
.video-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  opacity: 0;
  --c: #fff;
  --l: 22px;
  --w: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top right / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .7));
  transition: opacity var(--t-fast) ease;
}
.video-card:not(.is-playing):hover .video-frame::after,
.video-card:not(.is-playing):focus-within .video-frame::after { opacity: 1; }

/* ---------- Schluss: Legende der KI-Chips ---------- */
.section.video-end { padding-block: clamp(3.5rem, 8vw, 6rem); }
.video-outro { display: grid; gap: 1.25rem; justify-items: start; }
.ki-legend { display: grid; gap: .75rem; margin: 0; }
/* Chip links in fester Spalte, Erklärung rechts daneben (bricht nur innerhalb der eigenen Spalte um) */
.ki-legend > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: .9rem; }
.ki-legend dd { margin: 0; }

/* Der Knopf liegt über den Sucher-Ecken (Druckzustand :active steht in base.css) */
.video-play { z-index: 1; }
