/* =========================================================
   🖼️ LIGHTBOX SFM (versión optimizada y responsive)
   =========================================================
   Mantiene coherencia visual glass, transiciones suaves
   y adaptabilidad total en pantallas móviles.
========================================================= */

/* Contenedor general del Lightbox */
#lightbox {
  display: none;                        /* Oculto hasta activarse */
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);      /* Fondo oscuro con transparencia */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* Estado visible */
#lightbox.show {
  display: flex;
  opacity: 1;
}

/* Imagen ampliada dentro del Lightbox */
#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  object-fit: contain; /* 🔹 evita recortes horizontales */
}

/* Efecto de hover (solo escritorio) */
@media (hover: hover) {
  #lightbox img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.7);
  }
}
/* Miniatura */
.video-thumb-container {
  position: relative;
  max-width: 900px;
  margin: auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-thumb {
  width: 100%;
  display: block;
  filter: brightness(0.65); /* más oscuro para mejor contraste */
}

/* Botón Play perfectamente centrado */
.btn-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  /* Tamaño y forma */
  width: 100px;
  height: 100px;
  border-radius: 50%;
  
  /* Icono */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 55px;     /* tamaño del triángulo */
  line-height: 0;      /* evita desajustes verticales */
  
  /* Estilo */
  color: white;
  background: rgba(0,0,0,0.45);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-video-play:hover {
  background: rgba(0,0,0,0.75);
  transform: translate(-50%, -50%) scale(1.05);
}

/* Lightbox */
.video-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.video-lightbox.hidden {
  display: none;
}

.video-lightbox-inner {
  max-width: 900px;          /* 🔹 Igual que la imagen */
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

/* VIDEO IGUAL A LA FOTO */
#lightboxVideo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.close-video {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  font-size: 40px;
  color: white;
  cursor: pointer;
}
/* GRID PARA VIDEOS EN PARALELO */
.videos-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap; /* Para responsive */
    margin-top: 1rem;
}

/* Cada video ocupa la mitad del ancho */
.videos-grid .video-thumb-container {
    flex: 1 1 45%;
    max-width: 45%;
}

/* Para pantallas pequeñas → se apilan verticalmente */
@media (max-width: 768px) {
    .videos-grid .video-thumb-container {
        flex: 1 1 100%;
        max-width: 100%;
    }
}


/* =========================================================
   📱 SECCIÓN RESPONSIVE
   =========================================================
   Garantiza que las imágenes se adapten a pantallas pequeñas
   y que el usuario pueda desplazarse correctamente.
========================================================= */

/* Tablets y móviles horizontales (≤992px) */
@media (max-width: 992px) {
  #lightbox {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
  }

  #lightbox img {
    max-width: 94%;
    max-height: 88vh;
    border-radius: 8px;
  }
}

/* Móviles verticales (≤768px) */
@media (max-width: 768px) {
  #lightbox img {
    max-width: 95%;
    max-height: 80vh;
    border-radius: 8px;
  }
}

/* Móviles pequeños (≤576px) */
@media (max-width: 576px) {
  #lightbox {
    padding: 0 3vw;
  }

  #lightbox img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 6px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6);
  }
}

/* Pantallas muy pequeñas (≤400px) */
@media (max-width: 400px) {
  #lightbox img {
    max-height: 75vh;
    border-radius: 5px;
  }
}
