/* ------------------------------------------- page L'histoire biblique et son monde
   (histoire.html). Uniquement les jetons de site.css ; les couleurs de données
   reprennent les palettes --plan-0 … --plan-5, prévues pour porter un texte
   --plan-ink en clair comme en sombre. */

.hist-page { padding-block: 2rem 4rem; }
.hist-kicker {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); margin-bottom: var(--s2);
}
.hist-kicker a { color: inherit; }

/* Sommaire */
.hist-toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin-bottom: var(--s6); max-width: 52rem;
}
.hist-toc h2 { font-size: 1rem; margin-bottom: var(--s2); }
.hist-toc ol {
  margin: 0; padding: 0; list-style: none; counter-reset: toc;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 var(--s4);
}
.hist-toc li { counter-increment: toc; }
.hist-toc li a {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--tap);
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border);
}
.hist-toc li a::before {
  content: counter(toc); flex: 0 0 1.6rem; height: 1.6rem; display: grid; place-items: center;
  border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft); font-size: .78rem; font-weight: 600;
}
.hist-toc li a:hover { color: var(--accent); }
.hist-see { margin: var(--s3) 0 0; font-size: .88rem; color: var(--ink-soft); }

/* Sections */
.hist-section { margin-top: var(--s7); scroll-margin-top: 4.5rem; }
.hist-section > h2 { padding-top: var(--s4); border-top: 1px solid var(--border); }
.hist-lede { color: var(--ink-soft); max-width: 46rem; }
.hist-h3 { margin-top: var(--s6); scroll-margin-top: 4.5rem; }
.hist-faint { color: var(--ink-faint); font-size: .88rem; }
.hist-nowrap { white-space: nowrap; }
.hist-note { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-faint); margin-top: 2px; }
.hist-source, .hist-critique { color: var(--ink-soft); font-size: .9rem; max-width: 46rem; }
.hist-critique {
  border-left: 3px solid var(--border-strong); padding-left: var(--s3); margin-top: var(--s4);
}
.hist-page .chip { min-height: var(--tap); }
.hist-filters, .hist-filter-bar { margin: var(--s4) 0; }
.hist-filter-bar { display: grid; gap: var(--s2); }
.hist-method { margin-top: 0; }

/* Conteneur défilant : une figure ou un tableau trop large défile dans sa
   boîte, jamais la page. */
.hist-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  border-radius: var(--radius-sm);
}
.hist-scroll:focus-visible { outline: 2px solid var(--focus); }

/* Tableaux */
.hist-table {
  width: 100%; min-width: 38rem; border-collapse: collapse; font-size: .92rem;
  background: var(--surface);
}
.hist-table th, .hist-table td {
  text-align: left; vertical-align: top; padding: .55rem .65rem; border-bottom: 1px solid var(--border);
}
.hist-table thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
  background: var(--bg-alt); font-weight: 600;
}
.hist-table tbody th { font-weight: 600; }
.hist-table .book-refs { margin-top: 2px; }
.hist-kings { min-width: 60rem; }
.hist-kings tr { scroll-margin-top: 5rem; }
.hist-kings tr:target { background: var(--bg-alt); }
.hist-group th {
  background: var(--bg-alt); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft);
}
.hist-king-name { font-size: .98rem; }
.hist-dyn-tag {
  display: inline-block; margin-left: var(--s1); font-size: .7rem; font-weight: 500; color: var(--ink-faint);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 .4rem;
}
.hist-judge-text { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }
.hist-prophet-item { display: block; }
.hist-caption { caption-side: bottom; text-align: left; font-size: .8rem; color: var(--ink-faint); padding: var(--s2) 0; }

/* Jugement biblique : une couleur par verdict, partagée par le dessin et le tableau. */
.jug-droit { --jug: var(--plan-0); }
.jug-mal { --jug: var(--plan-1); }
.jug-mele { --jug: var(--plan-5); }
.jug-aucun { --jug: var(--ink-faint); }
.hist-badge {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: var(--jug); color: var(--plan-ink);
}

/* Figures */
.hist-figure { margin: var(--s4) 0; }
.hist-figure figcaption { font-size: .82rem; color: var(--ink-faint); margin-top: var(--s2); max-width: 46rem; }
.hist-legend {
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: .82rem; color: var(--ink-soft);
  margin-bottom: var(--s2);
}
.hist-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.hist-key { width: .9rem; height: .9rem; border-radius: 3px; background: var(--jug); display: inline-block; }
.hist-key.is-co { opacity: .38; }
.hist-key-line { width: 1.4rem; height: 0; border-top: 2.5px solid var(--accent); display: inline-block; }
.hist-key-line.is-israel { border-top: 2.5px dashed var(--plan-3); }
.hist-key-dot {
  width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); display: inline-block;
}

