/* Le monde en l'an X (J24, décision 0050). Mêmes variables que le site ; propriétés logiques pour l'arabe. */
.page-an { width: 100%; }
/* En-tête en une bande (décision 0141) : titre · sauts et repères · aller à l'année et liens. */
.tete-an { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem 2rem;
  padding: .7rem 1rem; margin: .4rem 0 .7rem; border: 1px solid var(--ligne); border-radius: 10px; background: var(--carte); }
.tete-an h1 { margin: 0; font-size: 2rem; line-height: 1.05; }
.t-titre .meta { margin: .15rem 0 0; font-size: .82rem; font-variant-numeric: tabular-nums; }
.t-nav { display: grid; justify-items: center; gap: .35rem; min-width: 0; }
/* Les sauts tiennent sur une ligne : ±100, ±10, l'année d'avant, l'année, celle d'après. */
.sauts { display: flex; flex-wrap: nowrap; gap: .3rem; justify-content: center; align-items: center; max-width: 100%; }
.sauts a, .reperes a { display: inline-flex; align-items: center; gap: .25rem; min-height: 32px; padding: .1rem .6rem; border: 1px solid var(--ligne); border-radius: 8px;
  background: var(--carte); text-decoration: none; font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-courant { display: inline-flex; align-items: center; min-height: 32px; padding: .1rem .8rem; border-radius: 8px; background: var(--encre); color: var(--encre-texte);
  font: 700 .9rem var(--chiffres); white-space: nowrap; }
.sauts a:hover, .reperes a:hover { border-color: var(--or-vif); }
.sauts .pas { color: var(--discret); }
.sauts .voisine { font-weight: 700; }
[dir="rtl"] .fl { display: inline-block; transform: scaleX(-1); }
.t-outils { display: grid; justify-items: end; gap: .4rem; }
.barre-an form { display: flex; gap: .3rem; align-items: center; }
.reperes { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0; font-size: .8rem; color: var(--discret); }
.reperes a { min-height: 26px; padding: 0 .5rem; font-size: .8rem; color: var(--texte); }
.reperes a[aria-current], .regions a[aria-current] { background: var(--encre); color: var(--encre-texte); border-color: var(--encre); }
.vers-vues { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0; font-size: .85rem; }
.vers-vues a { display: inline-flex; gap: .25rem; align-items: center; color: var(--or); text-decoration: none; }
.vers-vues a:hover { text-decoration: underline; }
.barre-an input { width: 13.5rem; min-height: 34px; padding: 0 .6rem; border: 1px solid var(--ligne); border-radius: 8px; background: var(--fond); color: var(--texte); font: inherit; font-size: .88rem; font-variant-numeric: tabular-nums; }
.barre-an button { min-height: 34px; padding: 0 .8rem; border: 1px solid var(--ligne); border-radius: 8px; background: var(--carte); color: var(--texte); font: inherit; font-size: .88rem; cursor: pointer; }
.bandeau-an { font-size: .82rem; color: var(--discret); border: 1px dashed var(--ligne); border-radius: 8px; padding: .5rem .8rem; margin: 0 0 1rem; }
.regle { background: var(--doux); border: 1px solid var(--ligne); border-radius: 8px; padding: .5rem .8rem; font-size: .85rem; margin: 0 0 1rem; }
.grille-an { display: grid; grid-template-columns: minmax(0, 7fr) minmax(19rem, 3fr); gap: 1rem; align-items: start; }
details.sect { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; margin-bottom: .8rem; }
details.sect > summary { text-align: start; cursor: pointer; list-style: none; display: flex; justify-content: flex-start; align-items: baseline; gap: .6rem; padding: .75rem 1rem; text-align: start; }
details.sect > summary::-webkit-details-marker { display: none; }
details.sect > summary::before { content: "▸"; color: var(--or); }
details.sect[open] > summary::before { content: "▾"; }
[dir="rtl"] details.sect > summary::before { content: "◂"; }
[dir="rtl"] details.sect[open] > summary::before { content: "▾"; }
.sect-titre { font: 600 1.05rem var(--titre); }
details.sect > summary .n { margin-inline-start: auto; font-size: .82rem; color: var(--discret); font-variant-numeric: tabular-nums; }
.corps { padding: 0 1rem .9rem; }
.corps ul, .lignes { list-style: none; margin: 0; padding: 0; display: grid; }
.corps li, .lignes li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .4rem 0; border-top: 1px solid var(--ligne); }
.corps ul > li:first-child, .lignes li:first-child { border-top: 0; }
.ligne-nom { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.ligne-nom a { font-weight: 600; text-decoration: none; }
.ligne-nom a:hover { text-decoration: underline; }
.page-an .meta { color: var(--discret); font-size: .85rem; margin: 0; }
.age { font-size: .85rem; white-space: nowrap; text-align: end; font-variant-numeric: tabular-nums; }
.age.vers { color: var(--discret); }
details.autres { margin-top: .4rem; }
details.autres > summary { cursor: pointer; font-size: .9rem; color: var(--or); padding: .3rem 0; }
.page-an .carte-bloc h2 { font-size: 1rem; }
.pop { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .6rem; }
.pop caption { text-align: start; font-weight: 600; padding-bottom: .2rem; }
.pop th, .pop td { padding: .35rem 0; border-top: 1px solid var(--ligne); }
.pop th { text-align: start; font-weight: 400; }
.pop th a { font-weight: 600; text-decoration: none; }
.pop td.v { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calme { text-align: center; padding: 1.6rem 1rem; color: var(--discret); }
.calme-titre { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--texte); }
@media (max-width: 52rem) {
  .grille-an { grid-template-columns: minmax(0, 1fr); }
  .tete-an { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .t-outils { justify-items: center; }
  .tete-an h1 { font-size: 1.8rem; }
}
@media (max-width: 30rem) {
  .sauts { gap: .25rem; }
  .sauts a { padding: .2rem .45rem; font-size: .82rem; min-height: 34px; }
  .tete-an { padding: .6rem .7rem; gap: .5rem; }
  .barre-an input { width: 11rem; }
  .ancres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ancres::-webkit-scrollbar { display: none; }
  .ancres a { white-space: nowrap; }
}
.corps > .meta:first-child { margin-bottom: .4rem; }

/* Bandeau de synthèse : ancres vers les sections, puis filtre par région. */
.synthese > * { min-width: 0; }
.synthese { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .45rem .7rem; margin: 0 0 .8rem; border: 1px solid var(--ligne); border-radius: 10px; background: var(--carte); }
.ancres, .regions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }
.ancres a, .regions a { display: inline-flex; gap: .4rem; align-items: baseline; padding: .12rem .6rem; border: 1px solid var(--ligne); border-radius: 99px; text-decoration: none; font-size: .88rem; background: var(--fond); }
.ancres a:hover, .regions a:hover { border-color: var(--or-vif); }
.ancres b, .regions b { font-weight: 600; font-size: .8rem; color: var(--discret); font-variant-numeric: tabular-nums; }
.regions a[aria-current] b { color: inherit; }
.regions .titre { font-size: .8rem; color: var(--discret); margin-inline-end: .3rem; }
.sous { display: flex; gap: .5rem; align-items: baseline; font: 700 .72rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--discret); margin: .8rem 0 .1rem; padding-top: .6rem; border-top: 1px solid var(--ligne); }
[dir="rtl"] .sous { letter-spacing: 0; font-size: .82rem; }
.corps > .sous:first-child, .corps > .meta + .sous:first-of-type { border-top: 0; padding-top: 0; margin-top: .3rem; }
.sous .n { font-weight: 600; font-variant-numeric: tabular-nums; }
.pasti { font-size: .72rem; padding: .02rem .5rem; border: 1px solid var(--or-vif); border-radius: 99px; background: var(--doux); }
.note-repli { margin: 0 0 1rem; font-size: .82rem; color: var(--discret); }
.note-repli > summary { cursor: pointer; padding: .2rem 0; }
.note-repli .bandeau-an { margin: .4rem 0 0; }
.source-ligne { display: block; margin-top: .1rem; }
.source-ligne a { text-decoration: none; }
.sous-regions a[aria-current] { font-weight: 700; text-decoration: underline; }
.page-an .meta, .page-an .n, .page-an .age, .page-an td, .page-an .pasti, .page-an .synthese b { font-variant-numeric: tabular-nums; }
@media (min-width: 52.01rem) { .synthese { position: sticky; top: 0; z-index: 5; } }

