/* ==========================================================================
   GALLERY.CSS
   Page dédiée "Galerie" : bannière de page, filtres, grille de photos
   (issues des annonces réelles), et lightbox plein écran pour voir chaque
   photo en grand format avec navigation précédent/suivant.
   ========================================================================== */

/* ---------- Bannière de page (plus courte qu'un hero classique) ---------- */
.page-banner {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  overflow: hidden;
  isolation: isolate;
}

.page-banner__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.page-banner__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-banner__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(27, 30, 35, 0.8) 0%, rgba(46, 50, 59, 0.65) 100%);
}

.page-banner__content {
  color: var(--color-white);
  text-align: center;
  width: 100%;
}

.page-banner__eyebrow {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: var(--space-xs);
}

.page-banner__title {
  color: var(--color-white);
  font-size: clamp(2rem, 4vw, var(--fs-4xl));
}

.page-banner__text {
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin-inline: auto;
  margin-top: var(--space-sm);
}

/* ---------- Filtres ---------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: var(--space-xl);
}

.gallery-filter {
  padding: 0.55rem 1.3rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-navy);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.gallery-filter:hover {
  border-color: var(--color-gold);
}

.gallery-filter.is-active {
  background-color: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
}

/* ---------- Grille de médias (style masonry léger via grid-row-span) ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: var(--space-sm);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-navy);
}

.gallery-item--wide {
  grid-column: span 2;
}

.gallery-item--tall {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, rgba(27, 30, 35, 0) 40%, rgba(27, 30, 35, 0.85) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__caption {
  position: absolute;
  left: var(--space-sm);
  bottom: var(--space-sm);
  right: var(--space-sm);
  color: var(--color-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transform: translateY(8px);
  opacity: 0;
  transition: all var(--transition-fast);
}

.gallery-item:hover .gallery-item__caption {
  transform: translateY(0);
  opacity: 1;
}

/* Icône "loupe" (photo) ou "play" (vidéo) au centre au survol */
.gallery-item__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.85);
  transition: transform var(--transition-fast);
}

.gallery-item:hover .gallery-item__icon {
  transform: scale(1);
}

.gallery-item__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--color-white);
  stroke-width: 1.8;
}

/* Badge "vidéo" toujours visible en haut à droite */
.gallery-item__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background-color: rgba(27, 30, 35, 0.75);
  color: var(--color-white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.gallery-item__badge svg {
  width: 12px;
  height: 12px;
  fill: var(--color-gold-light);
}

/* ---------- Etat vide (aucun résultat pour un filtre) ---------- */
.gallery-empty {
  display: none;
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--color-text-muted);
}

.gallery-empty.is-visible {
  display: block;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(6, 10, 20, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

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

.lightbox__inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  max-height: 88vh;
}

.lightbox__media-wrap {
  width: 100%;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__media-wrap img,
.lightbox__media-wrap video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox__caption {
  text-align: center;
  color: var(--color-white);
  font-size: var(--fs-sm);
  margin-top: var(--space-sm);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  transition: background-color var(--transition-fast);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background-color: var(--color-gold);
  color: var(--color-navy);
}

.lightbox__close svg,
.lightbox__prev svg,
.lightbox__next svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.lightbox__close {
  top: -60px;
  right: 0;
}

.lightbox__prev {
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }

  .gallery-item--wide {
    grid-column: span 2;
  }

  .lightbox__prev { left: 4px; }
  .lightbox__next { right: 4px; }
  .lightbox__close { top: 4px; right: 4px; }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .gallery-item--wide,
  .gallery-item--tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}