.hist-svg { display: block; width: 100%; height: auto; }
.hist-svg text { font-family: var(--font-ui); font-size: 11px; fill: var(--ink-soft); }
.hist-era { min-width: 860px; }
.hist-kings-figure .hist-scroll { max-width: 760px; }
.hist-kings-svg { min-width: 610px; }
.hist-exil-svg { min-width: 800px; }
.hist-tree-svg { min-width: 780px; max-width: 980px; }
.hist-church-svg { min-width: 820px; }
.hist-emp-svg { min-width: 700px; }
.hist-inter-svg { min-width: 660px; }
.hist-ark-svg { min-width: 640px; }

.fill-0 { fill: var(--plan-0); }
.fill-1 { fill: var(--plan-1); }
.fill-2 { fill: var(--plan-2); }
.fill-3 { fill: var(--plan-3); }
.fill-4 { fill: var(--plan-4); }
.fill-5 { fill: var(--plan-5); }
.fill-bg-0 { background: var(--plan-0); }
.fill-bg-1 { background: var(--plan-1); }
.fill-bg-2 { background: var(--plan-2); }
.fill-bg-3 { background: var(--plan-3); }
.fill-bg-4 { background: var(--plan-4); }
.fill-bg-5 { background: var(--plan-5); }
.hist-svg .is-alt { opacity: .78; }
.hist-svg a:hover rect, .hist-svg a:focus-visible rect { opacity: .82; }
.hist-svg .hist-seg-text { fill: var(--plan-ink); font-size: 11px; font-weight: 600; pointer-events: none; }
.hist-svg .hist-seg-out { font-size: 10.5px; fill: var(--ink-soft); }
.hist-svg .hist-lane { font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.hist-svg .hist-tick { font-size: 10.5px; fill: var(--ink-faint); font-variant-numeric: tabular-nums; }
.hist-svg .hist-axis-note { font-size: 10px; fill: var(--ink-faint); font-style: italic; }
.hist-grid { stroke: var(--border); stroke-width: 1; }
.hist-axis-line { stroke: var(--border-strong); stroke-width: 1; }
.hist-mark { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.hist-mark.is-alt { stroke-dasharray: 1 3; }
.hist-svg .hist-mark-text { font-size: 10px; fill: var(--ink-soft); }
.hist-svg .hist-halo { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.hist-leader { stroke: var(--ink-faint); stroke-width: .7; fill: none; }

/* Les deux royaumes */
.hist-svg rect.jug-droit, .hist-svg rect.jug-mal, .hist-svg rect.jug-mele, .hist-svg rect.jug-aucun { fill: var(--jug); }
.hist-svg rect.is-co { opacity: .38; }
.hist-dyn { fill: var(--bg-alt); }
.hist-prophet { fill: var(--plan-3); }
.hist-svg .hist-prophet-text { font-size: 9.5px; fill: var(--ink-soft); font-style: italic; }
.hist-svg .hist-king-text { font-size: 10.5px; fill: var(--ink); }
.hist-svg a:hover .hist-king-text { fill: var(--accent); text-decoration: underline; }

/* Courbe de l'exil */
.hist-zone-good { fill: var(--plan-0); opacity: .07; }
.hist-zone-bad { fill: var(--plan-1); opacity: .08; }
.hist-svg .hist-level { font-size: 10.5px; fill: var(--ink-soft); }
.hist-curve { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.hist-curve.is-juda { stroke: var(--accent); }
.hist-curve.is-israel { stroke: var(--plan-3); stroke-dasharray: 5 3; opacity: .85; }
.hist-dot { stroke: var(--surface); stroke-width: 1.4; }
.hist-dot.is-juda { fill: var(--accent); }
.hist-dot.is-israel { fill: var(--plan-3); }
.hist-dot.is-approx { fill: var(--bg); stroke-width: 2; }
.hist-dot.is-juda.is-approx { stroke: var(--accent); }
.hist-dot.is-israel.is-approx { stroke: var(--plan-3); }
.hist-svg a:hover .hist-dot { stroke: var(--ink); }
.hist-svg .hist-king-text.is-israel { fill: var(--ink-soft); }
.hist-scale dl { display: grid; gap: var(--s1); margin: var(--s3) 0 0; max-width: 46rem; font-size: .9rem; }
.hist-scale dl div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s3); }
.hist-scale dt { font-weight: 600; }
.hist-scale dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 520px) { .hist-scale dl div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.hist-lessons { margin-top: var(--s2); }

/* Cartes de texte */
.hist-cards {
  display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.hist-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s4); min-width: 0; scroll-margin-top: 5rem;
}
.hist-card:target { border-color: var(--accent); }
.hist-card h4 { font-size: 1rem; margin: 0 0 var(--s2); }
.hist-card h4 small { font-weight: 400; color: var(--ink-faint); font-size: .8rem; }
.hist-card p { font-size: .93rem; margin-bottom: var(--s2); }
.hist-card .book-list { padding-left: 1rem; font-size: .92rem; gap: var(--s1); }

/* Périodes */
.hist-periods, .hist-inter { display: grid; gap: var(--s4); }
.hist-period {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s5); scroll-margin-top: 5rem; min-width: 0;
}
@media (max-width: 520px) { .hist-period { padding: var(--s4); } }
.hist-period-head h3 { font-family: var(--font-read); font-size: 1.5rem; margin: 0 0 var(--s2); }
.hist-period-dates {
  display: flex; align-items: center; gap: var(--s2);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--orange-ink);
  font-weight: 700; margin: 0 0 var(--s1);
}
.hist-swatch { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }
.hist-period-text { max-width: 48rem; }
.hist-debate {
  font-size: .9rem; color: var(--ink-soft); background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: var(--s2) var(--s3); max-width: 48rem;
}
.hist-debate strong { color: var(--ink); margin-right: var(--s1); }
.hist-period-grid { display: grid; gap: var(--s5); margin-top: var(--s4); }
@media (min-width: 820px) { .hist-period-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.hist-period h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin: 0 0 var(--s2); }
.hist-period h5 { font-size: .92rem; margin: var(--s4) 0 var(--s1); }
.hist-books { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0; }
.hist-book {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0 .6rem; border-radius: 999px;
  background: var(--bg-alt); color: var(--ink); text-decoration: none; font-size: .84rem;
}
.hist-book:hover { color: var(--accent); }
.hist-people { margin: 0; padding-left: 1rem; display: grid; gap: 2px; font-size: .93rem; }
.hist-events { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); font-size: .93rem; }
.hist-events li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--s2); }
.hist-year { font-variant-numeric: tabular-nums; color: var(--orange-ink); font-weight: 700; font-size: .85rem; padding-top: 1px; }
.hist-world ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s3); font-size: .93rem; }
.hist-world .tag { margin-right: var(--s1); }
.hist-period-links { margin: var(--s4) 0 0; font-size: .88rem; }

