/* Page d'un territoire (décision 0138) : en-tête d'atlas, villes, dynasties, aperçus.
   Couleurs et polices de chrono.css seulement (clair et sombre). */
.page-territoire.fiche { display: grid; gap: 1.4rem; padding: 0; border: 0; background: none; }
.page-territoire > * { min-width: 0; }
.fil-sep { color: var(--discret); margin-inline: .25rem; }

.atlas-tete { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem;
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 18px; padding: 1.5rem 1.7rem; }
.atlas-tete.sans-carte { grid-template-columns: minmax(0, 1fr); }
.at-sur { margin: 0; font: 700 .72rem/1.3 var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--or); }
[dir="rtl"] .at-sur { letter-spacing: 0; font-size: .82rem; }
.at-sur a { color: inherit; }
.page-territoire .atlas-tete h1 { margin: .3rem 0 .5rem; font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.15 var(--titre); }
.at-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .8rem; }
.at-ar { font-size: 1.75rem; font-weight: 500; color: var(--or); }
.at-pays { margin: 0 0 1rem; font-size: .88rem; color: var(--discret); }
.at-pays a { color: var(--texte); }
.at-plus { white-space: nowrap; }
.compteurs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.compteur { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .8rem; border: 1px solid var(--ligne);
  border-radius: 12px; background: var(--panneau); text-decoration: none; min-width: 0; }
.compteur:hover { border-color: var(--or-vif); }
.compteur b { font: 700 1.5rem/1.1 var(--chiffres); color: var(--texte); }
.compteur span { font-size: .8rem; color: var(--discret); }
.at-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.bouton-at { display: inline-flex; align-items: center; min-height: 38px; padding: 0 1rem; border-radius: 10px;
  border: 1px solid var(--ligne); background: var(--carte); color: var(--texte); text-decoration: none; font-weight: 600; font-size: .9rem; }
.bouton-at.plein { background: var(--encre); color: var(--encre-texte); border-color: var(--encre); }

.at-carte { margin: 0; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.mini-carte { display: block; width: 100%; height: 320px; border-radius: 12px; border: 1px solid var(--ligne); }
.mc-mer { fill: var(--panneau); }
.mc-voisin { fill: var(--carte); stroke: var(--ligne); stroke-width: .25; }
.mc-region { fill: color-mix(in srgb, var(--or-vif) 34%, var(--carte)); stroke: var(--or); stroke-width: .3; }
.mc-rattache { fill: color-mix(in srgb, var(--or-vif) 14%, var(--carte)); stroke: var(--or); stroke-width: .3; stroke-dasharray: .9 .6; }
.mc-ville { fill: var(--texte); stroke: var(--carte); stroke-width: .35; }
.at-carte figcaption { font-size: .78rem; color: var(--discret); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-start: .5rem; }
.lg:first-child { margin-inline-start: 0; }
.lg-region { background: color-mix(in srgb, var(--or-vif) 34%, var(--carte)); border: 1px solid var(--or); }
.lg-rattache { background: color-mix(in srgb, var(--or-vif) 14%, var(--carte)); border: 1px dashed var(--or); }
.lg-ville { background: var(--texte); border-radius: 50%; width: 8px; height: 8px; }

.sommaire-territoire { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--ligne); border-radius: 13px;
  background: var(--panneau); width: fit-content; max-width: 100%; }
.sommaire-territoire a { padding: .35rem .9rem; border-radius: 9px; text-decoration: none; font-size: .88rem; font-weight: 600; color: var(--discret); }
.sommaire-territoire a:hover { background: var(--carte); color: var(--texte); }

.bloc-territoire, .page-territoire .religions, .page-territoire .population, .page-territoire .langues {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 16px; padding: 1.2rem 1.4rem; margin: 0; min-width: 0; }
.page-territoire .groupe-population { border: 0; padding: 0; background: none; }
.page-territoire.fiche section h2, .page-territoire.fiche .bt-tete h2 { margin: 0 0 .3rem; font: 700 1.3rem/1.2 var(--titre);
  letter-spacing: 0; text-transform: none; color: var(--texte); }
