
body {
  background: #23273a;
  
}

/*.gallery-main {
  min-height: 92vh;
  background: #23273a;
  padding: 40px 0 50px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 18px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto 44px auto;
}*/

/*.gallery-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  justify-content: center;
  padding: 40px 20px 50px 20px;
  max-width: 1400px;
  margin: 0 auto;
}*/

.gallery-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  justify-content: center; /* centre la grille dans son conteneur */
  align-items: start;
  padding: 40px 20px 50px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-filter-container {
  margin: 0 auto 28px auto;
  text-align: center;
  
}


.filter-btn {
  background: #181a29;
  color: #ffa500;
  border: none;
  border-radius: 10px;
  font-size: 1.09em;
  padding: 8px 18px;
  margin: 0 7px 9px 7px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s, color .14s;
}





.filter-btn.active, .filter-btn:hover {
  background: #ffa500;
  color: #fff;
   box-shadow: 0 1px 7px #ffa50077;
}

/*.gallery-img-wrap {
  background: none;
  border-radius: 18px;
  box-shadow: 0 2px 11px #ffb40013;
  margin-bottom: 8px;
  padding: 0;
  max-width: 340px;
  width: 100%;
  transition: transform .13s;
}*/

.gallery-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #1a1d2e;
  border-radius: 16px;
}



.gallery-img-wrap:hover {
   transform: scale(1.04);
  
}

.gallery-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px; /* un peu plus grand qu'avant */
  object-fit: contain; /* affiche toute l’image sans rognage */
  border-radius: 14px;
  background: #1e1e2e;
  box-shadow: 0 3px 15px #ffedab39;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-img-wrap:hover .gallery-img {
  transform: scale(1.05);
  box-shadow: 0 4px 18px #ffb40044;
}



.gallery-img-legend {
  text-align: center;
  margin: 6px 0 0 0;
  color: #fffbe6;
  font-size: 1.09em;
  letter-spacing: .01em;
}

.gallery-empty {
  color: #fffbe6;
  text-align: center;
  padding: 90px 0 40px 0;
  font-size: 1.17em;
  width: 100vw;
}

/*---------------------- MODALE (ZOOM) -------------------*/

.gallery-modal {
  position: fixed;
  z-index: 99999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(25,24,30,0.93);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadein .35s;
}
.gallery-modal.show { display: flex; }


@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.gallery-modal-content {
  position: relative;
  background: none;
  border-radius: 17px;
  box-shadow: 0 6px 28px #0004;
  padding: 18px 12px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gallery-modal-close {
  position: absolute;
  right: 16px; top: 10px;
  font-size: 2.3em;
  color: #ffa500;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: color .15s;
}
.gallery-modal-close:hover {
   color: #ff2200;
}


.gallery-modal-img {
  max-width: 88vw;
  max-height: 75vh; /* 65vh; */
  border-radius: 15px;
  box-shadow: 0 3px 24px #0002;
  background: #fff;
  margin-bottom: 18px;
  transition: box-shadow .19s, opacity .33s cubic-bezier(.56,.11,.45,.92);
  opacity: 1;
}

.fade-in {
  animation: fadeinimg .32s;
  opacity: 1 !important;
}
.fade-out {
  opacity: 0.1 !important;
}
@keyframes fadeinimg { from { opacity: 0; } to { opacity: 1; } }
.gallery-modal-caption {
  color: #fffbe6;
  font-size: 1.13em;
  margin-bottom: 4px;
  text-align: center;
  line-height: 1.5;
  max-width: 65vw;
  word-break: break-word;
}
.gallery-modal-counter {
  color: #ffa500;
  font-size: 1em;
  margin-bottom: 13px;
  text-align: center;
  font-weight: 500;
}
.gallery-modal-prev, .gallery-modal-next {
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  font-size: 2.2em;
  color: #ffa500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 50%;
  z-index: 3;
  transition: background .16s, color .15s;
}
.gallery-modal-prev:hover, .gallery-modal-next:hover { background: #ffa50022; color: #fff;}
.gallery-modal-prev { left: 14px; }
.gallery-modal-next { right: 14px; }

.gallery-modal-thumbs {
  margin-top: 7px;
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 9px;
  max-width: 90vw;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #ffa500 #fffb;
}
.gallery-modal-thumb {
  width: 56px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  border: 2px solid #fffbe6;
  background: #fff;
  cursor: pointer;
  transition: border .14s, transform .13s, opacity .15s;
  opacity: 0.72;
}
.gallery-modal-thumb.active {
  border: 2px solid #ffa500;
  opacity: 1;
  transform: scale(1.08);
}


@media (max-width: 900px) {
  .gallery-main { gap: 15px 7px; }
  .gallery-img-wrap, .gallery-img { max-width: 98vw; }
  .gallery-modal-img { max-width: 97vw; max-height: 55vh;}
  .gallery-modal-thumbs { max-width: 96vw; }
}
@media (max-width: 600px) {
  .gallery-main { gap: 10px 3px;}
  .gallery-modal-img { max-width: 98vw; max-height: 41vh;}
  .gallery-modal-thumb { width: 39px; height: 29px; }
  .gallery-img-wrap, .gallery-img { border-radius: 11px;}
}
