/* =============================================================================
   GALLERY.CSS – 🖼️ Galeries Voyages & Plats
   Harmonisé le 2025-07-04
   -----------------------------------------------------------------------------
   ✔ Réutilisation des variables globales (couleurs texte, radius)
   ✔ Doublons supprimés (sélecteurs fusionnés)
   ✔ Commentaires & indentation homogènes
   ✔ Aucune classe renommée (HTML intact)
   ---------------------------------------------------------------------------*/

/* ---------------------------------------------------------------------------
   1 · CONTENEURS GALERIE (travel + food)
   ------------------------------------------------------------------------ */
.travel-gallery,
.food-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------------
   2 · FIGURE & IMAGES
   ------------------------------------------------------------------------ */
.gallery-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius, 8px);
  margin: 1rem;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

.gallery-figure img,
.travel-gallery img,
.food-gallery img,
.gallery-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background-color: #f0f0f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  cursor: zoom-in;
  outline: none;
  box-shadow: 0 4px 12px rgb(0 0 0 / .2);
}

/* Bloc image utilisé hors figure */
.gallery-img { height: auto; }

/* ---------------------------------------------------------------------------
   3 · FOCUS & HOVER ACCESSIBLE
   ------------------------------------------------------------------------ */
.gallery-figure img:focus-visible {
  outline: 2px solid var(--accent, #00aaff);
  outline-offset: 4px;
}

.gallery-figure img:hover,
.travel-gallery img:hover,
.food-gallery img:hover,
.gallery-img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgb(0 0 0 / .3);
}

/* ---------------------------------------------------------------------------
   4 · LÉGENDES / CAPTIONS
   ------------------------------------------------------------------------ */
.gallery-caption,
.gallery-figure figcaption {
  margin-top: .5rem;
  font-size: .9rem;
  text-align: center;
  color: var(--text-light);
  line-height: 1.4;
  opacity: 0;
  transition: opacity .3s ease;
}
.gallery-figure:hover figcaption { opacity: 1; }
html.light .gallery-caption,
html.light .gallery-figure figcaption { color: #555; }

/* ---------------------------------------------------------------------------
   5 · INTRO DE SECTION
   ------------------------------------------------------------------------ */
.gallery-intro {
  font-style: italic;
  opacity: .9;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  text-align: center;
  color: #ccc;
}
html.light .gallery-intro { color: #444; }

/* ---------------------------------------------------------------------------
   6 · LIGHTBOX (STRUCTURE JS REQUISE)
   ------------------------------------------------------------------------ */
.gallery-lightbox-enabled img { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0 0 0 / .8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 0 20px rgb(255 255 255 / .2);
  animation: zoomIn .3s ease;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10000;
  transition: color .2s ease;
}
.lightbox-close:hover { color: var(--accent, #00aaff); }

@keyframes zoomIn {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------------------------------------------------------------------------
   7 · DARK MODE – CONTRASTE IMAGES
   ------------------------------------------------------------------------ */
html.dark .travel-gallery img,
html.dark .food-gallery img {
  background-color: #222;
}

/* ---------------------------------------------------------------------------
   8 · RESPONSIVE
   ------------------------------------------------------------------------ */
@media (max-width: 640px) {
  .travel-gallery,
  .food-gallery { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .gallery-intro { font-size: .95rem; margin-bottom: 1rem; }
  .gallery-caption,
  .gallery-figure figcaption { font-size: .85rem; }
  /* Cache un éventuel swiper mobile */
  .swiper { display: none; }
}