.bt-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.2rem; margin-bottom: .9rem; }
.bt-tete .note { margin: 0; font-size: .84rem; color: var(--discret); }
.page-territoire [id] { scroll-margin-top: 1rem; }

.grille-villes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.vignette-ville { display: grid; gap: .3rem; padding: .75rem .9rem; border: 1px solid var(--ligne); border-radius: 12px;
  background: var(--fond); text-decoration: none; color: var(--texte); min-width: 0; }
.vignette-ville:hover { border-color: var(--or-vif); }
.vignette-ville.ouverte { border-color: var(--or-vif); background: var(--doux); }
.vv-nom { font: 700 1.05rem/1.2 var(--titre); }
.vv-ar { font-size: .95rem; color: var(--or); overflow-wrap: anywhere; }
.vv-barre { height: 4px; border-radius: 2px; background: var(--ligne); overflow: hidden; }
.vv-barre i { display: block; height: 100%; background: var(--or-vif); }
.vv-pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .6rem; font-size: .78rem; color: var(--discret); }
.vv-pied b { font-family: var(--chiffres); color: var(--texte); }
.vv-lien { color: var(--texte); font-weight: 600; }
[dir="rtl"] .vv-lien span { display: inline-block; transform: scaleX(-1); }

.frise-dyn-cadre { overflow-x: auto; direction: ltr; }
/* Le temps va de gauche à droite dans toutes les langues, noms compris. */
.frise-dyn, .frise-dyn text { direction: ltr; }
.frise-dyn { display: block; width: 100%; min-width: 760px; height: auto; }
.fd-grille { stroke: var(--ligne); stroke-width: 1; }
.fd-axe { fill: var(--discret); font: 10px var(--chiffres); }
.fd-barre rect { fill: var(--or-vif); }
.fd-barre text { fill: var(--texte); font: 600 11px var(--corps); }
.fd-barre .fd-dates { fill: var(--discret); font: 400 9.5px var(--chiffres); }
.fd-barre text.fd-dedans, .fd-barre text.fd-dedans .fd-dates { fill: var(--encre-texte); }
.fd-barre:hover rect, .fd-barre:focus-visible rect { fill: var(--texte); }

.apercus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.apercu { min-width: 0; }
.apercu h3 { margin: 0 0 .5rem; font: 700 .76rem/1.3 var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--or); }
[dir="rtl"] .apercu h3 { letter-spacing: 0; font-size: .86rem; }
.apercu ol { list-style: none; margin: 0; padding: 0; }
.apercu li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .6rem; padding: .38rem 0; border-bottom: 1px solid var(--ligne); }
.apercu li a { font-weight: 600; }
.ap-date { font: .76rem var(--chiffres); color: var(--discret); text-align: end; white-space: nowrap; }
.ap-info { grid-column: 1 / -1; font-size: .78rem; color: var(--discret); }
.ap-tout { display: inline-block; margin-top: .6rem; font-size: .86rem; font-weight: 600; }
.apercu .note { color: var(--discret); font-size: .86rem; }

.duo-territoire { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.duo-territoire.seul { grid-template-columns: minmax(0, 1fr); }
.page-territoire .religions, .page-territoire .population { margin-top: 0; }
.page-territoire .langues { margin-top: 0; }

@media (max-width: 85rem) {
  .grille-villes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 64rem) {
  .atlas-tete, .duo-territoire, .apercus { grid-template-columns: minmax(0, 1fr); }
  .compteurs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini-carte { height: 240px; }
}
@media (max-width: 40rem) {
  .atlas-tete { padding: 1rem; gap: 1rem; }
  .grille-villes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compteurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bloc-territoire, .page-territoire .religions, .page-territoire .population, .page-territoire .langues { padding: 1rem; }
  .rel-ligne { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
}
@media (max-width: 24rem) {
  .grille-villes { grid-template-columns: minmax(0, 1fr); }
}
