/* =========================================================
   AMUP — PAGE ZOOM (page-id-458)
   VERSION CONSOLIDÉE
   - aucun changement visuel
   - aucune règle en doublon
   - JS inchangé
========================================================= */


/* =========================================================
   1) RESET THEME — STRUCTURE PLEIN ÉCRAN
========================================================= */

body.page-id-458 #outer-wrap,
body.page-id-458 #wrap,
body.page-id-458 #content-wrap,
body.page-id-458 #main{
  width:100%;
  max-width:100%;
  margin:0;
  padding:0;
}

body.page-id-458 .page-header,
body.page-id-458 .page-header-bg,
body.page-id-458 h1{
  display:none;
}


/* =========================================================
   2) STRUCTURE GLOBALE
========================================================= */

/*.zoom-layout{
  position:relative;
  z-index:1;
  overflow:visible;
}
*/

/* =========================================================
   3) SLIDER
========================================================= */

.zoom-slides{
  list-style:none;
  margin:0;
  padding:0;
  overflow:visible;
}

.zoom-slide-item{
  display:none;
  overflow:visible;
}

/* =========================================================
   SLIDER — MODE NON-ZOOM
   - abaissé pour éviter la légende
========================================================= */
body.page-id-458:not(.amup-zoom-active) .zoom-slide-item.is-active{
  display:flex;
  min-height:calc(100vh - 140px);
  padding-top:140px;
  align-items:center;
  justify-content:center;
}


/* =========================================================
   4) IMAGE
========================================================= */

.zoom-slide{
  display:block;
  margin:0 auto;
  max-width:none;
  max-height:none;
  object-fit:contain;
  position:relative;
  z-index:1;
}

/* MODE NORMAL */
body.page-id-458:not(.amup-zoom-active) .zoom-slide{
  cursor: default;
}

/* MODE ZOOM */
body.page-id-458.amup-zoom-active .zoom-slide{
  margin:0 !important;
  float:left;
}

/* =========================================================
   5) MODE ZOOM — PAN LIBRE
========================================================= */

/* body ne scroll jamais */
body.page-id-458{
  overflow:hidden;
}

/* suppression du centrage flex */
body.page-id-458.amup-zoom-active .zoom-slide-item.is-active{
  display:block;
}

/* image libre */
body.page-id-458.amup-zoom-active .zoom-slide{
  margin:0 !important;
  float:left;
  cursor:grab;
}



body.page-id-458.amup-zoom-active .zoom-slider-wrapper:active{
  cursor:grabbing;
}


/* =========================================================
   CURSEUR — MODE NORMAL
========================================================= */

body.page-id-458:not(.amup-zoom-active) .zoom-slide{
  cursor: default !important;   /* flèche standard */
}


/* =========================================================
   CURSEUR — MODE ZOOM (MAIN ROUGE LARGE)
========================================================= */

body.page-id-458.amup-zoom-active .zoom-slide{
  cursor: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24'>\
  <path d='M9 11V5a2 2 0 1 1 4 0v6h1V4a2 2 0 1 1 4 0v7h1a2 2 0 0 1 2 2v2a6 6 0 0 1-6 6h-3a7 7 0 0 1-7-7V8a2 2 0 1 1 4 0v3z'\
  fill='%23e60000' stroke='%23000000' stroke-width='1.2'/>\
  </svg>") 24 24, grab !important;
}


/* =========================================================
   CURSEUR — DRAG ACTIF (FERMÉ)
========================================================= */

body.page-id-458.amup-zoom-active .zoom-slide.amup-dragging{
  cursor: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24' fill='%23e60000'>\
  <path d='M5 12h14v2H5z'/>\
  </svg>") 24 24, grabbing !important;
}

/* =========================================================
   6) FLÈCHES DE NAVIGATION — 30px EXACT / CENTRÉ FENÊTRE
========================================================= */

.zoom-arrow{
  position:fixed;
  width:30px;
  height:30px;
  border-radius:50%;
  background:#3c3c3c;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 18px rgba(0,0,0,0.35);
  cursor:pointer;
  z-index:6000;
  border:none;
  font-size:0;
}

/* CENTRAGE VERTICAL EXACT FENÊTRE */
.zoom-prev,
.zoom-next{
  top:50%;
  transform:translateY(-50%);
}

.zoom-prev{ left:20px; }
.zoom-next{ right:20px; }

/* Suppression anciens caractères */
.zoom-prev::before,
.zoom-next::before{
  content:none;
}

/* SVG intégré */
.zoom-prev::after,
.zoom-next::after{
  content:"";
  width:18px;
  height:18px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}

/* Flèche gauche avec tige */
.zoom-prev::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
  <path d='M14 6 L8 12 L14 18 M8 12 H20' \
  stroke='white' stroke-width='2.8' \
  stroke-linecap='round' stroke-linejoin='round' fill='none'/>\
  </svg>");
}

/* Flèche droite avec tige */
.zoom-next::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
  <path d='M10 6 L16 12 L10 18 M4 12 H16' \
  stroke='white' stroke-width='2.8' \
  stroke-linecap='round' stroke-linejoin='round' fill='none'/>\
  </svg>");
}

/* Hover léger sans casser le centrage */
.zoom-arrow:hover{
  transform:translateY(-50%) scale(1.08);
}
/* =========================================================
   7) GROUPE DES BOUTONS (+ − reset info bg)
========================================================= */

