* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: Georgia, "Times New Roman", serif; color: #2b2620; background: #f4efe6; }
body { display: grid; grid-template-rows: auto 1fr auto; }
a { color: #8b2e1f; }

.barre { display: flex; align-items: center; gap: .8rem; padding: .45rem 1rem; background: #2f3a4a; color: #f4efe6; }
.barre .fleur { font-size: 1.6rem; color: #e2c27a; line-height: 1; }
.barre h1 { font-family: "IM Fell English SC", Georgia, serif; font-weight: normal; font-size: 1.25rem; margin: 0; letter-spacing: .03em; }
.barre h1 span { display: block; font-family: "IM Fell English", Georgia, serif; font-style: italic; font-size: .8rem; opacity: .8; letter-spacing: 0; }
.credit { margin: 0 0 0 auto; font-size: .75rem; opacity: .7; }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.logo-uqam { height: 1.3em; vertical-align: -.35em; margin-left: .3em; }
.lien-salle { background: transparent; color: #f4efe6; border: 1px solid #8796ab; border-radius: 3px; padding: .2rem .6rem; font: inherit; font-size: .85rem; cursor: pointer; }
.lien-salle:hover { background: #46546a; }

.contenu { display: grid; grid-template-columns: 250px 1fr 370px; min-height: 0; }
#carte { min-height: 0; }
#outils { overflow-y: auto; padding: .7rem .8rem; background: #efe8da; border-right: 1px solid #d6cbb8; font-size: .85rem; }
.bloc { margin-bottom: .7rem; border-bottom: 1px solid #ddd1bc; padding-bottom: .5rem; }
.titre-bloc { display: block; font-family: "IM Fell English SC", Georgia, serif; font-size: 1rem; cursor: pointer; margin-bottom: .3rem; color: #3b3328; }
#outils label { display: block; margin: .15rem 0; cursor: pointer; }
#outils input[type=search] { width: 100%; padding: .3rem .4rem; border: 1px solid #b9ab92; border-radius: 3px; font: inherit; background: #fffdf8; }
.mini { font-size: .75rem; color: #6b604f; }
.compteur { font-size: .8rem; color: #6b604f; font-style: italic; }
.puce { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .35em; vertical-align: -.05em; border: 1.5px solid #3b3328; }
.puce.carre { border-radius: 2px; }
.liste-pers { list-style: none; padding: 0; margin: .4rem 0 0; max-height: 300px; overflow-y: auto; }
.liste-pers li { padding: .12rem .2rem; cursor: pointer; display: flex; justify-content: space-between; gap: .4rem; }
.liste-pers li:hover, .liste-pers li.actif { background: #e2d5bc; }
.liste-pers li span { color: #6b604f; font-size: .75rem; }
.filtre-actif { background: #f3e3c3; border-left: 3px solid #c8903e; padding: .3rem .5rem; margin-bottom: .6rem; font-size: .8rem; }

#panneau { overflow-y: auto; padding: 1rem 1.25rem; border-left: 1px solid #d6cbb8; background: #faf7f1; }
#panneau h2 { font-family: "IM Fell English", Georgia, serif; font-size: 1.3rem; margin: 0 0 .4rem; line-height: 1.2; }
#panneau .filet { text-align: center; color: #c8903e; margin: .3rem 0 .8rem; }
#panneau .meta { font-size: .85rem; color: #6b604f; margin: .2rem 0; }
#panneau .description { line-height: 1.5; }
#panneau .sources { font-size: .8rem; border-top: 1px solid #d6cbb8; margin-top: 1rem; padding-top: .5rem; color: #4a4236; }
#panneau figure { margin: .6rem 0; }
#panneau figure img { max-width: 100%; border: 1px solid #d6cbb8; cursor: zoom-in; }
#panneau figcaption { font-size: .75rem; color: #6b604f; }
.note { font-size: .85rem; background: #efe9dd; border-left: 3px solid #c8903e; padding: .4rem .6rem; margin-top: .8rem; }
.avertissement { font-size: .8rem; background: #f3e3c3; padding: .5rem; border-radius: 3px; }
.badge { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 3px; background: #e6dccb; margin: 0 .25rem .25rem 0; font-family: system-ui, sans-serif; }
.badge.certaine { background: #cfe3c8; }
.badge.approximative { background: #f3e3c3; }
.badge.hypothetique { background: #f0cfc8; }
.badge.Cragin { background: #d9e2ef; }
.badge.Aubry { background: #f1d6cf; }
.pers { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0; }
.pers button { font: inherit; font-size: .78rem; background: #fff; border: 1px solid #c9bba3; border-radius: 10px; padding: .05rem .5rem; cursor: pointer; }
.pers button:hover { background: #f3e3c3; }
.liste-fiches { list-style: none; padding: 0; }
.liste-fiches li { padding: .4rem .3rem; border-bottom: 1px dotted #d6cbb8; cursor: pointer; }
.liste-fiches li:hover { background: #f3ecdf; }
.liste-fiches .d { font-size: .75rem; color: #6b604f; }
.retour { font-size: .8rem; cursor: pointer; color: #8b2e1f; background: none; border: 0; padding: 0; margin-bottom: .5rem; }

.timeline { display: flex; align-items: center; gap: .9rem; padding: .5rem 1rem; background: #2f3a4a; color: #f4efe6; }
.timeline button { background: #c8903e; border: 0; color: #fff; width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; flex: none; }
.curseurs { flex: 1; position: relative; padding-bottom: 1.2rem; }
.double { position: relative; height: 18px; }
.double input[type=range] { position: absolute; left: 0; top: 0; width: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; height: 18px; }
.double input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #8796ab; border-radius: 2px; }
.double input[type=range]::-moz-range-track { height: 4px; background: #8796ab; border-radius: 2px; }
.double input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #c8903e; border: 2px solid #f4efe6; cursor: pointer; }
.double input[type=range]::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: #c8903e; border: 2px solid #f4efe6; cursor: pointer; }
#graduation { position: absolute; left: 8px; right: 8px; top: 18px; height: 1.1rem; }
#graduation span { position: absolute; transform: translateX(-50%); font-size: .68rem; color: #d6dbe3; font-family: system-ui, sans-serif; }
#graduation span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: #aab3c2; }
#graduation .histo { position: absolute; bottom: 1.25rem; width: 3px; background: #e2c27a; opacity: .6; transform: translateX(-50%); }
#periode { min-width: 8rem; font-weight: bold; font-family: "IM Fell English", Georgia, serif; font-size: 1.05rem; }
.timeline .mini { color: #d6dbe3; }

dialog { max-width: 640px; border: 1px solid #b9ab92; border-radius: 6px; background: #faf7f1; color: #2b2620; line-height: 1.45; }
dialog h2 { font-family: "IM Fell English SC", Georgia, serif; margin-top: 0; }
dialog::backdrop { background: rgba(30, 30, 40, .45); }
.btn { background: #2f3a4a; color: #fff; border: 0; border-radius: 3px; padding: .35rem .9rem; cursor: pointer; font: inherit; }
#zoom-img { max-width: 92vw; max-height: 92vh; padding: 0; }
#zoom-img img { display: block; max-width: 92vw; max-height: 88vh; }

.maplibregl-popup-content { font-family: Georgia, serif; font-size: .82rem; padding: .4rem .6rem; background: #faf7f1; }

@media (max-width: 1000px) {
  .contenu { grid-template-columns: 1fr; grid-template-rows: 45vh auto auto; }
  #outils { order: 2; border-right: 0; }
  #carte { order: 1; }
  #panneau { order: 3; border-left: 0; border-top: 1px solid #d6cbb8; }
  .credit { display: none; }
  body { grid-template-rows: auto 1fr auto; }
}

.salle-leduc { border-color: #00a8e8; color: #bfe9fb; text-decoration: none; }
#graduation span.mineur::before { height: 3px; opacity: .6; }
.bande-leduc { position: absolute; top: -13px; height: 5px; background: #00a8e8; border-radius: 3px; opacity: .9; }
.bande-leduc:hover { height: 7px; top: -14px; }
.badge.Recherches { background: #d3ead5; }
.badge.Hafen { background: #f3e6c2; }

/* Accueil du réseau Atlas de l'Amérique française */
.barre h1 a { color: inherit; text-decoration: none; }
.barre h1 a:hover { text-decoration: underline; }
.chapeau-accueil { font-style: italic; }
.titre-reseau { font-family: "IM Fell English SC", Georgia, serif; font-weight: normal; color: #8b2e1f; font-size: 1.05rem; margin: 1.1rem 0 .4rem; }
.atlas-carte { background: #fffdf8; border: 1px solid #d6cbb8; border-left: 5px solid var(--c); padding: .6rem .8rem .55rem; margin: .55rem 0; border-radius: 3px; }
.atlas-carte h4 { font-family: "IM Fell English", Georgia, serif; font-weight: normal; font-size: 1.12rem; margin: 0; }
.atlas-carte h4 a { color: #2b2620; text-decoration: none; }
.atlas-carte h4 a:hover { text-decoration: underline; }
.atlas-carte .sous { font-family: "IM Fell English SC", Georgia, serif; color: var(--c); font-size: .9rem; margin: 0 0 .2rem; }
.atlas-carte p { margin: .2rem 0; font-size: .86rem; line-height: 1.45; }
.atlas-carte .pages a { display: inline-block; font-size: .8rem; margin: .1rem .55rem .1rem 0; }
.atlas-carte .etiq { display: inline-block; font-size: .68rem; padding: 0 .4rem; border-radius: 2px; background: var(--c); color: #fff; vertical-align: middle; margin-left: .35rem; font-family: Georgia, serif; }
.atlas-carte .etiq.prep { background: #c8903e; }
.atlas-carte.prep { border-style: dashed; border-left-style: solid; }

/* Filtres repliables : flèche sur les blocs et arborescence des corpus */
.titre-bloc { list-style: none; }
.titre-bloc::-webkit-details-marker, .groupe > summary::-webkit-details-marker { display: none; }
summary.titre-bloc::before { content: "▸"; display: inline-block; width: 1em; color: #8b2e1f; transition: transform .15s; }
details[open] > .titre-bloc::before { transform: rotate(90deg); }
.groupe { margin: .1rem 0; }
.groupe > summary { list-style: none; cursor: pointer; padding: .12rem 0; display: flex; align-items: center; gap: .3rem; }
.groupe > summary::before { content: "▸"; color: #8b2e1f; font-size: .8em; width: .8em; transition: transform .15s; }
.groupe[open] > summary::before { transform: rotate(90deg); }
.groupe > summary input { margin: 0; }
.groupe-corps { padding-left: 1.35rem; border-left: 1px dotted #c9bba3; margin-left: .35rem; }
.groupe-corps label { font-size: .82rem; }

/* Atlas du réseau : liste repliable */
details.atlas-carte { padding: .35rem .7rem; }
details.atlas-carte > summary { list-style: none; cursor: pointer; font-family: "IM Fell English", Georgia, serif; font-size: 1.05rem; }
details.atlas-carte > summary::-webkit-details-marker { display: none; }
details.atlas-carte > summary::before { content: "▸"; display: inline-block; width: 1em; color: var(--c); transition: transform .15s; }
details.atlas-carte[open] > summary::before { transform: rotate(90deg); }
details.atlas-carte[open] > summary { margin-bottom: .25rem; }
details.atlas-carte .ouvrir-atlas { display: inline-block; padding: .15rem .6rem; background: var(--c); color: #fff; text-decoration: none; border-radius: 3px; font-size: .82rem; }

/* Accueil : sections repliables */
details.section-accueil > summary { list-style: none; cursor: pointer; }
details.section-accueil > summary::-webkit-details-marker { display: none; }
details.section-accueil > summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform .15s; }
details.section-accueil[open] > summary::before { transform: rotate(90deg); }

/* Liste des fiches d'un lieu */
.filtre-lieu { width: 100%; box-sizing: border-box; padding: .4em .6em; margin: .3em 0 .6em; border: 1px solid #cdbf9f; border-radius: 4px; font: inherit; }
details.decennie { margin: .2em 0; }
details.decennie > summary { cursor: pointer; font-weight: 600; color: #5a4a2f; padding: .2em 0; border-bottom: 1px solid #e6dcc6; list-style: none; }
details.decennie > summary::before { content: '▸ '; color: #b8902e; }
details.decennie[open] > summary::before { content: '▾ '; }
