/* ============================================================
   Photo Gallery — Grilla 3 columnas con hover y lightbox
   ============================================================ */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Celda de imagen */
.photo-gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #e8e0f4;
}

.photo-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-gallery__item:hover .photo-gallery__img {
  transform: scale(1.04);
}

/* Overlay hover */
.photo-gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.photo-gallery__item:hover .photo-gallery__overlay {
  opacity: 1;
}

/* Ícono de lupa */
.photo-gallery__overlay-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f58220;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.2s ease;
}

.photo-gallery__overlay-icon svg {
  width: 28px;
  height: 28px;
}

.photo-gallery__item:hover .photo-gallery__overlay-icon {
  transform: scale(1.1);
}

/* ── Modal / Lightbox ── */
.photo-gallery__modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.photo-gallery__modal.is-open {
  visibility: visible;
  opacity: 1;
}

.photo-gallery__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.photo-gallery__modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-gallery__modal-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.photo-gallery__modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f58220;
  color: #ffffff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease;
  z-index: 2;
}

.photo-gallery__modal-close:hover {
  background: #5b1fa6;
}

/* Responsive */
@media (max-width: 768px) {
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .photo-gallery {
    grid-template-columns: 1fr;
  }
}
