:root{
    --color1: #4d3c31;
    --color2: #F8F7F2;
    --color3: #ad7e5f;
    --color4: #394f69;
    --item-height: 24px;
}

html{
    scroll-padding-top: 180px;
}
body{
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
}
button, input, select, textarea{
    font-family: inherit;
}

body.contenu{
    background-image: url("images/carte_europe-1660-recadrer-rb.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center top;
    background-size: 100% auto;
    background-color: rgba(255, 255, 255, 0.4);
    background-blend-mode: lighten;
}

/*Header*/
header{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    padding-top: 20px;
    padding-bottom: 20px;
    background-color: var(--color1);
    position: fixed;
    width: 100%;
    height:132px;
    z-index: 10;
}

#header-contenu{
    position: sticky;
    top: 0;
    transition: height 0.3s ease-in-out;
}

#header-contenu.scrolled{
    height: 95px;
}

#header-contenu.scrolled .logo-link{
    width: 80px;
    height: 80px;
}

#header-contenu.scrolled h1{
    text-wrap-mode: nowrap;
    font-size: 20px;
    align-self: center;
}

#header-contenu.scrolled h1 span#nom-boug{
    font-family: Cinzel, serif;
    font-size: 20px;
}

#header-contenu.scrolled br{
    display: none;
}

/*logos (Othonè + boussole)*/
.header-logos{
    grid-column: 3;
    grid-row-start: 1;
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-right: 45px;
}

.othone-link img{
    display: block;
    height: 70px;
    width: auto;
}

#header-contenu.scrolled .othone-link img{
    height: 50px;
}

.logo-link{
    width: 115px;
    height: 115px;
    overflow: hidden;
    margin: 0;
    z-index: 5;
    transform: rotate(11deg);
}

.logo-link a img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1{
    grid-column: 2;
    grid-row-start: 1;
    justify-self: center;
    width: 100%;
    text-align: center;
    margin: 0;
    font-family: "Cinzel", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    color: #F8F7F2 ;
}

#nom-boug{
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-style: normal;
}

/*Le menu tiroir*/
#menu-toggle{
    font-family: "Cinzel", serif;
    font-size: 18px;
    background: var(--color1); 
    color: #F8F7F2 ; 
    border-radius: 5px;
    height: 55px;
    width: 90px;
    margin-left: 20px;
    grid-column: 1;
    grid-row-start: 1;
    align-self: center;
    cursor: pointer;    
}

#menuClose{
    font-size: 20px;
    background: var(--color1); 
    color: #F8F7F2 ; 
    border-radius: 5px;
    height: 55px;
    width: 90px;
    justify-self: start;
    margin-left: 10px;
    position: fixed;
    margin-top: 10px;
    cursor: pointer;
    z-index: 1100;    
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background-color: var(--color1); 
    color: #F8F7F2 ; 
    transition: transform 0.4s ease-in-out;
    transform: translateX(-100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 60px 20px;
}


.menu-overlay.active {
    transform: translateX(0);
}

nav li {
    margin: 10px 0;
}

.nav-link {
    text-decoration: none;
    font-family: "Cinzel", serif;
    color: #F8F7F2;
    font-size: 25px;
}

.is-active{
    font-weight: bold;
    text-decoration: underline;
}

nav a:hover {
    text-decoration: none;
    background: #ad7e5f;
    color: #4d3c31;
}

nav a:focus-visible{
    border: 1px solid gray;
}

nav {
margin-top: 80px;
}

/*contenu page accueil*/
.map-container{
    position: relative;
    width: 100%;
    height: 100vh; 
    overflow: hidden;
}

.carte{
    width: 100%;
    height: 100%;
}

/*interraction sur la carte*/
.ville-link .trace-link{
    cursor: pointer;
}

.ville-link path{
    transition : transform  0.25s ease, fill 0.25s ease;
    fill:#394f69;
    fill-rule:nonzero;
    transform-box: fill-box;
    transform-origin: center;
}

.ville-link:hover path{
    transform: scale(2.5);
    fill:#ad7e5f
}

.trace-link path{
    transition : transform  0.25s ease, fill 0.25s ease;
    fill:none;
    fill-rule:nonzero;
    stroke:#394f69;
    stroke-width:16.67px;
    transform-box: fill-box;  
    transform-origin: center;
}

.trace-link:hover path{
    stroke:#ad7e5f;
}

/*Encadrés d'aperçus des villes*/
.encadre{
    width: 490px;
    height: 490px;
    border: 1px solid #4d3c31;
    border-radius: 10px;
    margin: 20px auto;
    padding: 10px;
    text-align: center;
    background-color: #F8F7F2 ;
    position: absolute;
    z-index: 100;
    top: 30%;
    right: 8rem;
    transition : opacity 0.1s ease;
    opacity: 0;
}

