/* ==========================================================================
   PideFácil — Testimonio en vídeo (vistas/compartido/video-testimonio.njk)
   Botón de play sobre la foto y ventana donde se abre el vídeo de YouTube.
   Lo usan la Home y la cabecera de cada caso de éxito; el marco, el giro y
   las esquinas de la foto los pone la hoja de cada página.
   ========================================================================== */

.video-enlace {
  position: relative;
  display: block;
}

/* Velo suave para que el botón destaque sobre cualquier foto. Toma las
   esquinas del enlace, que cada página iguala a las de su foto. */
.video-enlace::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(20, 30, 10, 0.32) 0%, rgba(20, 30, 10, 0.08) 60%, rgba(20, 30, 10, 0) 100%);
  transition: background-color 0.2s ease;
  pointer-events: none;
}

.video-play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(64px, 6.6vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--h-btn);
  color: var(--h-btn-ink);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3), 0 16px 36px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.video-play svg {
  width: 42%;
  height: auto;
  fill: currentColor;
}

/* Onda que sale del botón para invitar a darle. */
.video-play::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(176, 200, 120, 0.7);
  animation: video-play-onda 2.4s ease-out infinite;
}

@keyframes video-play-onda {
  from { box-shadow: 0 0 0 0 rgba(176, 200, 120, 0.7); }
  to   { box-shadow: 0 0 0 22px rgba(176, 200, 120, 0); }
}

@media (hover: hover) {
  .video-enlace:hover .video-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: #bcd487;
  }
  .video-enlace:hover::after { background-color: rgba(20, 30, 10, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .video-play::before { animation: none; }
}

/* Ventana del vídeo: horizontal a 16:9 y los Shorts en vertical, siempre
   dentro de la pantalla y con hueco arriba para el botón de cerrar. */
.video-modal {
  width: min(92vw, 1100px, calc(78vh * 16 / 9));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.video-modal.is-vertical { width: min(92vw, calc(78vh * 9 / 16)); }

.video-modal::backdrop {
  background: rgba(12, 22, 6, 0.84);
  backdrop-filter: blur(3px);
}

html:has(.video-modal[open]) { overflow: hidden; }

.video-modal-marco {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.video-modal.is-vertical .video-modal-marco { aspect-ratio: 9 / 16; }

.video-modal-marco iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-cerrar {
  position: absolute;
  top: -56px;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(252, 251, 246, 0.95);
  color: var(--h-ink);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.video-modal-cerrar:hover { transform: scale(1.06); }

.video-modal-cerrar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
