/* ================================================================
   YouTube Facade — click-to-load thumbnails
   Reemplaza iframes de YouTube con una imagen + botón play
   para evitar cargar ~30 requests del player de YouTube al inicio.
   ================================================================ */

.yt-facade {
  position: relative;
  cursor: pointer;
  margin: 0 auto;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.yt-facade__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
}

.yt-facade__thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.yt-facade:hover .yt-facade__thumb {
  opacity: 0.85;
}

/* Botón de play centrado */
.yt-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.yt-facade:hover .yt-facade__play {
  transform: translate(-50%, -50%) scale(1.1);
}

.yt-facade__play svg {
  display: block;
}

.yt-facade__play-bg {
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.yt-facade:hover .yt-facade__play-bg {
  opacity: 1;
}

/* Focus visible para accesibilidad */
.yt-facade:focus-visible {
  outline: 3px solid var(--color-primary, #c7013d);
  outline-offset: 2px;
}

/* Estado activo (iframe cargado) — quitar cursor y estilos hover */
.yt-facade--active {
  cursor: default;
}

.yt-facade--active .yt-facade__play {
  display: none;
}
