/* ===== Galerie horizontale (conserve ton design) ===== */
.coverflow-wrapper {
  position: relative;
  height: min(70vh, 700px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
}


/* Section titre */
.section-title {
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.section-title:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 3px;
  background: #d4a76a;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
}


/* Conteneur horizontal (fix Safari iOS) */
.coverflow-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  height: 100%;
  gap: 1rem;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  scroll-padding: 50%;
  -webkit-overflow-scrolling: touch;
  align-items: center;
  position: relative;
  -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
  scrollbar-width: none;  /* Hide scrollbar for Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.coverflow-container::-webkit-scrollbar {
  display: none;
}

/* Carte média */
.gallery-item {
  flex: 0 0 70%;
  flex-shrink: 0;               /* <- iOS ne rétrécit plus les cartes */
  max-width: 600px;
  height: 100%;
  scroll-snap-align: center;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f6f5f5;

  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s ease;
  margin-inline: auto;
  transform: scale(0.8);        /* plus petit par défaut */


}

/* Média (image/vidéo) */
.gallery-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  filter: grayscale(100%);
  transition: filter .4s ease, transform .3s ease;
}

/* Élément actif = couleur + léger zoom */
.gallery-item.active .gallery-media {
  filter: grayscale(0%);
  transform: scale(1.03);
  z-index: 2;
}

/* Navigation */
.navbar {
  z-index: 1000;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background-color: #fff;
}

.navbar-nav {
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1001;
}

.nav-item {
  margin: 0 10px;
  position: relative;
}

.nav-link {
  position: relative;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
  z-index: 1002;
  pointer-events: auto;
}

.nav-link:hover,
.nav-link.active {
  color: #000;
  font-weight: 500;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #000;
  transition: all 0.3s ease;
  transform: translateX(-50%);
  z-index: 1003;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}

/* Ensure navbar is above other content */
.navbar-collapse {
  z-index: 1001;
}

/* Fix for mobile menu */
.navbar-toggler {
  z-index: 1002;
}

/* Flèches optionnelles (si utilisées) */
.gallery-nav {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: .5rem;
  z-index: 3;
}
.btn-nav {
  width: 40px; height: 40px;
  border: 0; border-radius: 8px;
  background: rgba(0,0,0,.45);
  color: #fff; font-size: 16px;
  line-height: 40px; text-align: center;
  cursor: pointer;
}
.btn-nav:active { transform: scale(.98); }

/* Responsive */
@media (max-width: 768px) {
  .gallery-item { flex-basis: 85%; }
}
@media (max-width: 480px) {
  .gallery-item { flex-basis: 90%; }
}

/* ===== Forcer préfixes Safari iOS (fallback) ===== */
@supports (-webkit-touch-callout: none) {
  .coverflow-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .gallery-item {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
  }
}

/* ===== Transitions douces entre cover et contain ===== */
/* ===== Mode "three-up" : 3 cartes visibles côte à côte ===== */
:root {
  --gallery-gap: 1rem;       /* même valeur que ta .coverflow-container gap */
}

/* Active 3 colonnes en largeur */
.coverflow-container.three-up {
  padding-inline: 0;         /* pas d'encoche qui casserait le calcul */
  gap: var(--gallery-gap);
}

/* 3 colonnes : (100% - 2 gaps) / 3 */
.coverflow-container.three-up .gallery-item {
  flex: 0 0 calc((100% - 2 * var(--gallery-gap)) / 3);
  max-width: none;
  transform: none;           /* pas de scale(0.8) par défaut */
  scroll-snap-align: start;  /* on aligne sur le bord gauche pour 3 vignettes */
}

/* L’image s’adapte proprement en carte fixe */
.coverflow-container.three-up .gallery-media {
  object-fit: cover       /* rendu plus plein pour mosaïque */
}

/* États actifs (si tu veux conserver un léger focus au centre à la navigation) */
.coverflow-container.three-up .gallery-item.active .gallery-media {
  transform: none;           /* pas de zoom qui décale la grille */
}

/* Responsif : 2 cartes sur tablette, 1 carte sur mobile étroit */
@media (max-width: 900px) {
  .coverflow-container.three-up .gallery-item {
    flex-basis: calc((100% - var(--gallery-gap)) / 2);
  }
}
@media (max-width: 520px) {
  .coverflow-container.three-up .gallery-item {
    flex-basis: 100%;
    scroll-snap-align: center;
  }
}