/* Gallery styles: modern, responsive grid + hover effect + subtle shadows */

.gallery {
  display: grid;
  /* miniatures plus compactes : permet plus d'items par ligne */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 2rem 0;
}

.gallery a,
.gallery img {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  box-shadow: 0 6px 20px rgba(5,36,73,0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 50px rgba(5,36,73,0.12);
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, filter 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
  filter: brightness(0.98) saturate(1.03);
}

/* caption overlay */
.gallery-item .caption-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.gallery-item:hover .caption-overlay {
  transform: translateY(0);
}

/* Lightbox overlay */
.gc-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7, 15, 30, 0.6);
  z-index: 2000;
}

.gc-lightbox.open {
  display: flex;
}

.gc-lightbox .lb-inner {
  max-width: min(1200px, 96%);
  width: 100%;
  margin: 0 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.gc-lightbox .lb-img {
  max-height: 80vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(5,36,73,0.6);
}

/* controls */
.gc-lightbox .lb-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gc-btn {
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(5,36,73,0.08);
}

.gc-btn:focus { outline: 3px solid rgba(47,114,255,0.18); outline-offset: 3px; }

.gc-caption {
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  margin-top: 0.5rem;
}

/* mobile adjustments */
@media (max-width: 680px) {
  .gallery-item img { height: 140px; }
  .gc-lightbox .lb-inner { grid-template-columns: 1fr; }
  .gc-lightbox .lb-controls { flex-direction: row; justify-content: center; }
}