/* Entre les Testaments */
.hist-inter-dl { display: grid; gap: var(--s3); margin: 0; }
.hist-inter-dl div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--s3); }
.hist-inter-dl dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding-top: .2rem; }
.hist-inter-dl dd { margin: 0; max-width: 48rem; }
@media (max-width: 620px) { .hist-inter-dl div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.hist-inter-dl .hist-events li { grid-template-columns: 2.6rem minmax(0, 1fr); }
.hist-symbols { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.hist-symbols li { display: grid; gap: 2px; padding-bottom: var(--s2); border-bottom: 1px solid var(--border); }
.hist-symbols li:last-child { border-bottom: 0; }
.hist-symbol { font-weight: 600; font-size: .92rem; }
.hist-meaning { font-size: .9rem; color: var(--ink-soft); }

/* Le monde du Nouveau Testament */
.hist-node rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.hist-node.is-main rect { stroke: var(--accent); stroke-width: 2; }
.hist-svg .hist-node-name { font-size: 12px; font-weight: 650; fill: var(--ink); }
.hist-svg .hist-node-date { font-size: 10px; fill: var(--ink-faint); }
.hist-svg a:hover .hist-node rect, .hist-svg a:focus-visible .hist-node rect { stroke: var(--accent); }
.hist-tree-edge { fill: none; stroke: var(--ink-faint); stroke-width: 1.3; }
.hist-tree-union { stroke: var(--orange-ink); stroke-width: 1.4; stroke-dasharray: 4 3; }
.hist-dl { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); max-width: 52rem; font-size: .94rem; }
.hist-timeline {
  list-style: none; margin: var(--s3) 0 0; padding: 0 0 0 var(--s3); max-width: 52rem;
  border-left: 2px solid var(--border-strong); display: grid; gap: var(--s3); font-size: .94rem;
}
.hist-timeline li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s3); }
@media (max-width: 520px) { .hist-timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* L'Église de 30 à 100 */
.hist-svg .hist-dot-text { font-size: 10.5px; fill: var(--ink); font-weight: 600; }
.hist-decades { display: grid; gap: var(--s5); }
.hist-decade h3 { display: flex; align-items: baseline; gap: var(--s2); font-size: 1rem; color: var(--ink-soft); font-weight: 600; }
.hist-decade h3 span { font-family: var(--font-read); font-size: 1.6rem; color: var(--ink); }
.hist-decade ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.hist-fact {
  display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: var(--s3);
  padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); border-left-width: 4px; font-size: .94rem;
}
.hist-fact.k-evt { border-left-color: var(--plan-0); }
.hist-fact.k-ecrit { border-left-color: var(--plan-1); }
.hist-fact.k-monde { border-left-color: var(--plan-5); }
.hist-fact .tag { margin-right: var(--s1); }
.hist-fact .hist-books { margin-top: var(--s1); }

