/* ============================================
   Galerie Masonry — version finale
   4 cols (grand) / 3 cols (laptop) / 2 (tablet) / 1 (mobile)
   ============================================ */

/* Container : annule l'ancienne grille et centre */
.gallery {
  display: block !important;
  grid-template-columns: none !important;
  grid-auto-flow: unset !important;
  gap: 0 !important;
  position: relative !important;
  min-height: 200px;
  
  /* Forcer la largeur pleine */
  width: 100% !important;
  max-width: 1800px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .gallery {
    padding: 0 16px !important;
  }
}

/* Items : 4 colonnes par défaut (grand écran) */
.gallery .gallery-item {
  width: 25% !important;
  padding: 12px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background: transparent !important;
  position: absolute;
  cursor: default;
  aspect-ratio: auto !important;
  height: auto !important;
  float: none !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Laptop : 3 colonnes */
@media (max-width: 1280px) {
  .gallery .gallery-item {
    width: calc(100% / 4) !important;
  }
}

/* Tablette : 2 colonnes */
@media (max-width: 768px) {
  .gallery .gallery-item {
    width: 50% !important;
  }
}

/* Mobile : 1 colonne */
@media (max-width: 480px) {
  .gallery .gallery-item {
    width: 100% !important;
  }
}

/* Image */
.gallery .gallery-item img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  max-width: 100% !important;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  transition: filter 0.3s ease;
  transform: none !important;
}

.gallery .gallery-item:hover img {
  filter: brightness(1.1) saturate(1.05);
}

/* Désactive les pseudo parasites des anciens photo-card */
.gallery .gallery-item::after,
.gallery .gallery-item::before {
  display: none !important;
  content: none !important;
}

/* Badge featured (petit, coin haut-droit, à l'intérieur du padding) */
.gallery .gallery-item .featured-badge {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  background: #ff3c1f !important;
  color: #fff !important;
  font-size: 10px !important;
  padding: 4px 8px !important;
  z-index: 5 !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase;
  line-height: 1 !important;
  border-radius: 2px;
  white-space: nowrap !important;
  width: auto !important;
  height: auto !important;
  writing-mode: horizontal-tb !important;
  display: inline-block !important;
  transform: none !important;
}

/* Overlay au hover (positionné À L'INTÉRIEUR du padding) */
.gallery .gallery-item .item-overlay {
  position: absolute !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  top: auto !important;
  padding: 1rem !important;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent) !important;
  color: #f5f1ea !important;
  opacity: 0;
  transition: opacity 0.3s !important;
  pointer-events: none !important;
  z-index: 3 !important;
  transform: none !important;
}

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

.item-overlay .item-title {
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin: 0 !important;
}

.item-overlay .item-meta {
  font-size: 0.7rem;
  opacity: 0.7;
  margin: 3px 0 0 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Cache lightbox et photo-info inutilisés */
#lightbox,
.photo-info {
  display: none !important;
}