#encadre-projet{
    opacity: 1;
    z-index: 99;
}

.encadre.visible{
    opacity:1;
    visibility: visible;
    transform: translateY(0);
}

.container{
    position: relative;
}

figure{
    width: 400px;
    height: 200px;
    justify-self: center;
    overflow: hidden;
    margin: 0;
}

.encadre__preview-image{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.encadre p{
    font-size: 12px;
}

/*contenu page texte*/
.container-contenu{
    width: 65%;
    margin: 0 auto;
    margin-top: 10px;
    padding: 30px;
    background-color: #F8F7F2;
    border-radius: 10px;
}

.main_text{
    padding:50px;
}

h2.main{
    text-align: center;
    font-family: "Cinzel", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 30px;
}
h2{
    text-align: center;
    font-family: "Cinzel", serif;
    font-weight: 400;
    font-style: normal;
}

h2.titre-ville{
    display:none;
}

h3{
    font-family: "Cinzel", serif;
    font-weight: 500;
    font-style: normal; 
}

p{
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 16px;
    text-align: justify;
    line-height: 1.6;
}

.langue{
    font-style: italic;   
}

p.langue{
    text-align: center;
}

/*gestion des notes*/
.note-reference{
    text-decoration: underline dashed #ad7e5f;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: help;
    position: relative;
}

.note-reference .info-note{
    opacity: 0;
    transition: opacity 0.2s;
    position:absolute;
    top: 25px;
    left: 30%;
    width: 250px;
    height: fit-content; 
    padding: 10px;
    border-radius: 5px;
    border: 1px solid;
    border-color: rgb(237 235 221);
    background-color: rgb(237 235 221);
    z-index: -1;
    text-align: start;
}

.note-reference:hover .info-note{
    opacity: 1;
    z-index: 1;
}

/*navigation secondaire dates*/
.scroll{
    position : fixed;
    right: 1%;
    top: 58%;
    transform: translateY(-50%);
    height:470px;
    width: 172px;
    z-index: 9999;
    user-select: none;
    background-color: var(--color2);
    opacity: 1;
    border: 1px solid var(--color1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    isolation: isolate;
    border-radius: 5px;
    box-sizing: border-box;
    padding: 10px;
}

.scroll__track{
    width: 74px;
    height: 450px;
    position: absolute;
    top: 10px;
    left: 10px;
    overflow: visible;
}

.scroll__track-line{
    stroke: var(--color1);
    stroke-width: 1px;
}

.scroll__btn {
  cursor: pointer;
}

.scroll__btn-circle {
  fill:transparent;
  stroke: var(--color1);
  stroke-width:1px;
}

.scroll__btn-arrow {
  fill:none;
  stroke: var(--color1);
  stroke-width:1px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll__btn:hover .scroll__btn-circle{
  fill: #f5f2eb;
}

#scroll-cursor {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  cursor: grab;
  pointer-events: all;
}

#scroll-cursor-circle{
    fill: var(--color2);
    stroke: var(--color1);
    stroke-width:1px;
}

.scroll__path {
  position: absolute;
  top: 10px;                  
  left: 84px;
  height:fit-content;
  line-height:var(--item-height);
  pointer-events: none;
}


.scroll__date{
    list-style: none;
    margin: 0;
    padding: 0;
}

.scroll__date-item{
    margin: 0;
    display:none;
    font-size: 14px;
    color: var(--color1);
    flex-direction: column;
    justify-content: center;
}

.scroll__date-item--active{
    display:flex;
}

.scroll__date-title{
    font-size:12px;
    white-space: normal;
}

/*villes en cours*/
.encadre--en-cours{
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.encadre p.en-cours{
    font-family: "Cinzel", serif;
    font-size: 18px;
    text-align: center;
    color: var(--color3);
}

/*page à propos : équipe*/
p.equipe{
    text-align: center;
    margin: 0.3em 0;
    font-size: 18px;
    font-weight: 400;
}

/*pied de page*/
.pied-de-page{
    margin-top: 60px;
    padding: 25px 20px;
    background-color: var(--color1);
    color: var(--color2);
    text-align: center;
    position: relative;
    z-index: 10;
}

.pied-de-page p{
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: var(--color2);
}

.pied-titre{
    font-family: "Cinzel", serif;
}

.pied-de-page a{
    color: var(--color2);
}

.pied-de-page a:hover{
    color: var(--color3);
}

body.accueil .pied-de-page{
    margin-top: 0;
}

/*trajets en cours : pas de lien ni de survol*/
.trace-link--en-cours{
    cursor: default;
}

.trace-link--en-cours:hover path{
    stroke: #394f69;
}

/*encadrés de la carte : centrés verticalement sous l'en-tête (172px)*/
.encadre{
    margin: 0;
    top: calc(86px + 50vh);
    transform: translateY(-50%);
    max-height: calc(100vh - 172px - 60px);
    overflow-y: auto;
}

.encadre.visible{
    transform: translateY(-50%);
}

#encadre-projet{
    height: auto;
}

/*en-tête au-dessus des encadrés de la carte (z-index 100)*/
header{
    z-index: 200;
}

/*menu : rubrique en cours*/
.nav-link--en-cours{
    opacity: 0.6;
    cursor: default;
}

.nav-link--en-cours small{
    font-size: 14px;
}

/*lectures incertaines et passages non transcrits*/
.inconnu::before{
    content: "[";
}

.inconnu::after{
    content: "]";
}

/*itinéraires, distances, légendes des planches, signe « R. »*/
p.distance{
    text-align: right;
    color: #6b625a;
    font-size: 14px;
}
p.bloc{
    text-align: left;
    font-style: italic;
    margin-left: 2em;
}
p.legende{
    text-align: center;
    font-size: 14px;
    color: #4d3c31;
}
p.figure{
    text-align: center;
    color: #6b625a;
}
.itineraire p{
    text-align: left;
}
.signe-remarque{
    float: left;
    margin-left: -2.6em;
    font-family: "Cinzel", serif;
    color: #ad7e5f;
    font-size: 14px;
}
.renvoi-illustration{
    color: #ad7e5f;
    text-decoration: none;
    margin-left: 4px;
    font-size: 13px;
}

/*planches du manuscrit dans le texte : bulles en marge (planches.js)*/
.main_text{
    position: relative;
}
.mention .nom{
    cursor: pointer;
}
.mention .figure{
    position: absolute;
    left: -235px;
    width: 190px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: right;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    line-height: 1.3;
    font-style: normal;
    color: #6b625a;
    background: #F8F7F2;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.mention .figure .texte b{
    display: block;
    font-family: "Cinzel", serif;
    font-weight: 400;
    font-size: 13px;
    color: #4d3c31;
    margin-bottom: 2px;
}
.mention .pile{
    flex: none;
    display: flex;
}
.mention .pile img{
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #F8F7F2;
    box-shadow: 0 0 0 1px #ad7e5f;
}
.mention .pile img + img{
    margin-left: -24px;
}
.mention:hover .pile img, .mention .figure:focus .pile img{
    box-shadow: 0 0 0 2px #ad7e5f;
}
.mention .figure:focus-visible{
    outline: 2px solid #ad7e5f;
}
.repere, .trait{
    position: absolute;
    background: #4d3c31;
    pointer-events: none;
}
.repere{
    width: 3px;
    border-radius: 2px;
}
.trait{
    height: 2px;
    transform-origin: 0 50%;
    opacity: 0.75;
}
.mention:hover .trait, .mention:hover .repere{
    opacity: 1;
    background: #2b2420;
}
figure.planche{
    width: auto;
    height: auto;
    overflow: visible;
    margin: 30px auto;
    text-align: center;
}
figure.planche img{
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
figure.planche figcaption{
    font-size: 14px;
    color: #6b625a;
    margin-top: 8px;
}
figure.planche figcaption b{
    display: block;
    font-family: "Cinzel", serif;
    font-weight: 400;
    color: #4d3c31;
}
#planche-grande{
    border: none;
    padding: 0;
    background: #2b2420;
    color: #efe6d6;
    border-radius: 10px;
    width: min(1100px, 94vw);
    max-height: 94vh;
    overflow: auto;
}
#planche-grande::backdrop{
    background: rgba(20, 15, 10, 0.82);
}
#planche-grande .contenu-grand{
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
}
#planche-grande img{
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
}
#planche-grande .legende b{
    display: block;
    font-family: "Cinzel", serif;
    font-weight: 400;
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
}
#planche-grande .legende span{
    display: block;
    margin-bottom: 8px;
}
#planche-grande .legende .ecart{
    background: #5a4a2e;
    color: #f6e7b8;
    padding: 6px 9px;
    border-radius: 4px;
}
#planche-grande .liens a{
    color: #e0b48f;
    margin-right: 16px;
}
#planche-grande .autres{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
#planche-grande .autres button{
    border: 2px solid transparent;
    background: none;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
}
#planche-grande .autres button.actif{
    border-color: #ad7e5f;
    opacity: 1;
}
#planche-grande .autres img{
    height: 64px;
    width: auto;
}
#planche-grande .fermer{
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #efe6d6;
    font-size: 28px;
    cursor: pointer;
}
@media (max-width: 1250px){
    .mention .figure{
        position: static;
        display: inline-flex;
        width: auto;
        padding: 0;
        background: none;
        box-shadow: none;
        vertical-align: middle;
        margin-right: 4px;
    }
    .mention .figure .texte{
        display: none;
    }
    .mention .pile img{
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    .mention .pile img + img{
        margin-left: -12px;
    }
    .repere, .trait{
        display: none;
    }
    #planche-grande .contenu-grand{
        grid-template-columns: 1fr;
    }
}

