/* galeria.css - Estilos para la sección de galería */

.gallery-section {
  padding: 120px 40px;
  background: #f8f9fa;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-title p {
  color: var(--gray);
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 250px; /* Altura base para imágenes cuadradas */
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Variaciones para efecto masonry (algunas más altas o anchas) */
.gallery-item {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.04);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Clases para variar tamaños (masonry feel) */
.gallery-item.tall {
  grid-row: span 2; /* Doble altura */
}

.gallery-item.wide {
  grid-column: span 2; /* Doble ancho */
}

/* Lightbox (modal) */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

#caption {
  color: white;
  margin-top: 15px;
  font-size: 1.2rem;
  text-align: center;
  max-width: 80%;
}

.close-lightbox {
  position: absolute;
  top: 30px;
  right: 40px;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  transition: color 0.3s;
}

.close-lightbox:hover {
  color: var(--secondary);
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 80px 20px;
  }
  
  .section-title h2 {
    font-size: 2.4rem;
  }
  
  .gallery-item.tall,
  .gallery-item.wide {
    grid-row: span 1;
    grid-column: span 1;
  }
  
  .close-lightbox {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
  }
}

.video-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 12px;
}

.video-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
}

.video-item:hover .play-overlay {
  opacity: 1;
}

.video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}