/* --- Galería / collage de fotos --- */
.gallery-section {
  background-color: var(--secondary);
  padding-bottom: 4rem;
}

.gallery-collage {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: 0.5rem;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.gallery-item {
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item--small {
  /* 1 col x 1 row por defecto */
}

@media (max-width: 768px) {
  .gallery-collage {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
    gap: 0.35rem;
  }

  .gallery-item--large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* --- Lightbox: ver foto completa y pasar una a una --- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gallery-lightbox-prev {
  left: 1rem;
}

.gallery-lightbox-next {
  right: 1rem;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-lightbox-image-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-image-wrap img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .gallery-lightbox {
    padding: 1rem;
  }

  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    width: 2.5rem;
    height: 2.5rem;
  }

  .gallery-lightbox-prev {
    left: 0.5rem;
  }

  .gallery-lightbox-next {
    right: 0.5rem;
  }
}