/*le manuscrit (manuscrit.js) et les planches*/
.container-contenu.manuscrit{
    width: 90%;
}
.chapeau{
    text-align: center;
    color: #6b625a;
    max-width: 80ch;
    margin: 0 auto 20px;
}
.visionneuse nav.photos{
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 6px 0 10px;
    font-size: 12px;
}
.visionneuse nav.photos a{
    flex: none;
    padding: 2px 6px;
    border-radius: 4px;
    color: #4d3c31;
    text-decoration: none;
    border: 1px solid #e0d6c6;
}
.visionneuse nav.photos a.actif{
    background: #ad7e5f;
    border-color: #ad7e5f;
    color: #F8F7F2;
}
.visionneuse .commandes{
    display: none;
}
.visionneuse.active .commandes{
    display: flex;
    justify-content: center;
    gap: 12px;
}
.visionneuse .commandes button{
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ad7e5f;
    background: #F8F7F2;
    color: #4d3c31;
    cursor: pointer;
}
.visionneuse section.photo{
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid #e0d6c6;
}
.visionneuse.active section.photo{
    display: none;
}
.visionneuse.active section.photo.visible{
    display: grid;
}
.visionneuse figure{
    width: auto;
    height: auto;
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #2b2420;
    cursor: grab;
    touch-action: none;
    align-self: start;
    position: sticky;
    top: 120px;
}
.visionneuse figure img{
    width: 100%;
    display: block;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
}
.visionneuse .transcription{
    font-size: 15px;
    line-height: 1.55;
    max-height: 80vh;
    overflow-y: auto;
}
.visionneuse .transcription h3{
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6b625a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}
.visionneuse .page + .page{
    border-top: 1px dashed #e0d6c6;
    margin-top: 16px;
    padding-top: 12px;
}
.visionneuse .transcription p{
    text-align: left;
    margin: 0 0 10px;
}
.visionneuse .titre{
    font-weight: bold;
    color: #4d3c31;
}
.visionneuse .marge{
    display: block;
    font-size: 13px;
    color: #ad7e5f;
    font-style: italic;
}
.visionneuse .incertain{
    background: #f6e7b8;
}
.visionneuse .ajout{
    vertical-align: super;
    font-size: 12px;
    color: #2f6b3a;
}
.visionneuse del{
    color: #a0522d;
}
.visionneuse abbr{
    text-decoration: underline dotted;
    cursor: help;
}
.visionneuse .description, .visionneuse .vide{
    color: #6b625a;
    font-style: italic;
}
.galerie{
    display: grid;
    gap: 24px;
    margin: 20px 0 40px;
}
.fiche-planche{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 24px;
    align-items: start;
}
.fiche-planche img{
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.fiche-planche h3{
    margin-top: 0;
}
.fiche-planche .folio, .fiche-planche .dans-le-texte{
    font-size: 13px;
    color: #6b625a;
}
.fiche-planche .dans-le-texte{
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.fiche-planche ul{
    margin-top: 0;
    padding-left: 18px;
    font-size: 14px;
}
.fiche-planche .ecart{
    background: #f6e7b8;
    padding: 6px 9px;
    border-radius: 4px;
    font-size: 14px;
}
.fiche-planche .legende{
    text-align: left;
}
@media (max-width: 900px){
    .visionneuse section.photo, .visionneuse.active section.photo.visible, .fiche-planche{
        grid-template-columns: 1fr;
    }
    .visionneuse figure{
        position: static;
    }
}

/*planches sur la carte : miniature reliée à la ville par un trait*/
.planche-carte line{
    stroke: #b4733f;
    stroke-width: 9;
}
.planche-carte circle.fond{
    fill: #F8F7F2;
    stroke: #b4733f;
    stroke-width: 6;
}
.planche-carte:hover line{
    stroke: #4d3c31;
}
.planche-carte:hover circle.fond{
    stroke: #4d3c31;
}

/*la carte d'abord : trajets, villes et planches n'apparaissent qu'une fois l'image chargée (doc-jav.js)*/
.js .carte .calque{
    opacity: 0;
    transition: opacity 0.6s ease;
}
.js .carte.prete .calque{
    opacity: 1;
}
.js .carte.prete #point-ville{
    transition-delay: 0.25s;
}
.js .carte.prete #planches-carte{
    transition-delay: 0.6s;
}
@media (prefers-reduced-motion: reduce){
    .js .carte .calque{
        transition: none;
    }
}
