/* Lightbox - Version Corrigée Sans Doublons */

/* Modal principal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal-content {
  max-width: 80%;
  max-height: 80%;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 5px solid #4A5D23;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#modal-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  max-height: 80vh;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 93, 35, 0.5);
  border-radius: 50%;
  border: 2px solid #4A5D23;
}

.close-modal:hover {
  color: #C41E3A;
  transform: rotate(90deg);
}

.image-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #fff;
  padding: 10px 0;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Icône de zoom */
.popup-image::after {
  content: "\f00e";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-image:hover::after {
  opacity: 1;
}

/* Contrôles de diaporama */
.slideshow-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem;
  background: rgba(44, 27, 14, 0.8);
  position: absolute;
  bottom: 0;
  left: 0;
  color: white;
  border-radius: 0 0 8px 8px;
  backdrop-filter: blur(5px);
  border-top: 2px solid #8f993e;
  z-index: 10000;
  gap: 15px;
}

.prev-slide {
  order: 1;
}

.slide-counter {
  order: 2;
}

.next-slide {
  order: 3;
}

.prev-slide, .next-slide {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  background: rgba(143, 153, 62, 0.3);
  border-radius: 8px;
  border: 1px solid #8f993e;
}

.prev-slide:hover, .next-slide:hover {
  background: #8f993e;
  transform: translateY(-2px);
  color: white;
}

.slide-counter {
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Cinzel', serif;
}

/* Responsive */
@media (max-width: 480px) {
  .popup-image {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .modal-content {
    width: 95%;
    height: 85%;
  }
  
  .close-modal {
    font-size: 1.5rem;
    top: 10px;
    right: 15px;
  }
  
  .slideshow-controls {
    padding: 0.5rem;
  }
  
  .prev-slide, .next-slide {
    padding: 0.3rem 0.8rem;
    font-size: 1rem;
  }
}