/* Domaine du Mons — feuille unique. Aucune dépendance, aucune police distante. */

:root {
  --papier: #ffffff;
  --encre: #1a1915;
  --douce: #5b5749;
  --trait: #e2dfd4;
  --accent: #5c6b4a;
  --surface: #f6f5f0;
  --calme: #0b7f4e;
  --vigilance: #bb9008;
  --alerte: #d94d08;
  --trace: #5c6b4a;
  --grille: #ebe8df;
  --mesure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #14130e;
    --encre: #e8e2d2;
    --douce: #9d9682;
    --trait: #302c23;
    --accent: #9cb388;
    --surface: #1c1a14;
    --calme: #17a183;
    --vigilance: #b0921f;
    --alerte: #e3536f;
    --trace: #9cb388;
    --grille: #282419;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 1rem/1.5 Georgia, "Iowan Old Style", "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

.bandeau-contenu, main, footer > div { max-width: var(--mesure); margin-inline: auto; }
main { padding: 0 1.1rem 1rem; }

/* ---------------------------------------------------- bandeau rétractable */

.bandeau {
  position: sticky; top: 0; z-index: 20;
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
  transition: transform .22s ease;
}
.bandeau.replie { transform: translateY(-100%); }

.bandeau-contenu {
  display: flex; align-items: baseline; gap: .1rem 1rem;
  flex-wrap: wrap;
  padding: .55rem 1.1rem .5rem;
}

.titre { font-size: 1.05rem; font-weight: 600; margin: 0; letter-spacing: -.005em; white-space: nowrap; }
.titre a { text-decoration: none; color: inherit; }
.sous-titre { margin: 0; font-size: .8rem; font-style: italic; color: var(--douce); }

nav { margin-left: auto; font-size: .875rem; }
nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem .9rem; align-items: center; }
nav > ul > li { margin: 0; position: relative; }
nav a, nav button {
  color: inherit; text-decoration: none; background: none; border: 0;
  font: inherit; cursor: pointer; padding: .15rem 0; display: inline-block;
  border-bottom: 1px solid transparent;
}
nav a:hover, nav button:hover { border-bottom-color: var(--encre); }
nav [aria-current="page"] { border-bottom: 1.5px solid var(--accent); }
nav .chevron { padding: .15rem .15rem .15rem .1rem; line-height: 1; opacity: .55; }
nav .chevron:hover, nav .chevron[aria-expanded="true"] { opacity: 1; border-bottom-color: transparent; }
.menu-deroulant { display: inline-flex; align-items: baseline; gap: .05rem; }

.sous-menu {
  position: absolute; top: calc(100% + .45rem); right: 0; z-index: 10;
  min-width: 13rem; margin: 0; padding: .35rem 0; list-style: none;
  background: var(--papier); border: 1px solid var(--trait);
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
}
/* pont invisible : la souris peut descendre du titre au menu sans le fermer */
.sous-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.65rem; height: .65rem; }
.sous-menu[hidden] { display: none; }
.sous-menu li { margin: 0; }
.sous-menu a { display: block; padding: .32rem .8rem; border: 0; white-space: nowrap; }
.sous-menu a:hover { background: var(--surface); border: 0; }
.sous-menu hr { border: 0; border-top: 1px solid var(--trait); margin: .35rem 0; }
.sous-menu .groupe {
  padding: .5rem .8rem .12rem; font-size: .74rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--douce);
}
.sous-menu .groupe:first-child { padding-top: .15rem; }

@media (max-width: 34rem) {
  .bandeau-contenu { padding-bottom: .45rem; }
  .sous-titre { flex-basis: 100%; }
  nav { margin-left: 0; flex-basis: 100%; margin-top: .3rem; }
  nav > ul { gap: .2rem .8rem; }
  .sous-menu { right: auto; left: 0; }
}

/* ------------------------------------------------------------- le contenu */

main { padding-top: 1.6rem; }

h2 {
  font-size: 1.1rem; line-height: 1.25; font-weight: 600;
  margin: 2.1rem 0 .55rem;
}
h2 + p, h2 + div, h2 + ul { margin-top: 0; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 .3rem; }
h4 { font-size: .92rem; font-weight: 600; margin: 1.2rem 0 .3rem; }
.nb { color: var(--douce); font-size: .88em; }

p, ul, ol { margin: 0 0 .85rem; }
ul, ol { padding-left: 1.1rem; }
li { margin-bottom: .25rem; }

