/* =========================================================
   style-trip.css
   Feuille autonome du carnet de voyages
   ========================================================= */

/* Base */
html,
body {
    font-family: cursive;
    font-size: 1.05em;
    color: DarkSlateGray;
}

body {
    background-color: lightgray;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
}

img {
    max-width: 100%;
    height: auto;
}

h1 {
    color: orange;
    background-color: blue;
    text-align: center;
    padding: 10px;
    border-radius: 15px;
}

h2 {
    text-align: center;
}

p {
    width: min(800px, 90vw);
    text-align: justify;
    margin-left: auto;
    margin-right: auto;
}

iframe {
    display: block;
    width: 100%;
    height: 320px;
    border: 0;
}

/* Sommaire */
.page-sommaire > h1 {
    max-width: 1100px;
    margin: 20px auto;
}

.liste-voyages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1100px;
    margin: 30px auto;
}

.voyage-liste {
    display: block;
    width: min(360px, 90vw);
    padding: 12px;
    color: inherit;
    text-align: center;
    text-decoration: none;
    background: white;
    border-radius: 12px;
    box-shadow: 4px 4px 8px #7777;
}

.voyage-liste img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.voyage-liste h2 {
    margin-bottom: 4px;
}

/* Bandeau supérieur : éléments alignés sans positionnement absolu */
#menuMobile {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
}

#accueilbap, #memo {
    position: static;
    background: white;
    color: blue;
    font-size: 0.8em;
    box-shadow: 4px 4px 8px #7777;
    border-radius: 10px;
    padding: 8px;
    box-sizing: border-box;
}
#accueilbap { flex: 0 0 auto; width: 50px; text-align: center; }
#accueilbap img { display: block; width: 40px; max-width: 100%; margin: 0 auto; }
#memo { flex: 1 1 190px; max-width: 250px; }
#memo ul { padding-left: 18px; margin: 0; }
.commandes-voyage {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto;
}
.icone-connexion {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border: 0; border-radius: 10px;
    background: white;
    box-shadow: 4px 4px 8px #7777;
    font-size: 1.5em; cursor: pointer;
}
.voyant { position: absolute; width: 10px; height: 10px; border: 1px solid #555; border-radius: 50%; right: 4px; bottom: 4px; }
.voyant.rouge { background: #e53935; }
.voyant.vert { background: #2eaa50; }

.index {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.index p {
    width: 100%;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px;
    box-sizing: border-box;
}

.lien-carte,
.astuce {
    text-align: center;
}

/* Dialogues de connexion */
.dialog-connexion[hidden] { display: none; }
.dialog-connexion { position: fixed; inset: 0; z-index: 10010; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.45); box-sizing: border-box; }
.boite-connexion { position: relative; width: min(360px, 92vw); padding: 24px; border-radius: 14px; background: white; box-shadow: 4px 4px 8px #7777; box-sizing: border-box; }
.boite-connexion h2 { margin-top: 0; }
.form-connexion { display: flex; flex-direction: column; gap: 10px; }
.form-connexion input { width: 100%; box-sizing: border-box; padding: 9px; }
.form-connexion button, .bouton-deconnexion { display: inline-block; padding: 9px 14px; }
.fermer-dialogue { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 0.8em; cursor: pointer; }
.erreur-connexion { color: #a00000; margin: 8px 0 0; }

/* Scène : carte centrale et vignettes */
/* Correctif à ajouter tout à la fin de style-trip.css */

/* La scène devient son propre contexte de superposition. */
#scene {
    position: relative;
    width: min(100%, 1100px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    margin: 24px auto;
    overflow: hidden;
}
/* La carte reste visible sous les fils et les vignettes, sans déformation. */
#carte {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(500px, 90%);
    max-width: 90%;
    height: auto;
    display: block;
    object-fit: contain;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.filsCarte {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}

.vignette {
    position: absolute;
    display: block;
    width: 100px;
    height: 72px;
    max-width: none;
    object-fit: cover;
    border: 2px solid white;
    border-radius: 8px;
    box-shadow: 4px 4px 8px #7777;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 2;
}


.fil {
    fill: none;
    stroke: #b9aede;
    stroke-width: 1;
    opacity: 0.8;
}

.noeud {
    stroke: white;
    stroke-width: 1.5;
    opacity: 1;
}


.vignette:hover {
    z-index: 3;
    transform: translate(-50%, -50%) scale(1.06);
}

/* Visionneuse */
#visionneuse[hidden] {
    display: none;
}

#visionneuse {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 12px 20px;
    box-sizing: border-box;
    background: rgba(23, 21, 34, 0.93);
}

.contenu-visionneuse {
    max-width: 100%;
    max-height: 100%;
    text-align: center;
}

#cadre {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 78vh;
}

#cadre img,
#cadre video {
    display: block;
    max-width: 90vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
}

#legende {
    margin-top: 10px;
    color: white;
    text-align: center;
}

.bouton {
    position: absolute;
    top: 15px;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    color: white;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.8em;
    cursor: pointer;
}

.bouton:hover {
    background: rgba(255, 255, 255, 0.3);
}

#fermer {
    right: 15px;
}

#precedent {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

#suivant {
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Adaptation aux petits écrans */

@media screen and (max-width: 800px) {
    #menuMobile { align-items: center; gap: 8px; padding: 6px; }
    #memo { flex-basis: 160px; max-width: none; }
    .commandes-voyage { margin-left: auto; }

    .index {
        padding: 0 10px;
    }
}

@media (max-width: 600px) {
    #scene {
        width: 100%;
        max-width: 100%;
        margin: 16px auto;
    }

    #carte {
        width: min(500px, 90%);
    }

    .vignette {
        width: 65px;
        height: 48px;
    }
}
.boutonsvg {
  border: none;
  width: 50px;
  height: 50px;
  box-sizing: border-box;
  padding: 5px;              /* la marge autour de l'icône */
  background: white;
  border-radius: 10px;
  box-shadow: 4px 4px 8px #7777;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boutonsvg svg {
  width: 100%;
  height: 100%;
  display: block;            /* évite un décalage vertical parasite */
}