/* =========================================================
 * FULLSCREEN
 * Boutons + conteneurs pouvant passer en plein écran
 * ======================================================= */


/* =========================================================
 * 1. Conteneur image avec bouton fullscreen
 * ======================================================= */

.image-fullscreen-box {
  position: relative;
  display: inline-block;
  line-height: 0; /* évite l’espace sous l’image */
}

.image-fullscreen-box img {
  display: block;
  max-width: 100%;
  height: auto;
}


/* =========================================================
 * 2. Bouton fullscreen générique
 * ======================================================= */

.btn-fullscreen {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;

  padding: 2px 10px;

  font-size: 11px;
  color: grey;

  background-color: rgba(34, 170, 161, 0.2);
  border: 2px solid rgba(34, 170, 161, 0.3);
  border-radius: 5px;

  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-fullscreen:hover {
  background-color: rgba(34, 170, 161, 0.5);
  border-color: rgba(34, 170, 161, 0.6);
}


/* =========================================================
 * 3. Variante bouton icône seule
 * À utiliser avec :
 * class="btn-fullscreen btn-fullscreen-icon"
 * ======================================================= */

.btn-fullscreen-icon {
  width: 38px;
  height: 38px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  line-height: 1;

  color: #1e7e99;
  background: rgba(255, 255, 255, 0.88);

  border: 1px solid rgba(30, 126, 153, 0.35);
  border-radius: 10px;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}


/* =========================================================
 * 4. Correctifs ponctuels
 * ======================================================= */

/* Cas particulier : bouton trop haut/bas dans ce carousel */
#carousel-dif .btn-fullscreen {
  top: 30px !important;
}


/* =========================================================
 * 5. Élément pouvant passer en plein écran
 * ======================================================= */

.fullscreen-target {
  position: relative;
}


/* =========================================================
 * 6. Aspect général en plein écran
 * ======================================================= */

.fullscreen-target:fullscreen {
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;

  padding: 20px;
  overflow: auto;

  background: white;
}


/* Les images ne débordent jamais en plein écran */
.fullscreen-target:fullscreen img {
  display: block;
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: 90vh;
  margin: auto;

  object-fit: contain;
}


/* =========================================================
 * 7. Cas spécial : image seule à agrandir
 * ======================================================= */

.fullscreen-target.fs-image:fullscreen {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.fullscreen-target.fs-image:fullscreen img {
  width: 95vw !important;
  height: 90vh !important;
  max-width: 95vw !important;
  max-height: 90vh !important;

  object-fit: contain;
}


/* =========================================================
 * 8. Cas spécial : bloc flex en plein écran
 * ======================================================= */

.fullscreen-target.fs-flex:fullscreen {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 30px;
}


/* =========================================================
 * 9. Compatibilité DND : bouton fullscreen interne
 * ======================================================= */

.dnd-stage .dnd-fullscreen:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 109, 134, 0.45);
}

.dnd-stage .dnd-fullscreen:active {
  transform: translateY(1px);
}


/* =========================================================
 * 10. Responsive
 * ======================================================= */

@media (max-width: 768px) {
  .btn-fullscreen {
    padding: 2px 6px;
    font-size: 10px;
  }

  .fullscreen-target.fs-flex:fullscreen {
    flex-direction: column;
  }
}