/* ================================================================
   GALERÍA — Galería de fotos y Lightbox
   ================================================================ */

#galeria { background: var(--off-white); }

.galeria-subtitulo { text-align: center; color: var(--text-muted); margin-top: -2rem; margin-bottom: 3rem; }

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--primary);
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 69, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-overlay span {
  color: var(--white);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--accent);
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-pill);
}

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


/* ----------------------------------------------------------------
   Lightbox
   ---------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  cursor: default;
  animation: lbIn 0.3s ease;
}

@keyframes lbIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.lightbox-close:hover { background: var(--accent); border-color: var(--accent); color: var(--primary); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover { background: var(--accent); border-color: var(--accent); color: var(--primary); }