/* Carte de l'année (J40, décision 0118) : couleurs et tracés de la Carte (carte.css). */
.carte-an { margin: 0 0 .8rem; display: grid; gap: .5rem; }
.carte-an-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.carte-an-tete h2 { margin: 0; }
.carte-an-tete .meta { margin: 0; }
.carte-an-lien { margin-inline-start: auto; font-size: .88rem; }
.carte-an-dessin { display: block; width: 100%; height: auto; aspect-ratio: 1.92; overflow: hidden; border: 1px solid var(--ligne); border-radius: 10px; background: var(--panneau); }
.carte-an .carte-etats path.avec-fiche { fill-opacity: .42; stroke-dasharray: none; }
.carte-an-noms text { font: 600 var(--nom, 4px) var(--corps); fill: var(--texte); text-anchor: middle; dominant-baseline: middle;
  paint-order: stroke; stroke: var(--carte); stroke-width: calc(var(--nom, 4px) * .28); stroke-linejoin: round; pointer-events: none; }
.carte-an-legende { display: grid; gap: .35rem; font-size: .88rem; }
.carte-an-legende p { margin: 0; }
.carte-an-legende .n { font-family: var(--chiffres); font-size: .8rem; font-variant-numeric: tabular-nums; margin-inline-end: .6rem; }
.carte-an-sym { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.carte-an-sym.plein { background: color-mix(in srgb, var(--or-vif) 35%, transparent); border: 1.5px solid var(--or); }
.carte-an-sym.pointille { border: 1.5px dashed var(--or); opacity: .7; }
.carte-an-vide { margin: 0; padding: .8rem 1rem; border: 1px dashed var(--ligne); border-radius: 10px; color: var(--discret); }
@media (max-width: 700px) {
  .carte-an-lien { margin-inline-start: 0; }
  .carte-an-noms text { font-size: calc(var(--nom, 4px) * 1.5); }
}

/* « En un coup d'œil » (décision 0141). */
.page-an .carte-bloc h2 { font: 600 1.05rem var(--titre); margin: 0; }
.bloc-tete { display: flex; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.bloc-tete .meta { margin: 0; }
.bloc-tete .n { margin-inline-start: auto; font: .82rem var(--chiffres); color: var(--discret); }
.coup-oeil { margin: 0 0 .8rem; }
.coup-grille { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); gap: 1.4rem; }
.coup-grille h3 { margin: 0 0 .5rem; font: 700 .72rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--discret); display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.coup-grille h3 .meta { letter-spacing: 0; text-transform: none; font-weight: 400; font-size: .78rem; }
[dir="rtl"] .coup-grille h3 { letter-spacing: 0; font-size: .85rem; }
.contemps, .marquants { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.contemps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.marquants { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contemps li, .marquants li { display: grid; }
.contemp, .marquant { display: grid; align-content: start; gap: .2rem; padding: .6rem .7rem; border: 1px solid var(--ligne); border-block-start: 3px solid var(--or-vif);
  border-radius: 8px; background: var(--fond); text-decoration: none; }
.contemp:hover, .marquant:hover { border-color: var(--or-vif); }
.contemp b, .marquant b { font-size: .95rem; line-height: 1.2; }
.age-gros, .m-date { font: 700 .9rem var(--corps); color: var(--or); text-align: start; white-space: normal; }
.age-gros.vers { color: var(--or); }
.role { font-size: .8rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.contemp .meta { font-size: .76rem; }
.marquant .pasti { justify-self: start; }
.coup-oeil .plus { display: inline-block; margin: .5rem 0 0; font-size: .84rem; }
.coup-oeil .plus a, a.plus { color: var(--or); }

/* États et dynasties : une ligne = État, souverain de l'année, présence sur la carte, évolution. */
.etats-an { margin-bottom: .8rem; }
.etats-liste { list-style: none; margin: 0; padding: 0; }
.etats-liste li { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.75fr) 6.5rem 6rem; gap: .2rem 1rem; align-items: baseline;
  padding: .42rem 0; border-top: 1px solid var(--ligne); font-size: .9rem; }
.etats-liste li.etats-entete { border-top: 0; padding-top: 0; font: 700 .7rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
[dir="rtl"] .etats-liste li.etats-entete { letter-spacing: 0; font-size: .8rem; }
.e-nom a, .e-souv a { font-weight: 600; text-decoration: none; }
.e-nom a:hover, .e-souv a:hover { text-decoration: underline; }
.e-nom .meta, .e-souv .meta { font-size: .8rem; margin-inline-start: .3rem; }
.e-souv { display: grid; gap: .15rem; }
.e-vide { color: var(--discret); font-size: .82rem; font-style: italic; }
.dyn-av { font-size: .7rem; padding: 0 .4rem; border: 1px dashed var(--or-vif); border-radius: 99px; color: var(--or); margin-inline-start: .3rem; white-space: nowrap; }
.sur-carte { font-size: .78rem; color: var(--or); white-space: nowrap; }
.sans-trace { font-size: .78rem; color: var(--discret); }
.e-evol { font-size: .8rem; color: var(--or); text-decoration: none; text-align: end; white-space: nowrap; }
.e-evol:hover { text-decoration: underline; }
.etats-an > .meta { margin-top: .5rem; font-size: .78rem; }

/* Colonne de droite compacte : une source par tableau, titre de source sur une ligne. */
.cote-an .carte-bloc { margin-bottom: .8rem; }
.cote-an .pop { font-size: .84rem; margin-top: .1rem; }
.cote-an .pop th, .cote-an .pop td { padding: .25rem 0; }
.pop-src { margin: .7rem 0 0; min-width: 0; font-size: .8rem; }
.pop-src a { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--or); text-decoration: none; }
.cote-an .source-ligne a { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cote-an .pop th { min-width: 0; }
.autres-sources { margin-top: .7rem; font-size: .84rem; }
.autres-sources > summary { cursor: pointer; color: var(--or); }

/* Téléphone (390 px) : une colonne, cartes en défilement horizontal, souverain sous l'État. */
@media (max-width: 52rem) {
  .synthese { grid-template-columns: minmax(0, 1fr); }
  .coup-grille { grid-template-columns: minmax(0, 1fr); }
  .contemps, .marquants { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 70%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .2rem; }
  .contemps li, .marquants li { scroll-snap-align: start; }
  .etats-liste li { grid-template-columns: minmax(0, 1fr) auto; }
  .etats-liste li.etats-entete { display: none; }
  .e-souv { grid-column: 1 / -1; }
  .e-carte { display: none; }
  .e-nom { grid-column: 1; grid-row: 1; }
  .e-evol { grid-column: 2; grid-row: 1; }
}
