.gallery-container {
  display: grid;
  grid-template-rows: repeat(2, auto);
  gap: 8px;
}

.gallery-row {
  display: flex;
  flex-wrap: wrap; /* Permet le passage à la ligne */
  gap: 8px; /* Espace entre les items */
}

.gallery-item {
  flex: 1 1 calc(33.333% - 8px); /* Pour 3 éléments en haut */
  position: relative; /* Pour les vidéos */
  overflow: hidden;
  border-radius: 8px;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto; /* Permet de maintenir le ratio d'aspect */
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Pour les petits écrans */
@media (max-width: 768px) {
  .gallery-item {
    flex: 1 1 calc(50% - 8px); /* Pour 2 éléments sur mobiles */
  }
}

@media (max-width: 480px) {
  .gallery-item {
    flex: 1 1 100%; /* Pour 1 élément sur très petits écrans */
  }
}

.gallery-row:first-child {
  justify-content: space-between;
}
.gallery-row:first-child .gallery-item img {
  height: 250px;
}

/* Hauteur augmentée pour les 2 images du bas */
.gallery-row:last-child .gallery-item img {
  margin-top: -90px;
  height: 350px;
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s;
}

.description {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0a7913;
  color: white;
  padding: 5px;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .description {
  opacity: 1;
}

/* Lightbox Styles */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

#lightbox-img,
#lightbox-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: -30px;
  right: 0;
  font-size: 24px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}