/* Mesures */
.hist-converter {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin: var(--s4) 0 var(--s5); max-width: 52rem; scroll-margin-top: 5rem;
}
@media (max-width: 520px) { .hist-converter { padding: var(--s4); } }
.hist-converter h3 { margin-bottom: var(--s3); }
.hist-conv-row { display: grid; gap: var(--s3); margin-top: var(--s3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .hist-conv-row { grid-template-columns: 9rem minmax(0, 1fr) 12rem; } }
.hist-field { display: grid; gap: var(--s1); min-width: 0; }
.hist-field span { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.hist-field[hidden] { display: none; }
.hist-conv-out { display: block; margin-top: var(--s4); }
.hist-conv-main { font-size: 1.15rem; margin-bottom: var(--s1); }
.hist-conv-main strong { color: var(--accent); }
.hist-conv-sub { color: var(--ink-soft); }
.hist-conv-list {
  list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4);
  font-size: .9rem; color: var(--ink-soft);
}
.hist-conv-list strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.hist-measure .hist-table { min-width: 34rem; }
.hist-calc { list-style: none; margin: 0 0 var(--s2); padding: 0; display: grid; gap: 2px; font-size: .9rem; }
.hist-calc span { color: var(--ink-faint); }
.hist-scale-figs { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: flex-end; }
.hist-scale-figs > figure { flex: 0 1 340px; min-width: 0; }
.hist-scale-figs > .hist-fig-wide { flex: 1 1 100%; }
.hist-scale-figs > figure:last-child { flex-basis: 220px; }
.hist-height-svg { max-width: 340px; }
.hist-statue-svg { max-width: 200px; }
.hist-ark { fill: var(--plan-5); }
.hist-pitch { fill: var(--plan-2); }
.hist-person { fill: var(--ink); }
.hist-statue { fill: var(--plan-1); }
.hist-scale-bar { stroke: var(--ink); stroke-width: 2; }
.hist-person-fig { fill: var(--ink-soft); }
.hist-giant-fig { fill: var(--plan-1); }

/* Distances */
.hist-maps { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.hist-maps > figure { min-width: 0; }
@media (min-width: 900px) { .hist-maps { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; } }
.hist-map { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.hist-map .hist-map-svg { min-width: 0; }
#mapFar .hist-map-svg { min-width: 520px; }
.hist-sea { fill: color-mix(in srgb, var(--blue) 14%, var(--bg)); }
.hist-land { fill: var(--surface); stroke: var(--border-strong); stroke-width: .6; }
.hist-river { fill: none; stroke: color-mix(in srgb, var(--blue) 45%, var(--bg)); stroke-width: .9; }
.hist-ring { fill: none; stroke: var(--orange-ink); stroke-width: 1; stroke-dasharray: 4 3; opacity: .75; }
.hist-svg .hist-ring-text { font-size: 9.5px; fill: var(--orange-ink); }
.hist-svg .hist-halo-sea { paint-order: stroke; stroke: color-mix(in srgb, var(--blue) 14%, var(--bg)); stroke-width: 3px; stroke-linejoin: round; }
.hist-svg .hist-halo-land { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.hist-place { fill: var(--orange-ink); stroke: var(--surface); stroke-width: 1; }
.hist-svg a:hover .hist-place { fill: var(--accent); }
.hist-svg .hist-place-text { font-size: 11px; fill: var(--ink); }
.hist-svg .hist-place-text.is-centre { font-weight: 700; font-size: 12px; }
.hist-centre { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }
.hist-dist { min-width: 42rem; }
.hist-dist-cell { min-width: 9rem; }
.hist-bar {
  display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--orange); min-width: 2px;
}