.zoom-plus-minus{
  position:fixed;
  bottom:18px;
  left:18px;
  display:flex;
  gap:12px;
  z-index:5000;
}

.zoom-btn{
  position:relative;
  width:52px;
  height:52px;
  border-radius:50%;
  border:2px solid #e60000;
  background:#fff;
  color:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:700;
  cursor:pointer;
  overflow:visible; /* indispensable pour les tooltips */
}


/* =========================================================
   8) BOUTON FOND NOIR / BLANC
========================================================= */

#zoom-bg{
  background:linear-gradient(
    to right,
    #fff 0%,
    #fff 50%,
    #000 50%,
    #000 100%
  ) !important;
  color:#e60000;
}


/* =========================================================
   9) INFO-BULLES — VERSION AMUP CANONIQUE
   - fond blanc
   - texte rouge
   - bord rouge
   - aucune dépendance au thème
========================================================= */

.zoom-btn::after{
  content:attr(data-tip);
  position:absolute;
  bottom:120%;
  left:50%;
  transform:translateX(-50%);

  background:#fff;
  color:#e60000;

  border:2px solid #e60000;
  padding:6px 12px;
  border-radius:10px;

  font-size:12px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;

  opacity:0;
  pointer-events:none;
}

.zoom-btn:hover::after{
  opacity:1;
}

/* =========================================================
   10) LÉGENDE — HEADER FIXE RÉEL (COMPATIBLE BODY LOCK)
========================================================= */

#zoom-desc-box{
  position: fixed;
  top: 0 !important;
  left: 50%;
  transform: translateX(-50%);

  width: calc(100% - 40px);
  max-width: 820px;

  margin-top: calc(
    var(--wp-admin--admin-bar--height, 0px)
    + env(safe-area-inset-top, 0px)
    + 1px
  );

  background: rgba(60,60,60,.85) !important;
  color: #fff !important;

  padding: 2px 16px;
  border-radius: 18px;

  text-align: center;
  line-height: 1;
  font-size: 12px;

  z-index: 9000;
}

/* paragraphes : pas de marges */
#zoom-desc-box p{
  margin: 0;
}

/* première ligne en gras */
#zoom-desc-box .zoom-caption{
  font-weight: 600;          /* poids réellement présent */
  font-size: 18px;           /* clé : perceptibilité */
  line-height: 1.25;
  letter-spacing: 0.04em;    /* accentuation visuelle */
}

/* visible hors zoom */
body.page-id-458 #zoom-desc-box{
  opacity: 1;
  pointer-events: auto;
}

/* masquée en zoom */
body.page-id-458.amup-zoom-active #zoom-desc-box{
  opacity: 0;
  pointer-events: none;
}

/* affichée via bouton info */
body.page-id-458.amup-zoom-active.legend-open #zoom-desc-box{
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   LÉGENDE MOBILE — VERSION ÉLARGIE CONTRÔLÉE
========================================================= */
/* =========================================================
   LÉGENDE MOBILE — VERSION FINALE CONTRÔLÉE
========================================================= */
@media (max-width:768px){

  body.page-id-458 #zoom-desc-box{
    top:10px !important;

    left:56px !important;   /* espace hamburger */
    right:56px !important;  /* espace flèche */

    transform:none !important;
    width:auto !important;
    max-width:none !important;

    padding:6px 14px;
    border-radius:16px;

    max-height:45vh;
    overflow-y:auto;
  }

}


/* =========================================================
   11) FOND CLAIR / SOMBRE
========================================================= */

body.page-id-458{ background:#fff; }

body.page-id-458.amup-bg-dark,
body.page-id-458.amup-bg-dark #outer-wrap,
body.page-id-458.amup-bg-dark #wrap,
body.page-id-458.amup-bg-dark #content-wrap,
body.page-id-458.amup-bg-dark #main{
  background:#111 !important;
}

/* =========================================================
   12) BOUTON LIBERTÉ
   (drag-hint supprimé définitivement)
========================================================= */

.zoom-pulse{
  position:fixed;
  left:18px;
  bottom:90px;

  width:76px;
  height:76px;

  border-radius:50%;
  background:#fff;
  border:2px solid #e60000;
  color:#e60000;

  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  font-size:12px;
  font-weight:700;
  line-height:1.2;

  cursor:pointer;
  z-index:4500;
}


/* =========================================================
   13) ANIMATIONS
   (animation pulse conservée uniquement pour zoom-pulse)
========================================================= */

@keyframes amupPulseRedToWhite{
  0%,49%{ background:#e60000; color:#fff; }
  50%,100%{ background:#fff; color:#e60000; }
}

body.page-id-458:not(.amup-zoom-active) .zoom-pulse{
  animation:amupPulseRedToWhite 2s ease-in-out infinite;
}


/* =========================================================
   14) RESPONSIVE
========================================================= */

@media (max-width:1200px){
  .zoom-arrow{ width:30px; height:30px; }
}

@media (max-width:768px){
  .zoom-arrow{
    width:30px;
    height:30px;
    top:50%;
    transform:translateY(-50%);
  }

  .zoom-prev{ left:12px; }
  .zoom-next{ right:12px; }
}

  .zoom-plus-minus{ bottom:12px; left:12px; }
  .zoom-btn{ width:40px; height:40px; font-size:20px; }

.zoom-pulse{
  width:74px;
  height:74px;

  font-size:11px;
  line-height:1.15;

  padding:6px;
  box-sizing:border-box;

  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  word-break:break-word;
  overflow:hidden;
}


}