/* Évolution d'une dynastie (J38, décision 0100). Variables du site ; propriétés logiques pour l'arabe. */
.page-dyn { width: 100%; font-variant-numeric: tabular-nums; }
.page-dyn .sans-coupure { white-space: nowrap; }
.page-dyn .sr-seulement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[dir="rtl"] .page-dyn .fl { display: inline-block; transform: scaleX(-1); }

.dyn-bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 1rem; background: var(--doux); border: 1px solid var(--ligne); border-radius: 10px; }
.dyn-bandeau h1 { font: 700 1.35rem var(--titre); margin: 0; }
.dyn-ar { font-family: "IBM Plex Sans Arabic", var(--corps); font-size: 1rem; color: var(--discret); }
.dyn-pastille { border: 1px solid var(--or); color: var(--or); border-radius: 99px; padding: .05rem .7rem; font-size: .8rem; }
.dyn-suite a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.dyn-suite a:hover { color: var(--texte); }
.dyn-pilote { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; font-size: .85rem; }
.dyn-btn { border: 1px solid var(--ligne); background: var(--carte); color: var(--texte); border-radius: 6px; padding: .15rem .55rem; text-decoration: none; font: inherit; cursor: pointer; white-space: nowrap; }
.dyn-btn:hover { border-color: var(--or-vif); }
.dyn-btn.inactif { color: var(--discret); opacity: .55; cursor: default; }
.dyn-an { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.dyn-an[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.dyn-pilote input[type="range"] { inline-size: 9rem; accent-color: var(--or-vif); }
.dyn-saisie { inline-size: 6rem; font: inherit; }

/* Sous 1100 px la frise défile de côté : son texte reste lisible. L'axe du temps reste de gauche à droite, même en arabe. */
.dyn-frise { margin-top: .5rem; background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 6px 8px 4px; overflow-x: auto; }
.dyn-frise svg { display: block; direction: ltr; inline-size: 100%; min-inline-size: 1100px; block-size: auto; max-block-size: 240px; }
.dyn-frise text { font-family: var(--corps); }
.dyn-frise a:hover rect, .dyn-frise a:hover path { stroke-width: 2; }
.dyn-frise .grille { stroke: var(--ligne); stroke-width: 1; }
.dyn-frise .tk { font-size: 10px; fill: var(--discret); }
.dyn-frise .lab { font-size: 12px; font-weight: 600; fill: var(--texte); }
.dyn-frise .sous { font-size: 10px; fill: var(--discret); }
.dyn-frise .zebre { fill: var(--fond); }
.dyn-frise .zebre2 { fill: var(--carte); }
.dyn-frise .flou { fill: var(--or); opacity: .07; }
.dyn-frise .regne { fill: var(--doux); stroke: var(--or); stroke-width: .8; }
.dyn-frise .regne.deb { stroke-dasharray: 3 2; }
.dyn-frise .regne.actif { fill: var(--or-vif); }
.dyn-frise .tr { font-size: 10.5px; fill: var(--texte); pointer-events: none; }
.dyn-frise .tr.actif { fill: var(--encre-texte); font-weight: 700; }
.dyn-frise .tr2 { font-size: 10px; fill: var(--discret); }
.dyn-frise .manque { font-size: 10px; fill: var(--alerte); font-style: italic; }
.dyn-frise .vide { font-size: 10.5px; fill: var(--discret); font-style: italic; }
.dyn-frise .aire { fill: var(--or-vif); fill-opacity: .25; stroke: var(--or); stroke-width: 1; }
.dyn-frise .aire.actif { fill-opacity: .5; }
.dyn-frise .guerre-duree { fill: var(--alerte); opacity: .25; }
.dyn-frise .losange, .dyn-frise .catastrophe { fill: var(--carte); stroke: var(--alerte); stroke-width: 1.2; }
.dyn-frise .catastrophe { stroke: var(--texte); }
.dyn-frise .losange.proche { fill: var(--alerte); }
.dyn-frise .catastrophe.proche { fill: var(--texte); }
.dyn-frise .barre { fill: #2b8a74; fill-opacity: .35; stroke: #2b8a74; }
.dyn-frise .pop { fill: var(--carte); stroke: var(--texte); stroke-width: 1.5; }
.dyn-frise .monument { fill: var(--carte); stroke: var(--or); stroke-width: 1.2; }
.dyn-frise .monnaie { fill: var(--or-vif); }
.dyn-frise .phase-vide { fill: none; stroke: var(--ligne); stroke-dasharray: 4 3; }
.dyn-frise .curseur { stroke: var(--texte); stroke-width: 1.5; pointer-events: none; }
/* La ligne de l'année se prend à la souris ou au doigt ; la prise est plus large que le trait. */
.dyn-frise .poignee { cursor: ew-resize; touch-action: none; outline: none; }
.dyn-frise .prise { fill: transparent; }
.dyn-frise .poignee:focus-visible .bulle { stroke: var(--or-vif); stroke-width: 3; }
.dyn-frise .poignee.glisse .curseur, .dyn-frise .poignee:hover .curseur { stroke-width: 2.5; }
.dyn-frise svg.glisse { cursor: ew-resize; user-select: none; }
.dyn-frise .bulle { fill: var(--texte); }
.dyn-frise .tk.sous-bulle { visibility: hidden; }
/* Repères d'événements de la carte : plus gros au survol, leur nom s'affiche en infobulle. */
.dyn-pt-conflit, .dyn-pt-cata { cursor: pointer; }
.dyn-point:hover .dyn-pt-conflit, .dyn-point:hover .dyn-pt-cata { stroke: var(--texte); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.dyn-frise .bt { font-size: 10px; fill: var(--fond); font-weight: 700; }

.dyn-notes { margin: .4rem .2rem 1rem; font-size: .82rem; color: var(--discret); }
.dyn-legende { margin: .2rem 0; }
/* Une entrée par clé, jamais coupée entre la clé et son texte, et de l'air entre elles. */
.dyn-legende.dyn-entrees { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.dyn-legende .entree { white-space: nowrap; }
.dyn-legende .cle, .dyn-legende-carte .cle { margin-inline-end: .35em; }
.dyn-legende .cle { display: inline-block; inline-size: 11px; block-size: 9px; vertical-align: baseline; border: 1px solid var(--or); }
.dyn-legende .regne-cle { background: var(--doux); }
.dyn-legende .aire-cle { background: color-mix(in srgb, var(--or-vif) 35%, transparent); }
.dyn-legende .losange-cle { inline-size: 8px; block-size: 8px; transform: rotate(45deg); border-color: var(--alerte); background: var(--alerte); }
.dyn-legende .cata-cle { border: 0; inline-size: 0; block-size: 0; border-inline: 5px solid transparent; border-block-end: 9px solid var(--texte); }
.dyn-legende .pop-cle { inline-size: 8px; block-size: 8px; border-radius: 50%; border: 1.5px solid var(--texte); }
.dyn-legende .bati-cle { inline-size: 8px; block-size: 8px; }
.dyn-legende .monnaie-cle { inline-size: 8px; block-size: 8px; background: var(--or-vif); border: 0; }
.dyn-manques { margin: .3rem 0; padding-inline-start: 1.1rem; font-style: italic; }
.dyn-lien-fiche { margin: .4rem 0; }

@media (max-width: 700px) {
  .dyn-pilote { margin-inline-start: 0; inline-size: 100%; flex-wrap: wrap; }
  .dyn-pilote input[type="range"] { flex: 1; }
}

/* Carte et onglets (PR D) : deux colonnes à l'ordinateur, l'une sous l'autre au téléphone. */
.dyn-bas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); align-items: start; gap: .75rem; margin-top: .6rem; }
/* Le panneau des onglets prend la hauteur de la carte, pas plus : il défile à l'intérieur. */
.dyn-bas > .dyn-panneau { align-self: stretch; contain: size; display: flex; flex-direction: column; }
.dyn-bas > .dyn-panneau .dyn-contenu { flex: 1 1 auto; min-block-size: 0; }
/* Sans carte, le panneau ne peut pas prendre sa hauteur : il garde la sienne, bornée. */
.dyn-bas.sans-carte > .dyn-panneau { contain: none; }
.dyn-bas.sans-carte > .dyn-panneau .dyn-contenu { max-block-size: 520px; }
.dyn-carte .hors-an { display: none; }
.dyn-carte, .dyn-panneau { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; overflow: hidden; }
.dyn-carte svg { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 776 / 440; background: var(--panneau); direction: ltr; }
.dyn-fond .mer, .dyn-fond .eaux { fill: var(--panneau); }
.dyn-fond .pays { fill: var(--carte); stroke: none; }
.dyn-fond .pays[data-statut="99"] { fill: var(--doux); }
.dyn-etat { fill: var(--or-vif); fill-opacity: .35; stroke: var(--or); }
.dyn-cumul { fill: none; stroke: var(--or); stroke-width: 1.6px; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.dyn-etat { stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.dyn-capitale { fill: var(--texte); }
.dyn-pt-conflit { fill: var(--alerte); }
.dyn-pt-cata { fill: var(--carte); stroke: var(--texte); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* Halo sous chaque nom : les batailles rapprochées (al-Andalus) restent lisibles. */
.dyn-ct { fill: var(--texte); paint-order: stroke fill; stroke: var(--carte); stroke-opacity: .92; stroke-linejoin: round; font-family: var(--corps); }
.dyn-ct.evt { fill: var(--alerte); font-weight: 700; }
/* La légende est sous la carte, jamais posée dessus : aucun lieu du bord n'est caché. */
.dyn-legende-carte { margin: 0; padding: .35rem .7rem; border-block-start: 1px solid var(--ligne); font-size: .78rem; color: var(--discret); }
.dyn-legende-carte .cle, .dyn-legende .cle { display: inline-block; inline-size: 11px; block-size: 9px; border: 1px solid var(--or); }
.dyn-legende-carte .cumul-cle { border-style: dashed; background: none; }
.dyn-legende-carte .capitale-cle { inline-size: 8px; block-size: 8px; border-radius: 50%; border: 0; background: var(--texte); }
.dyn-legende-carte .losange-cle { inline-size: 8px; block-size: 8px; transform: rotate(45deg); border: 0; background: var(--alerte); }
.dyn-legende-carte .aire-cle { background: color-mix(in srgb, var(--or-vif) 35%, transparent); }
.dyn-onglets { display: flex; flex-wrap: wrap; background: var(--panneau); border-block-end: 1px solid var(--ligne); }
.dyn-onglets a { padding: .5rem .7rem; font-size: .82rem; color: var(--discret); text-decoration: none; border-block-end: 2px solid transparent; }
.dyn-onglets a[aria-current] { background: var(--carte); color: var(--texte); font-weight: 700; border-block-end-color: var(--or); }
.dyn-onglets small { font-weight: 400; color: var(--discret); }
.dyn-contenu { padding: .3rem .9rem .8rem; overflow-y: auto; font-size: .86rem; }
.dyn-contenu h3 { font: 700 .7rem var(--corps); text-transform: uppercase; letter-spacing: .06em; color: var(--discret); margin: .7rem 0 .15rem; }
.dyn-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; margin: 0; padding: .12rem 0; border-block-end: 1px dotted var(--ligne); }
.dyn-l.actif { background: var(--doux); }
/* Une période se lit de gauche à droite, même en arabe (« 1070 – 1106 »). */
.dyn-l .a { inline-size: 6.5rem; flex: none; white-space: nowrap; color: var(--or); direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .dyn-l .a { text-align: end; }
.dyn-l .a a { color: inherit; }
.dyn-l .s { margin-inline-start: auto; font-size: .76rem; color: var(--discret); }
.dyn-av { white-space: nowrap; font-size: .72rem; border: 1px solid var(--ligne); border-radius: 99px; padding: 0 .4rem; color: var(--discret); }
.dyn-trou { font-size: .8rem; color: var(--discret); font-style: italic; background: var(--fond); border: 1px dashed var(--ligne); border-radius: 6px; padding: .25rem .5rem; margin: .3rem 0; }
.dyn-note, .dyn-plus { font-size: .78rem; color: var(--discret); margin: .3rem 0; }
.dyn-resume { line-height: 1.55; }


@media (max-width: 1000px) {
  .dyn-bas { grid-template-columns: minmax(0, 1fr); }
  .dyn-bas > .dyn-panneau { contain: none; }
  .dyn-bas > .dyn-panneau .dyn-contenu { max-block-size: 520px; }
}

/* Onglet Évolution (J59, décision 0160) : courbe recensée à gauche, tranche choisie à droite. */
.dyn-evo { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; margin-top: .6rem; align-items: start; }
.dyn-evo-principal, .dyn-evo-tranche { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; }
.dyn-evo-principal { overflow: hidden; }
.dyn-evo-principal > :not(.dyn-onglets) { margin-inline: 1rem; }
.dyn-evo-prudence { background: var(--doux); border: 1px solid var(--ligne); border-radius: 8px; padding: .5rem .8rem; font-size: .85rem; margin-block: .8rem; }
.dyn-evo-prudence b { color: var(--or); }
.dyn-evo-barre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.dyn-evo-barre h2 { font: 600 1.15rem var(--titre); margin: 0; }
.dyn-evo-seg { display: inline-flex; margin-inline-start: auto; background: var(--panneau); border: 1px solid var(--ligne); border-radius: 8px; padding: 3px; gap: 3px; }
.dyn-evo-seg a { padding: .25rem .7rem; border-radius: 6px; font-size: .85rem; font-weight: 600; color: var(--discret); text-decoration: none; }
.dyn-evo-seg a[aria-current] { background: var(--encre); color: var(--encre-texte); }
.dyn-evo-poids { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; background: var(--panneau); border: 1px solid var(--ligne); border-radius: 8px; padding: .5rem .8rem; margin-block: .7rem 0; }
.dyn-evo-poids .lab, .dyn-evo-tranche .lab { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--discret); }
.dyn-evo-curseur { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 .35rem; font-size: .8rem; font-weight: 600; }
.dyn-evo-curseur input { grid-column: 1 / -1; inline-size: 7.5rem; accent-color: var(--or-vif); }
.dyn-evo-curseur small { grid-column: 1 / -1; font-weight: 400; color: var(--discret); }
.dyn-evo-curseur.sans { opacity: .5; }
.dyn-evo-raz { margin-inline-start: auto; font-size: .8rem; color: var(--discret); }
.dyn-evo-dessin { overflow-x: auto; margin-block: .6rem .2rem; }
.dyn-evo-dessin svg { display: block; direction: ltr; inline-size: 100%; min-inline-size: 760px; block-size: auto; }
.dyn-evo-dessin text { font-family: var(--corps); }
.evo-col { fill: transparent; cursor: pointer; }
.evo-col:hover { fill: var(--point); }
.evo-col.mince { fill: color-mix(in srgb, var(--panneau) 80%, transparent); }
.evo-col.choisie { fill: var(--doux); }
.evo-lab { font-size: 12.5px; font-weight: 700; fill: var(--texte); }
.evo-sous { font-size: 10.5px; fill: var(--discret); }
.evo-tk { font-size: 10px; fill: var(--discret); }
.evo-axe { stroke: var(--ligne); stroke-width: 1; }
.evo-courbe { fill: none; stroke: var(--or); stroke-width: 2.4; stroke-linejoin: round; }
.evo-point { fill: var(--carte); stroke: var(--or); stroke-width: 2; }
.evo-point.choisie { fill: var(--or-vif); }
.evo-attente { font-size: 11.5px; font-weight: 600; fill: var(--discret); }
.evo-barre { pointer-events: none; }
.evo-barre.mince { opacity: .35; }
.evo-territoire { fill: #3a6b8c; background: #3a6b8c; }
.evo-guerres { fill: #a5523a; background: #a5523a; }
.evo-savoir { fill: #2f7d6b; background: #2f7d6b; }
.evo-bati { fill: #8a6420; background: #8a6420; }
.evo-economie { fill: #6b7a2f; background: #6b7a2f; }
.evo-stabilite { fill: #7a5a9a; background: #7a5a9a; }
.evo-cle { display: inline-block; inline-size: .65rem; block-size: .65rem; border-radius: 2px; margin-inline-end: .35rem; vertical-align: -1px; }
.dyn-evo-tranche { padding: .8rem 1rem; }
.dyn-evo-tranche h3 { font: 600 1.4rem var(--titre); margin: .1rem 0; }
.dyn-evo-lecture { color: var(--discret); margin: 0 0 .5rem; }
.dyn-evo-lecture b { color: var(--or); font-family: var(--chiffres); }
.dyn-evo-det { inline-size: 100%; border-collapse: collapse; font-size: .82rem; margin-block-end: .7rem; }
.dyn-evo-det th { text-align: start; font-weight: 600; white-space: nowrap; padding: .35rem .2rem; border-block-end: 1px solid var(--ligne); }
.dyn-evo-det td { padding: .35rem .2rem; border-block-end: 1px solid var(--ligne); color: var(--discret); vertical-align: top; }
.dyn-evo-det td:nth-child(2) { font-family: var(--chiffres); font-weight: 600; color: var(--texte); text-align: end; inline-size: 2.5rem; }
.dyn-evo-liens { margin: .3rem 0 .7rem; padding-inline-start: 1.1rem; font-size: .85rem; }
.dyn-evo-liens li { margin-block: .2rem; }
@media (max-width: 1100px) { .dyn-evo { grid-template-columns: minmax(0, 1fr); } }
.evo-milieu { stroke-dasharray: 3 3; }
.dyn-evo-det th, .dyn-evo-det td { vertical-align: top; }
