/**
 * Styles pour la galerie masonry
 */

.masonry-gallery {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.masonry-gallery-container {
  position: relative;
}

.actualite-gallery-wrapper {
  margin-top: 40px;
  margin-bottom: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.actualite-content-wrapper {
  margin-bottom: 20px;
}

.gallery-title {
  font-size: 24px;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}

.gallery-title:after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: #007bff;
}

.masonry-gallery-grid {
  margin: 0 -5px;
  width: 100%;
}

/* Optimisations pour Masonry */
.masonry-gallery-item {
  padding: 8px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Les éléments dans une grille à 4 colonnes ont un padding plus petit */
.masonry-gallery-4col .masonry-gallery-item {
  padding: 5px;
}

.masonry-gallery-item img,
.masonry-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.masonry-gallery-item:hover {
  transform: translateY(-3px);
}

.masonry-gallery-item img:hover,
.masonry-image:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Style pour desktop large */
@media screen and (min-width: 1200px) {
  .masonry-gallery-4col .masonry-gallery-item {
    width: 25% !important; /* 4 colonnes, important pour s'assurer que c'est prioritaire */
  }

  .masonry-gallery-item {
    width: 33.33%;
  }
}

/* Style pour desktop moyen */
@media screen and (min-width: 768px) and (max-width: 1199px) {
  .masonry-gallery-item {
    width: 33.33%; /* 3 colonnes */
  }
}

/* Style pour tablette */
@media screen and (max-width: 767px) and (min-width: 481px) {
  .masonry-gallery-item {
    width: 50%; /* 2 colonnes */
  }
}

/* Style pour mobile */
@media screen and (max-width: 480px) {
  .masonry-gallery-item {
    width: 100%; /* 1 colonne */
  }
}
