/* Galerie (remplace Cubeportfolio) */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0f191e;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img,
.gallery-item:focus img {
  transform: scale(1.05);
}

.gallery-item::after {
  content: attr(data-caption);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after,
.gallery-item:focus::after {
  opacity: 1;
}

/* Visionneuse */
.lb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lb-overlay.open {
  display: flex;
}

.lb-overlay figure {
  margin: 0;
  text-align: center;
}

.lb-overlay img {
  display: block;
  max-width: 92vw;
  max-height: 84vh;
  margin: 0 auto;
}

.lb-overlay figcaption {
  color: #fff;
  margin-top: 10px;
  font-size: 15px;
}

.lb-overlay button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  padding: 10px 20px;
  cursor: pointer;
}

.lb-close { top: 10px; right: 10px; }
.lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 10px; top: 50%; transform: translateY(-50%); }
