/**
 * Diaporama Barrere - reprise du rendu du module Slideshow CK (theme camera).
 *
 * Les classes camera_* sont conservees a l'identique : les surcharges du gabarit
 * (.itemid-104 / .itemid-231 dans css/custom.css) continuent de s'appliquer.
 *
 * @copyright  (C) 2026 - reprise du site Barrere Academie
 * @license    GNU General Public License version 2 or later
 */

.barrere-diaporama.camera_wrap {
  display: block;
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-height: var(--bd-minheight, 150px);
  overflow: hidden;
  background: none;
}

.barrere-diaporama .camera_fakehover {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: var(--bd-minheight, 150px);
  z-index: 1;
}

.barrere-diaporama .camera_target {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  text-align: left;
}

.barrere-diaporama .cameraCont {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.barrere-diaporama .cameraSlide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translate3d(100%, 0, 0);
  -webkit-transition: transform var(--bd-transition, 1000ms) ease-in-out, opacity var(--bd-transition, 1000ms) ease-in-out;
  transition: transform var(--bd-transition, 1000ms) ease-in-out, opacity var(--bd-transition, 1000ms) ease-in-out;
  pointer-events: none;
  will-change: transform, opacity;
}

.barrere-diaporama .cameraSlide.cameracurrent {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  z-index: 999;
  pointer-events: auto;
}

.barrere-diaporama .cameraSlide.cameraprevious {
  opacity: 1;
  transform: translate3d(-100%, 0, 0);
  z-index: 998;
}

/* Remise a zero d'une diapositive sortie de piste, sans animer le retour. */
.barrere-diaporama .cameraSlide.cameraoff {
  -webkit-transition: none;
  transition: none;
}

.barrere-diaporama .cameraSlide img {
  display: block;
  width: 100%;
  height: auto;
  /* Pas de max-width : le gabarit impose height:100vw + width:auto en dessous de 769 px pour
     recadrer l'image (debit lateral) ; un max-width la ramenerait a la largeur du cadre. */
  max-width: none;
  border: 0;
}

.barrere-diaporama .cameraSlide .camera-link {
  display: block;
  height: 100%;
}

/* Minuteur circulaire (loader « pie » de Slideshow CK). */
.barrere-diaporama .camera_pie {
  position: static;
  width: 100%;
  height: 0;
  line-height: 0;
}

.barrere-diaporama .camera_pie canvas {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  z-index: 1002;
  opacity: 0.8;
  /* Fondu de 400 ms a la reapparition du minuteur, comme le fadeIn de Slideshow CK. */
  transition: opacity 400ms linear;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .barrere-diaporama .cameraSlide {
    -webkit-transition: none;
    transition: none;
  }

  .barrere-diaporama .camera_pie {
    display: none;
  }

  .barrere-diaporama .camera_pie canvas {
    transition: none;
  }
}
