/* ════════════════════════════════════════════════════════
   Videogalerie [ap_videos]
   Nur auf Seiten mit dem Shortcode geladen (includes/videos.php).
   Farben, Abstände und Radien aus den Variablen des Themes divi-ahlers.
   ════════════════════════════════════════════════════════ */

.ap-videos { background: var(--color-black); }

/* hidden muss auch gegen .ap-btn-primary { display:inline-flex } gewinnen */
.ap-videos [hidden] { display: none !important; }

.ap-videos__liste {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
}

/* ── Ein Video ── */
.ap-video { scroll-margin-top: calc(var(--header-height) - 40px); }

.ap-video__kopf { margin-bottom: 1.5rem; }

.ap-video__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 0.75rem;
}

.ap-video__titel {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin: 0;
}

.ap-video__text {
  margin-top: 1.25rem;
  max-width: 720px;
  color: var(--color-gray);
  font-size: 1rem;
  line-height: 1.85;
}
.ap-video__text p { margin: 0 0 1rem; }
.ap-video__text p:last-child { margin-bottom: 0; }

/* ── 16:9-Box für Player, Vorschaubild und Platzhalter ── */
.ap-video__box {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-dark);
  box-shadow: var(--shadow-card);
}

.ap-video__box video,
.ap-video__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.ap-video__box video { object-fit: contain; }

.ap-video__cover { position: absolute; inset: 0; }

.ap-video__poster,
.ap-video__poster picture,
.ap-video__poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ap-video__poster img { object-fit: cover; display: block; }

/* Ohne Vorschaubild: dunkler Platzhalter mit Titel */
.ap-video__platzhalter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12% 2rem 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 120%, var(--color-red-glow), transparent 60%),
    linear-gradient(180deg, var(--color-dark-2), var(--color-dark));
}
.ap-video__platzhalter span {
  max-width: 34ch;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-light-gray);
  opacity: 0.55;
}

/* Abdunkelung mit Button in der Mitte */
.ap-video__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.ap-video__start,
.ap-video__extern {
  white-space: normal;
  text-align: center;
  justify-content: center;
  max-width: 100%;
}
.ap-video__icon { flex-shrink: 0; }

/* ── Leiste unter der Box: Datenschutzhinweis und „beenden" ── */
.ap-video__leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 0.85rem;
}
.ap-video__leiste:empty { display: none; }

.ap-video__hinweis {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--color-gray);
}
.ap-video__hinweis a { color: var(--color-light-gray); text-decoration: underline; text-underline-offset: 2px; }
.ap-video__hinweis a:hover { color: var(--color-white); }

.ap-video__beenden {
  margin-left: auto;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-light-gray);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.ap-video__beenden:hover { border-color: var(--color-border-red); color: var(--color-white); }

/* Sichtbarer Fokus (auch für das iframe nach dem Laden) */
.ap-video__start:focus-visible,
.ap-video__extern:focus-visible,
.ap-video__beenden:focus-visible,
.ap-video__box video:focus-visible,
.ap-video__frame:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
}
.ap-video__frame:focus { outline: 2px solid var(--color-red); outline-offset: -2px; }

/* Nur für Screenreader */
.ap-video__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Leere Liste ── */
.ap-videos__leer {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-gray);
  line-height: 1.85;
}
.ap-videos__leer p { margin: 0 0 1.75rem; }

/* ── Mobil: kompakter Button in der kleinen Box ── */
@media (max-width: 600px) {
  .ap-videos__liste { gap: var(--space-lg); }
  .ap-video__box { border-radius: var(--radius-md); }
  .ap-video__start,
  .ap-video__extern { padding: 0.75rem 1.1rem; font-size: 0.85rem; }
  .ap-video__platzhalter { padding-top: 8%; }
  .ap-video__beenden { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-video__beenden { transition: none; }
}
