/* ===== GALERIE PREMIUM ===== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

/* ITEM */
.gallery-item {
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 12px 35px rgba(0,0,0,0.12);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* HOVER PREMIUM */
.gallery-item:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 60px rgba(0,180,216,0.25);
}

/* OVERLAY */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,0.45)
  );
  opacity: 0;
  transition: 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

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

/* ===== FLIP CARD ===== */
/* ===== FLIP CARD OPTIMISÉE ===== */
.flip-card {
  perspective: 1200px;
  height: 420px;
  overflow: visible !important;
  border-radius: 30px;
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2); /* fond amélioré */
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
  position: relative;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: flipAuto 6s infinite ease-in-out;
  border-radius: 30px;
}

/* Faces */
.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #e0f7fa 0%, #b2ebf2 100%); /* fond amélioré */
}

/* Images */
.flip-front img,
.flip-back img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain; /* aucune image ne sera coupée */
  border-radius: 25px; /* arrondi supplémentaire sur l’image */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* léger relief */
  display: block;
  transition: transform 0.5s ease;
}

/* Zoom léger au hover */
.gallery-item:hover img {
  transform: scale(1.05);
}

/* Back */
.flip-back {
  transform: rotateY(180deg);
}

/* Animation Flip */
@keyframes flipAuto {
  0%, 45% { transform: rotateY(0deg); }
  50%, 95% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

/* Pause au hover */
.flip-card:hover .flip-inner {
  animation-play-state: paused;
}

/* Overlay info (optionnel) */
.event-overlay-fixed {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  color: white;
  z-index: 10;
  padding: 15px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

/* Gallery item général */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
}

/* ===== OVERLAY EVENEMENT ===== */

.event-overlay-fixed {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  color: white;
  z-index: 10;
  padding: 15px;
  border-radius: 20px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
}

.event-overlay-fixed h3 {
  font-size: 15px;
  margin: 4px 0;
}

.event-overlay-fixed p {
  font-size: 12px;
  margin: 4px 0;
}

.event-date {
  font-size: 11px;
  opacity: 0.8;
}

.event-location {
  font-size: 12px;
  margin-top: 4px;
}

/* ===== FILTRES GALERIE ===== */

.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 35px;
}

.filter-btn {
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--blue);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* effet glossy */
.filter-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.6),
    transparent
  );
  transition: 0.5s;
}

.filter-btn:hover::before {
  left: 100%;
}

.filter-btn:hover {
  transform: translateY(-3px);
  background: white;
  box-shadow: 0 12px 28px rgba(0,180,216,0.25);
  color: var(--blue);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: white;
  box-shadow: 0 12px 30px rgba(0,180,216,0.35);
  transform: scale(1.05);
}

/* CACHER LES ITEMS FILTRÉS */
.gallery-item.hide {
  display: none !important;
}