/* =========================================================
   Ajout pour la galerie : bouton englobant les photos + modal "lightbox"
   À coller à la fin de assets/css/style.css (ou à garder dans ce fichier
   séparé, en ajoutant un <link rel="stylesheet" href="/assets/css/lightbox-ajout.css">
   après celui de style.css dans templates/header.php).
   ========================================================= */

/* Le bouton qui remplace le <div> autour de chaque photo de la mosaïque */
.mosaic__link {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.mosaic__link:focus-visible {
  outline: 3px solid var(--color-clay, #a9835f);
  outline-offset: -3px;
}

/* ===================== Modal lightbox ===================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 14, 9, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }

.lightbox__figure {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox__img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox__caption {
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  opacity: 0.9;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.lightbox__close:hover { opacity: 0.8; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

@media (min-width: 700px) {
  .lightbox__nav--prev { left: 24px; }
  .lightbox__nav--next { right: 24px; }
}

@media (max-width: 480px) {
  .lightbox__nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .lightbox__close { font-size: 1.8rem; top: 8px; right: 10px; }
}

/* ===================== Vidéos de la galerie ===================== */

/* Lecteur vidéo dans la lightbox (même gabarit que l'image) */
.lightbox__video {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background: #000;
  display: block;
}
.lightbox__video[hidden],
.lightbox__img[hidden] { display: none; }

/* Pastille ▶ posée sur la couverture d'une vidéo (mosaïque et aperçu) */
.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(20, 14, 9, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.play-badge::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}