/* === Container Masonry === */
.custom-masonry-gallery {
  column-count: 4;       /* 4 colonnes par défaut */
  column-gap: 15px;      /* Espace entre les colonnes */
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .custom-masonry-gallery {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .custom-masonry-gallery {
    column-count: 2;
  }
}

@media (max-width: 480px) {
  .custom-masonry-gallery {
    column-count: 1;
  }
}

/* === Items === */
.custom-masonry-gallery .gallery-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 15px;
  background: #6fac46;
  border-radius: 12px;
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  position: relative; /* Pour la caption absolute */
}

/* === Images === */
.custom-masonry-gallery .gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* === Captions centrées === */
.custom-masonry-gallery .gallery-item .caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  font-size: 30px;
  color: white;
  font-weight: bold;
  text-align: center;
  /*background: rgba(0, 0, 0, 0.5);*/
  border-radius: 6px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Effet hover : affiche la caption */
/*.custom-masonry-gallery .gallery-item:hover .caption {
  opacity: 1;
}
*/