/* ==========================================================================
   dato luminoso - visor de shorts a pantalla completa (visor-shorts.css)
   Versión limpia: el video de YouTube con sus propios controles, sin capas
   encima. Nuestros botones (cerrar, subir y bajar) quedan fuera del video.
   ========================================================================== */

.visor-shorts {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: #000;
  color: #fff;
  font-family: var(--fuente-principal);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.visor-shorts.activo {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s ease;
}

/* Pista vertical: un short por pantalla */
.visor-pista {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.visor-pista::-webkit-scrollbar {
  display: none;
}

.visor-short {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* El video completo en 9:16, centrado; sin recortes para no tapar los controles de YouTube */
.visor-marco {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, calc(100dvh * 9 / 16));
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background-color: #000;
}

.visor-portada,
.visor-reproductor,
.visor-reproductor iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.visor-portada {
  object-fit: cover;
}

/* Botón cerrar: en la franja superior, fuera del video */
.visor-cerrar {
  position: absolute;
  z-index: 6;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.visor-cerrar svg,
.visor-flechas svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Subir y bajar: en el celular, en la franja inferior y fuera del video */
.visor-flechas {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
}

.visor-flechas button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: var(--transicion-suave);
}

.visor-flechas button:hover:not(:disabled),
.visor-cerrar:hover {
  background: var(--degradado-principal);
}

.visor-flechas button:disabled {
  opacity: 0.3;
  cursor: default;
}

.visor-cerrar:focus-visible,
.visor-flechas button:focus-visible {
  outline: 3px solid var(--color-principal-solido);
  outline-offset: 3px;
}

/* Pista inicial: "desliza para ver más" */
.visor-pista-gesto {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.visor-pista-gesto svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: gesto-subir 1.2s ease-in-out infinite;
}

.visor-shorts.mostrar-gesto .visor-pista-gesto {
  opacity: 1;
}

@keyframes gesto-subir {
  0%, 100% { transform: translateY(8px); opacity: 0.4; }
  50% { transform: translateY(-8px); opacity: 1; }
}

/* Computadora: video con margen arriba y abajo; flechas a la derecha */
@media (min-width: 768px) {
  .visor-marco {
    width: auto;
    height: calc(100% - 5vh);
    border-radius: 14px;
  }

  .visor-flechas {
    left: auto;
    right: 32px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    flex-direction: column;
  }

  .visor-flechas button {
    width: 48px;
    height: 48px;
  }

  .visor-pista-gesto {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .visor-shorts, .visor-pista-gesto { transition: none; }
  .visor-pista-gesto svg { animation: none; }
}
