/* Page Galerie photos */
.gallery-page {
  width: 100%;
  margin: 0;
  padding: 0 0 5em;
}

.gallery-title {
  text-align: center;
  padding: 4em 20px 2em;
  background: #f8f5f0;
}

.gallery-title h1 {
  margin: 0;
  font-size: 2.4rem;
  color: #111;
  line-height: 1.2;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #fff;
}

.photo-grid img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 1s ease, transform 1.2s ease;
}

.photo-grid img.visible {
  opacity: 1;
  transform: scale(1);
}

.photo-grid img:hover { opacity: 0.92; }

.lightbox {
  display: flex;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease-in-out, visibility 0.45s ease-in-out;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90%;
  max-height: 82%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.45s ease-in-out, transform 0.45s ease-in-out;
}

.lightbox.open img {
  opacity: 1;
  transform: scale(1);
}

.close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
}

.prev-light,
.next-light {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.8rem;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  z-index: 2;
}

.prev-light { left: 16px; }
.next-light { right: 16px; }

@media (max-width: 1200px) {
  .photo-grid img { height: 340px; }
}

@media (max-width: 900px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid img { height: 300px; }
}

@media (max-width: 768px) {
  .gallery-page { padding-bottom: 3em; }

  .gallery-title { padding: 2.8em 20px 1.5em; }

  .gallery-title h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .photo-grid img { height: 280px; }

  .lightbox img {
    max-width: 94%;
    max-height: 74%;
  }

  .prev-light,
  .next-light { font-size: 2.1rem; }
}
