/* ======================================= */
/* 🌍 BASE ET SÉCURITÉ DU VIEWPORT         */
/* ======================================= */
html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Suppression de l'overflow hidden global pour laisser respirer le contenu en cas de zoom */
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
}

/* ======================================= */
/* 🏡 PAGE D'ACCUEIL (HERO SECTION)         */
/* ======================================= */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh; /* S'assure de couvrir tout l'écran au minimum */
    padding: 40px 30px 60px; /* Espace équilibré en bas pour la signature */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden; /* Empêche uniquement le défilement horizontal parasite */
}

/* Fond plein écran */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.30), rgba(0,0,0,0.30)), url('fond-accueil.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;

}

.hero > * {
    position: relative;
    z-index: 1;
}

/* Titre */
h1 {
    font-size: 92px;
    margin-top: 30px;
    margin-bottom: 10px;
    font-family: Georgia, serif;
    color: #7a0f16;
    font-weight: bold;
    text-shadow:
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        0 4px 18px rgba(0,0,0,0.35);
    letter-spacing: 2px;
}

.seo-hidden {
    position: absolute;
    left: -9999px;
}

.separator {
    width: 220px;
    height: 3px;
    background: #7a0f16;
    margin-bottom: 40px;
    border-radius: 10px;
}

.intro {
    max-width: 820px;
    font-size: 22px;
    line-height: 1.6;
    color: #111;
    background: rgba(255,255,255,0.72);
    padding: 30px 40px;
    border-radius: 26px;
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    margin-bottom: 60px;
    box-sizing: border-box;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 34px;
    width: 100%;
    max-width: 1150px;
    box-sizing: border-box;
    margin-bottom: 40px; /* Laisse de l'espace avant la signature */
}

.card3d {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
    background: linear-gradient(145deg, #a61b29, #7a0f16);
    color: white;
    text-decoration: none;
    font-size: 34px;
    font-weight: bold;
    border-radius: 22px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.28), inset 0 2px 4px rgba(255,255,255,0.20);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 20px;
    grid-column: span 2;
    box-sizing: border-box;
}

.card3d:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 18px 34px rgba(0,0,0,0.36), inset 0 2px 4px rgba(255,255,255,0.35);
}

.card3d.wide {
    grid-column: span 3;
}

.card3d-large {
    width: 100%;
    max-width: 1150px;
    min-height: 115px;
    margin: -5px auto 40px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.card3d-large strong {
    display: block;
    font-size: 34px;
    line-height: 1.2;
}

.card3d-large span {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    font-style: italic;
    font-weight: normal;
    line-height: 1.3;
}

/* ======================================= */
/* 🗺️ LEAFLET MAP INTERFACE               */
/* ======================================= */
#map {
    height: calc(100vh - 100px); 
    width: 100%;
}

header {
    padding: 15px;
    text-align: center;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.homebtn {
    text-decoration: none;
    font-weight: bold;
    color: #7a0f16;
}

.ville-box {
    display: inline-block;
    padding: 10px 18px;
    background: rgba(255,255,255,0.94);
    border: 3px solid #7a0f16;
    border-radius: 14px;
    font-weight: bold;
    font-size: 18px;
    color: #111;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, background 0.2s ease;
}

.ville-box:hover {
    transform: scale(1.08);
    background: #ffefef;
}

.leaflet-div-icon {
    background: transparent;
    border: none;
}


/* Style soigné pour l'infobulle au survol des villes */
.leaflet-tooltip.custom-tooltip {
  background-color: #1f2a44;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-align: center;
}

/* Flèche du tooltip */
.leaflet-tooltip-top.custom-tooltip::before {
  border-top-color: #1f2a44;
}









/* ======================================= */
/* 🎬 SLIDESHOW VIEWER DE CONDUITE         */
/* ======================================= */
.slideshow-body {
    background: black;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#viewer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: black;
}

.slide, #img1, #img2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    z-index: 1;
    transform-origin: center;
    will-change: transform, opacity; 
    transition: opacity 0.8s ease-in-out, transform 0.1s ease-out;
    max-width: 100%;
    max-height: 100%;
    display: block;
}




#photoCounter{
    position:absolute;
    top:20px;
    right:20px;

    padding:6px 12px;

    background:rgba(0,0,0,0.45);
    color:white;

    font-size:20px;
    font-weight:bold;

    border-radius:20px;

    z-index:1000;

    user-select:none;
}






#videoSlide {
    background: black;
    pointer-events: auto;

    width: 100%;
    height: 100%;
    object-fit: contain;
}



.slide.visible, #img1.visible, #img2.visible { 
    opacity: 1; 
    z-index: 2;
}

#viewer img {
    -webkit-user-drag: none; 
    user-select: none;
    pointer-events: none; 
}

#caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 85%;
    text-align: center;
    color: white;
    font-size: 22px;
    line-height: 1.4;
    background: rgba(0,0,0,0.50);
    padding: 14px 22px;
    border-radius: 14px;
    z-index: 10;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* ======================================= */
/* 🧭 NAVIGATION INTERFACE                 */
/* ======================================= */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 42px;
    color: white;
    padding: 10px;
    cursor: pointer;
    user-select: none;
    z-index: 20;
}

