/* ==========================================================================
   gallery.css — Grille galerie + Lightbox
   Source : new-template/evangile-selon-pilate.html

   NOTE : la lightbox reste toujours en fond sombre (modal).
   Les bordures et hover suivent le thème.
   ========================================================================== */

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

.gallery-thumb {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.3s;
}

.gallery-thumb:hover {
  border-color: hsla(var(--ph), var(--ps), var(--pl), 0.4);
}

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

.gallery-thumb:hover img {
  transform: scale(1.05);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox .lb-btn {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s;
}

.lightbox .lb-btn:hover {
  color: #fff;
}

.lightbox .lb-close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
}

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

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

.lightbox .lb-counter {
  position: absolute;
  bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  font-family: var(--font-body);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}
