/* ==========================================================================
   J.A. CHAPES SÀRL — Galerie
   --------------------------------------------------------------------------
   Aperçu replié, grille façon maçonnerie et visionneuse plein écran.
   ========================================================================== */

/* ==========================================================================
   11. GALERIE
   ========================================================================== */
.gallery__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin-top: 34px;
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 640px;
}
.gallery__thumbs img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* Grille façon maçonnerie */
.masonry {
  columns: 4;
  column-gap: 16px;
  margin-top: 34px;
}
.masonry__item {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: none;
  break-inside: avoid;
}
.masonry__item img,
.masonry__item video {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s ease;
}
.masonry__item:hover img { transform: scale(1.08); }
.masonry__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}
.masonry__item:hover::after { background: rgba(0, 0, 0, 0.3); }

.gallery__toggle-wrap { display: flex; justify-content: center; margin-top: 34px; }

/* Visionneuse plein écran */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.96);
}
.lightbox.is-open { display: flex; }
.lightbox img,
.lightbox video {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.8);
}

.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 18px; top: 50%; transform: translateY(-50%); }