.left { left: 10px; }
.right { right: 10px; }

.back {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    color: black;
    z-index: 20;
}

.pekin-btn-wrap {
    position: absolute;
    bottom: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.pekin-btn {
    background: #7a0f16;
    color: white;
    padding: 14px 26px;
    border-radius: 14px;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.pekin-btn:hover {
    transform: scale(1.05);
}

/* Info & Note Panel */
#noteBtn {
    position: absolute;
    bottom: 90px;
    right: 25px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.75);
    color: #111;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    font-size: 20px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

#noteBtn:hover { transform: scale(1.1); }


@keyframes pulseInfo {
    0% {
        transform: scale(0.65);
        background: rgba(255,255,255,0.75);
    }

    45% {
        transform: scale(1.35);
        background: rgba(255,215,0,0.95);
    }

    100% {
        transform: scale(1);
        background: rgba(255,255,255,0.75);
    }
}

#noteBtn.noteFlash {
    animation: pulseInfo 0.65s ease;
}


#noteBox {
    position: absolute;
    bottom: 140px;
    right: 25px;
    max-width: 1000px;
    background: rgba(0,0,0,0.72);
    color: white;
    padding: 18px 20px;
    border-radius: 18px;
    font-size: 18px;
    line-height: 1.5;
    z-index: 60;
    display: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    white-space: pre-line;
}

/* Signature */
.footer-signature {
    margin-top: auto; /* Se pousse naturellement vers le bas du flux */
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,0.78);
    z-index: 5;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    padding-top: 20px;
}

.footer-signature a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
}

.footer-signature a:hover {
    text-decoration: underline;
}

/* ======================================= */
/* 🗺️ INTERFACE CARTOGRAPHIQUE LABELS     */
/* ======================================= */
.province-name {
    font-size: 15px;
    font-weight: bold;
    color: #444;
    background: rgba(255,255,255,0.55);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    backdrop-filter: blur(2px);
    transition: all 0.25s ease;
}

.label-active {
    color: #ff2d55;
    font-weight: 700;
    transform: scale(1.2);
    background: rgba(255,255,255,0.85);
    text-shadow:
        0 0 6px #ff2d55,
        0 0 12px #ff2d55,
        0 0 24px #ff2d55,
        0 0 36px #ff2d55;
    animation: pulseLabel 1.2s infinite ease-in-out;
}

@keyframes pulseLabel {
    0% { transform: scale(1.15); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1.15); }
}

/* ======================================= */
/* 💡 COMPOSANTS DE L'AIDE & MODALE       */
/* ======================================= */
.help-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    z-index: 100;
    animation: clignotement 2s infinite ease-in-out;
}

.help-trigger:hover {
    background: white;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateY(-2px);
    animation: none;
    opacity: 1;
}


.version-trigger {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
}

.version-trigger:hover {
    background: white;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.version-trigger .question {
    display: inline-block;
    animation: blinkQuestion 1.2s infinite ease-in-out;
}

@keyframes blinkQuestion {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.5);
    }
}



.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(8px);
    z-index: 1000;

    justify-content: center;
    align-items: flex-start;

    overflow-y: auto;
    padding: 30px 0;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    color: #f5f5f5;
    padding: 40px;
    border-radius: 18px;
    width: min(900px, 92%);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 35px rgba(0,0,0,0.55);
    animation: fadeIn 0.35s ease-out;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: sticky;
    top: 0;
    float: right;
    margin-top: -20px;
    margin-right: -15px;
    background: rgba(122, 15, 22, 0.95);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    line-height: 1;
    z-index: 2;
text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;

}

.close-btn:hover {
    background: #a61b29;
    transform: scale(1.06);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 32px;
    text-align: center;
}

.help-sections {
    margin-top: 25px;
}

.help-item {
    margin-bottom: 20px;
}

.help-item h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #ffcc00;
}

.help-item p {
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
    color: #ccc;
}

@keyframes clignotement {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        opacity: 0.4;
        box-shadow: 0 0 10px 4px rgba(255, 255, 255, 0.1);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
}

/* ======================================= */
/* 📱 AFFICHAGE RESPONSIVE (MOBILES)       */
/* ======================================= */
@media(max-width:700px){
    h1 { font-size: 52px; }
    .intro { font-size: 18px; padding: 22px; }
    .menu-grid { grid-template-columns: 1fr; gap: 20px; }
    .card3d { font-size: 24px; min-height: 100px; grid-column: auto; }
    .card3d.wide { grid-column: auto; }
    .card3d-large {
        max-width: 100%;
        min-height: 100px;
        margin: 0 auto 30px;
        padding: 22px 16px;
    }
    .card3d-large strong { font-size: 26px; }
    .card3d-large span { font-size: 16px; }
    .modal { padding: 15px 0; }
    .modal-content {
        width: 94%;
        max-height: calc(100vh - 30px);
        padding: 28px 22px;
    }
    .modal h2 { font-size: 25px; }
    .help-item h3 { font-size: 18px; }
    .help-item p { font-size: 15px; }
    #caption { font-size: 15px; }
    .ville-box { font-size: 14px; padding: 8px 12px; }
}