a { color: inherit; text-underline-offset: .14em; text-decoration-thickness: .5px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chapeau { font-size: 1.1rem; line-height: 1.42; margin-bottom: 1.4rem; }
.retour { font-size: .85rem; color: var(--douce); margin-bottom: 1rem; }

/* filet dessiné, en place des bordures */
.filet-croquis { display: block; width: 100%; height: .6rem; margin: 1.9rem 0 1.5rem; opacity: .5; }

/* ------------------------------------------------------------- les dessins */

.croquis { display: block; width: 100%; height: auto; margin: .3rem 0 .4rem; }
.trait-croquis { fill: none; stroke: var(--encre); stroke-width: 1.15; stroke-linecap: round; opacity: .78; }
.texte-croquis text { fill: var(--encre); font-family: Georgia, serif; font-size: 13.5px; opacity: .8; }
.texte-croquis .fort { font-size: 17px; opacity: 1; }
.texte-croquis .sur { font-size: 11.5px; font-style: italic; opacity: .62; }
.texte-croquis .petit { font-size: 12px; font-style: italic; opacity: .72; }

figure { margin: 1.2rem 0 1.6rem; }
figcaption { font-size: .85rem; color: var(--douce); font-style: italic; margin-top: .1rem; }

/* ------------------------------------------------------------- l'encadré */

.note {
  border-left: 2px solid var(--accent);
  padding: .1rem 0 .1rem .8rem;
  margin: 1.1rem 0 1.3rem;
  font-size: .925rem;
}
.note p:last-child { margin-bottom: 0; }
.note .etiquette { display: block; font-size: .8rem; font-style: italic; color: var(--douce); margin-bottom: .2rem; }

/* ------------------------------------------------------- listes d'états */

.etats { list-style: none; padding: 0; margin: 1rem 0 1.3rem; }
.etats li {
  display: grid; grid-template-columns: 5.4rem 1fr; gap: .1rem .9rem;
  padding: .55rem 0; border-top: 1px solid var(--trait); margin: 0;
}
.etats li:last-child { border-bottom: 1px solid var(--trait); }
.etat { font-size: .8rem; font-style: italic; color: var(--douce); padding-top: .12rem; }
@media (max-width: 30rem) { .etats li { grid-template-columns: 1fr; } .etat { padding-top: 0; } }

/* ------------------------------------------------------------- les tuiles */

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1px; margin: 1rem 0 1.4rem; }
.tuile { background: var(--papier); padding: .65rem .75rem .7rem; box-shadow: 0 0 0 1px var(--trait); }
.tuile .libelle { margin: 0 0 .25rem; font-size: .8rem; font-style: italic; color: var(--douce); }
.tuile .valeur { margin: 0 0 .15rem; font-size: 1.5rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tuile .valeur .unite { font-size: .8rem; color: var(--douce); font-variant-numeric: normal; }
.tuile .detail { margin: 0; font-size: .82rem; color: var(--douce); }
.tuile[data-etat="calme"] .valeur { color: var(--calme); }
.tuile[data-etat="vigilance"] .valeur { color: var(--vigilance); }
.tuile[data-etat="alerte"] .valeur { color: var(--alerte); }

.pastille { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .3rem; }
.pastille.calme { background: var(--calme); }
.pastille.vigilance { background: var(--vigilance); }
.pastille.alerte { background: var(--alerte); }

/* --------------------------------------------------------- les graphiques */

.graphe { margin: 1.1rem 0 1.6rem; }
.graphe h3 { margin: 0 0 .1rem; }
.graphe .legende-axe { font-size: .85rem; color: var(--douce); margin: 0 0 .5rem; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }

.grille-ligne { stroke: var(--grille); stroke-width: 1; }
.axe-texte { fill: var(--douce); font-size: 11px; font-family: Georgia, serif; }
.trace-ligne { fill: none; stroke: var(--trace); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.trace-bande { fill: var(--trace); opacity: .15; }
.trace-barre { fill: var(--trace); }
.trace-tendance { fill: none; stroke: var(--alerte); stroke-width: 1.8; stroke-dasharray: 5 4; }
.trace-reference { fill: var(--douce); opacity: .12; }
.trace-mediane { fill: none; stroke: var(--douce); stroke-width: 1.3; stroke-dasharray: 4 3; opacity: .7; }
.trace-zero { stroke: var(--douce); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
.curseur { stroke: var(--douce); stroke-width: 1; }
.point-actif { fill: var(--trace); stroke: var(--papier); stroke-width: 2; }

.legende { list-style: none; padding: 0; margin: 0 0 .7rem; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: .82rem; color: var(--douce); }
.legende li { margin: 0; display: flex; align-items: center; gap: .35rem; }
.legende .ech { width: 1.4rem; height: .6rem; display: inline-block; }
.legende .ech.ligne { height: 0; border-top: 1.8px solid var(--trace); }
.legende .ech.bande { background: var(--douce); opacity: .18; }
.legende .ech.mediane { height: 0; border-top: 1.3px dashed var(--douce); }

.infobulle {
  position: absolute; pointer-events: none; z-index: 30;
  background: var(--papier); border: 1px solid var(--trait);
  padding: .35rem .5rem; font-size: .82rem; line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); white-space: nowrap;
}
.infobulle strong { display: block; font-weight: 600; margin-bottom: .1rem; }
.enveloppe-graphe { position: relative; }

/* --------------------------------------------------------- les tableaux */

.donnees { width: 100%; border-collapse: collapse; font-size: .875rem; margin: .7rem 0 1rem; }
.donnees th, .donnees td { text-align: left; padding: .3rem .6rem .3rem 0; border-bottom: 1px solid var(--trait); }
.donnees th { font-weight: 600; font-size: .8rem; font-style: italic; color: var(--douce); }
.donnees td { font-variant-numeric: tabular-nums; }
.defilant { overflow-x: auto; }
details.tableau-brut { margin: .2rem 0 1.4rem; }
details.tableau-brut summary { cursor: pointer; font-size: .85rem; color: var(--douce); }

/* ------------------------------------------------------------ les cartes */

.cartes { list-style: none; padding: 0; margin: 1rem 0 1.3rem; }
.cartes li { border-top: 1px solid var(--trait); padding: .8rem 0; margin: 0; }
.cartes li:last-child { border-bottom: 1px solid var(--trait); }
.cartes h3 { margin: 0 0 .2rem; font-size: 1rem; }
.cartes h3 a { text-decoration: none; border-bottom: 1px solid var(--trait); }
.cartes h3 a:hover { border-bottom-color: var(--encre); }
.cartes p { margin: 0 0 .25rem; font-size: .925rem; }
.cartes .source { margin: 0; font-size: .82rem; color: var(--douce); font-style: italic; }
.cartes .bientot h3 { color: var(--douce); }

/* ------------------------------------------------------------------ états */

.chargement { color: var(--douce); font-style: italic; }
.echec { border-left: 2px solid var(--vigilance); padding-left: .7rem; font-size: .9rem; color: var(--douce); }
.horodatage { font-size: .8rem; color: var(--douce); font-style: italic; margin-top: 1.6rem; }

/* ----------------------------------------------------------------- le pied */

footer { border-top: 1px solid var(--trait); margin-top: 2.4rem; padding: .9rem 1.1rem 2.4rem; font-size: .85rem; color: var(--douce); }
footer p { margin: 0 0 .35rem; }
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }

h1 { font-size: 1.35rem; line-height: 1.2; font-weight: 600; margin: 0 0 .7rem; letter-spacing: -.008em; }
h1 + .chapeau { margin-top: -.25rem; }

/* ------------------------------------------------------------- les cartes */
.carte figure { margin: 0 0 1.1rem; }
.carte img {
  display: block; width: 100%; height: auto;
  box-shadow: 0 0 0 1px var(--trait); background: var(--surface);
}
.carte figcaption { margin-top: .4rem; font-size: .84rem; color: var(--douce); }
.legende-carte {
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none;
  padding: 0; margin: .5rem 0 0; font-size: .84rem;
}
.legende-carte li { display: flex; align-items: center; gap: .35rem; margin: 0; }
.pastille-carte {
  width: .8rem; height: .8rem; flex: none; border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.epoques { display: flex; gap: .4rem; margin: 0 0 .6rem; flex-wrap: wrap; }
.epoques button {
  font: inherit; font-size: .88rem; padding: .22rem .7rem; cursor: pointer;
  background: var(--papier); color: var(--encre);
  border: 1px solid var(--trait); border-radius: 2px;
}
.epoques button[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }

/* --------------------------------------------------- le condensé de tête */
.condense {
  margin: 0 0 1.7rem; padding: .8rem .95rem;
  background: var(--surface); box-shadow: inset 2px 0 0 var(--accent);
}
.condense ul { margin: 0; padding: 0; list-style: none; }
.condense li {
  margin: 0 0 .34rem; padding-left: .95rem; position: relative; line-height: 1.44;
}
.condense li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .45rem; height: 1px; background: var(--douce);
}
.condense li:last-child { margin-bottom: 0; }
.condense p { margin: 0; }
@media (max-width: 34rem) { .condense { font-size: .96rem; padding: .7rem .8rem; } }
