 /* Reset & base */
 * { box-sizing: border-box; margin: 0; padding: 0; }
 html, body { height: 100%; width: 100%; }
 body {
   font-family: 'Bai Jamjuree', Roboto, Arial, sans-serif;
   background: linear-gradient(180deg, #4EB2CF 100%, #C7F3FF 0%);
   background-color: #4EB2CF;
 }

 /* Slider */
 .slider {
   position: sticky;
   top: 0;
   height: 100vh;
   overflow: hidden;
 }
 .slides { height: 100%; will-change: transform; transition: transform .8s ease; }
 .slide, .slide img { width: 100%; height: 100vh; object-fit: cover; display: block; }

 /* Empêcher tout débordement visuel entre slides */
 .slide { overflow: hidden; }

 .slide img {
   transform: scale(1.2);
   transition: transform 1.8s ease;
   pointer-events: none;
   user-select: none;
 }
 .slide.active img { transform: scale(1); }

 /* Indicateur */
 .scroll-indicator {
   position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%);
   display: flex; gap: 8px; align-items: center;
   color: rgba(255,255,255,0.95);
   text-align: center;
   cursor: pointer; user-select: none; z-index: 20;
   animation: bounce 1.6s infinite;
   text-shadow: 0 6px 18px rgba(0,0,0,0.25);
   font-size: 0.95rem;
 }
 .scroll-indicator .arrow img { width: 32px; height: auto; }
 @keyframes bounce {
   0%,20%,50%,80%,100% { transform: translateX(-50%) translateY(0); }
   40% { transform: translateX(-50%) translateY(10px); }
   60% { transform: translateX(-50%) translateY(5px); }
 }
 .bottom-fade {
   position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
   background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.18) 100%);
   z-index: 15;
 }

 /* Carte */
 .map-container { position: relative; max-width: 1920px; margin: 0 auto; 
   background-image: url("../img/Cyclea-Espace-pedagogique–4.png");
   background-size: cover; }
 .map-image { width: 100%; display: block; }

 /* Icônes superposées cliquables sur la carte */
 .icon {
   position: absolute;
   transition: transform 0.3s ease, opacity 0.3s ease;
   opacity: 0.95; cursor: pointer;
 }
 .icon:hover { transform: scale(1.08); opacity: 0.75; z-index: 10; }

 /* Positions (à adapter) */
 #tri-entreprise { top: 61%; left: 43%; width: 23%; }
 #consommation { top: 60%; left: 46%; width: 32%; }
 #usines-de-conception { top: 32%; left: 55%; width: 17%; }
 #centre-tri { top: 50%; left: 44%; width: 15%; }
 #recyclage { top: 40%; left: 35%; width: 20%; }
 #enfouissement { top: 64%; left: 34%; width: 11%; }
 #point-de-vente { top: 50%; left: 72%; width: 9%; }
 #dechetterie { top: 57%; left: 59%; width: 9%; }

 /* Hotspots auto-générés */
 .hotspot {
   position: absolute; z-index: 2; display: flex; align-items: stretch;
   background-color: #2DAC6E; color: #fff; font-weight: 700;
   cursor: pointer; border-radius: 4px;
   box-shadow: 0 2px 6px rgba(0,0,0,0.2);
   overflow: visible;
   transition: transform 0.3s ease-in-out;
 }
 .hotspot:hover { transform: scale(1.06); }
 .hotspot-id {
   background-color: #242442; padding: 0 10px; display: flex; align-items: center; justify-content: center; white-space: nowrap;
 }
 .hotspot-text {
   padding: 6px 12px; display: flex; align-items: center; font-size: 10px; text-transform: uppercase;
   word-wrap: break-word; white-space: normal; line-height: 1.2; text-align: center;
 }
 .hotspot .tooltip{
   position:absolute; bottom:110%; left:50%; transform:translateX(-50%);
   display:none; background:#fff; color:#242442; padding:8px; border-radius:6px;
   box-shadow:0 2px 6px rgba(0,0,0,.3); white-space:nowrap; font-size:12px; text-transform:uppercase; z-index:9999; pointer-events:none;
 }
 .hotspot:hover .tooltip{ display:block; }

 /* Modale */
 .modal {
   position: fixed; inset: 0; background: rgba(0,0,0,.6);
   display: none; align-items: center; justify-content: center;
   z-index: 20000;
   overscroll-behavior: contain;
 }
 .modal.active { display: flex; }
 .modal-content {
   background: #fff; padding: 2rem 3rem; border-radius: 20px;
   max-width: 1000px; width: 90%;
   max-height: 90vh; overflow-y: auto; outline: none; position: relative;
   overscroll-behavior: contain;
 }
 .modal-content::-webkit-scrollbar { width: 8px; }
 .modal-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
 .modal-content::-webkit-scrollbar-thumb { background: #2DAC6E; border-radius: 10px; }
 .modal-content::-webkit-scrollbar-thumb:hover { background: #1e8e5a; }
 #modal-body h2 { text-transform: uppercase; font-weight: 700; color: #2DAC6E; }
 .modal-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; }
 .modal-columns img { max-width: 25%; height: auto; display: block; margin-top: .5rem; }
 .modal-back-link {
   display:block; margin:2rem 0 0 auto; width:fit-content; font-size:.85rem;
   background:#2DAC6E; color:#fff; text-decoration:none; padding:6px 10px; border-radius:6px; z-index:10;
 }
 .modal-back-link:hover { background:#218b59; }
 .close-area { position:absolute; top:10px; right:10px; font-size:1.5rem; cursor:pointer; }

 /* Verrouillage scroll quand modale ouverte */
 html.modal-open, body.modal-open { overflow: hidden !important; height: 100%; }
 body.modal-open .map-container, body.modal-open .hotspot, body.modal-open .icon { pointer-events: none; }
 body.modal-open .hotspot .tooltip { display:none !important; }

 /* Accessibilité */
 .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


 /* Responsive tweaks */
 @media (max-width: 1024px) {
   .scroll-indicator { bottom: 24px; font-size: 0.85rem; }
   .scroll-indicator .arrow img { width: 28px; }
 }
 @media (max-width: 660px) {
   .scroll-indicator { bottom: 16px; font-size: 0.8rem; }
   .scroll-indicator .arrow img { width: 24px; }
   .modal-content { padding: 1.5rem; border-radius: 14px; }
   .modal-columns { grid-template-columns: 1fr; gap: 1.5rem; }
   .modal-columns img { max-width: 60%; margin: 0 auto; }
 }
 /* Mobile responsive tweaks */
@media (max-width: 600px) and (orientation: portrait) {
.page-title{font-size:1.25rem;padding:.5rem}
   .map-container{max-width:100%;position:relative}
   .map-image{border-radius:0}
   /* Hotspots list vertically */
   .hotspot-icon{
     display:block;   /* visible en mobile vertical */
   }
   .hotspot{position:static!important;display:flex;margin:.4rem auto;transform:none!important;align-items:center;}
   .hotspot-text{font-size:8px;padding:4px 8px; align-items: center;}
   .hotspot-id{padding:0 6px}
   /* Modal optimisations */
   .modal-content {
     max-width: 95%;
     padding: 1rem;
     border-radius: 12px;
     position: relative;
   }
 
   .modal-content h2 {
     font-size: 1rem;
     text-align: center;
   }
 
   .modal-columns {
     grid-template-columns: 1fr;
     gap: 0.75rem;
   }
 
   .modal-columns img,
   .modal-columns iframe {
     height: auto;
     max-height: 160px;
   }
   .modal-back-link {
     font-size: 0.8rem;
     bottom: 0.75rem;
     right: 0.75rem;
     padding: 5px 8px;
     border-radius: 6px;
   }
   .nav-arrow {
     width: 28px;
     height: 28px;
     font-size: 14px;
   }
 
   .progress-bar {
     height: 2px;
   }
   #portrait-overlay {
     display: flex;
   }
   body {
     overflow: hidden;
   }
 }

 /* Overlay portrait */
 #portrait-overlay {
   position: fixed; inset: 0; background: #242442ee; color: #fff;
   display: none; align-items: center; justify-content: center; text-align: center;
   padding: 2rem; z-index: 25000;
 }
 #portrait-overlay svg { margin-bottom: 1rem; stroke: #fff; }

 /* iPad (Pro / Air / mini) en paysage : montrer l'image en entier, sans recadrer */
@media (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) and (min-device-width: 768px) and (max-device-width: 1366px) {
/* le slide reste plein écran */
.slider,
.slide,
.slide img {
 height: 100vh;
}

/* pas de crop : on garde toute l'image */
.slide img {
 object-fit: contain !important;   /* <- clé anti-recadrage */
 width: 100% !important;
 height: 100% !important;
 transform: none !important;       /* annule le zoom d'entrée */
 transition: none !important;      /* pas d'anim de zoom */
 background: transparent;
}

/* petit fond derrière l'image si letterboxing (au choix) */
.slide {
 background-color: #4EB2CF;        /* même fond que la page */
 overflow: hidden;                  /* propre sur les bords */
}

/* l'état .active ne re-zoome pas l'image */
.slide.active img {
 transform: none !important;
}

.button {
  width: 100%;
  height: 100%;
  z-index: 99999999;
}

}

.quiz-button {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: #2E7D32; /* vert Cycléa */
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 40px;
  font-family: 'Bai Jamjuree', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quiz-cta {
  text-align: center;
  margin-top: 24px;
}

.quiz-button-inline {
  display: inline-block;
  background-color: #1E88E5; /* bleu Cycléa */
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 12px;
}

.quiz-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
