.gallery-client {
  max-width: 1080px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
}

.gallery-item-client {
  margin: 10px;
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
  box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
  display: inline-block;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  height: 166.5px;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center; /* Centre verticalement */
  justify-content: center; /* Centre horizontalement */
}

.overlay-text {
  color: #ffffff;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 15px;
}

.no-visit .overlay {
  display: block;
}

.gallery-item-client img {
  width: 250px;
  height: 166.5px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-mosaic {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px;
}

.gallery-item {
  width: 100%;
  padding: 7px; /* Ajouter une marge interne */
  box-sizing: border-box; /* S'assurer que le padding est inclus dans la largeur */
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.5s ease-in-out 0.3s, opacity 0.5s ease-in-out 0.3s;
  z-index: 1;
  margin: 0 auto; /* Centrer les images horizontalement */
}

.gallery-item div {
  margin-top: 0px; /* Ajuste l'espace entre l'image et le texte */
  text-align: center; /* Centre le texte sous l'image */
  opacity: 1; /* S'assure que le texte est bien visible */
  z-index: 2;
}

.gallery-item img.visible {
  transform: scale(1);
  opacity: 1;
}

.gallery-item img.visible:hover {
  animation: boxShadowInAnimation 0.1s ease-in-out forwards;
}

.gallery-item img.visible:not(:hover) {
  animation: boxShadowOutAnimation 0.5s ease-in-out forwards;
}

.zoomed {
  cursor: grab;
  transform: scale(2);
}

@keyframes boxShadowInAnimation {
  from {
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
  }
  to {
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
  }
}

@keyframes boxShadowOutAnimation {
  from {
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
  }
  to {
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
  }
}

@media (min-width: 1500px) {
  .gallery-item {
    width: calc(20%); /* 5 colonnes */
  }
}

@media (min-width: 1200px) and (max-width: 1499px) {
  .gallery-item {
    width: calc(25%); /* 4 colonnes */
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .gallery-item {
    width: calc(33.33%); /* 3 colonnes */
  }
}

@media (min-width: 300px) and (max-width: 767px) {
  .gallery-item {
    width: calc(50%); /* 2 colonnes */
  }
}

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