/* ==================================================================
   Galerie : mosaique de photos et de videos + lightbox
   ================================================================== */

.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 190px;
  gap: var(--sp-3);
}

/* Sur l'accueil, les deux premieres vignettes sont agrandies. */
.gal-grid--mosaic > .gal-item:first-child { grid-column: span 2; grid-row: span 2; }
.gal-grid--mosaic > .gal-item:nth-child(6) { grid-column: span 2; }
@media (max-width: 700px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: var(--sp-2); }
  .gal-grid--mosaic > .gal-item:first-child { grid-column: span 2; grid-row: span 1; }
  .gal-grid--mosaic > .gal-item:nth-child(6) { grid-column: span 1; }
}

.gal-item {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.gal-item__btn {
  position: relative;
  display: block; width: 100%; height: 100%;
  padding: 0; border: none; cursor: zoom-in;
  text-align: left;
}
.gal-item--video .gal-item__btn { cursor: pointer; }
.gal-item__btn img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.gal-item__btn:hover img { transform: scale(1.06); }

/* Bouton de lecture des videos. */
.gal-item__play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  color: #fff;
  pointer-events: none;
}
.gal-item__play svg {
  width: 54px; height: 54px;
  padding: 14px;
  border-radius: 50%;
  background: rgba(20, 16, 29, 0.55);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.gal-item__btn:hover .gal-item__play svg { transform: scale(1.08); background: var(--accent); }

/* Legende revelee au survol. */
.gal-item__caption {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  display: grid; gap: 2px;
  padding: var(--sp-5) var(--sp-4) var(--sp-3);
  background: linear-gradient(transparent, rgba(20, 16, 29, 0.88));
  color: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.gal-item__btn:hover .gal-item__caption,
.gal-item__btn:focus-visible .gal-item__caption { opacity: 1; transform: none; }
.gal-item__caption strong {
  font-size: var(--fs-sm); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gal-item__caption span { font-size: var(--fs-xs); color: rgba(255, 255, 255, 0.7); }

@media (hover: none) {
  .gal-item__caption { opacity: 1; transform: none; }
}

/* --- Lightbox (partagee avec les galeries spectacle/projet) --- */
.lightbox__figure { margin: 0; display: grid; gap: var(--sp-3); justify-items: center; }
.lightbox__figure iframe,
.lightbox__figure video {
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--r-md);
  background: #000;
  box-shadow: var(--shadow-lg);
}
.lightbox__figure figcaption {
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-sm);
  text-align: center;
  max-width: 60ch;
}
