/* Dubaï — notes de khôlle. Vanilla, sans dépendance externe. */
:root {
  --sable: #f6f1e7;
  --sable-2: #ece4d3;
  --papier: #fffdf8;
  --encre: #1d2733;
  --encre-2: #4a5563;
  --trait: #d9cfbb;
  --mer: #0e6e8c;
  --mer-clair: #d6e8f2;
  --terre: #b5532a;
  --or: #b8860b;
  --ok: #3f7d4e;
  --alerte: #a1402a;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(29, 39, 51, .06), 0 6px 20px rgba(29, 39, 51, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  /* types de centralité */
  --t-historique: #8a5a2b;
  --t-affaires: #1f4e8c;
  --t-logistique: #0e6e8c;
  --t-vitrine: #b5532a;
  --t-savoir: #6b4fa0;
  --t-elites: #b8860b;
  --t-populaire: #3f7d4e;
  --t-pouvoir: #7a2e4f;
  --t-marges: #59606b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--sable);
  color: var(--encre);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mer); text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-2); margin-top: 1.1em; }
ul { padding-left: 1.2em; margin: .3em 0 .6em; }
li { margin: .15em 0; }
li::marker { color: var(--terre); }
.lucide { width: 1.1em; height: 1.1em; stroke-width: 2; vertical-align: -.18em; flex: none; }

/* ---------- en-tête ---------- */
.hero {
  background:
    linear-gradient(180deg, rgba(14, 110, 140, .92), rgba(29, 39, 51, .94)),
    url("../img/areion/MO53-80.jpg") center / cover;
  color: #fff;
  padding: 56px 20px 40px;
}
.hero .wrap { max-width: 1080px; margin: 0 auto; }
.surtitre { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; opacity: .85; display: flex; gap: .5em; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2rem, 6vw, 3.4rem); margin: .2em 0 .25em; }
.hero p { max-width: 62ch; opacity: .92; margin: .3em 0; }
.consigne {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--rayon);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
  display: grid; gap: 6px; max-width: 760px;
}
.consigne strong { display: flex; gap: .45em; align-items: center; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 241, 231, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--trait);
}
.nav ul {
  list-style: none; margin: 0 auto; padding: 8px 12px; max-width: 1080px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav li { margin: 0; }
.nav a {
  display: inline-flex; align-items: center; gap: .4em; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--encre-2); font-size: .9rem; font-weight: 600;
}
.nav a:hover { background: var(--sable-2); color: var(--encre); }
.nav a.actif { background: var(--encre); color: #fff; }

/* ---------- sections ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 80px; }
.section { padding: 44px 0 8px; }
.entete-section { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.entete-section h2 { display: flex; align-items: center; gap: .45em; margin: 0; }
.entete-section h2 .lucide { color: var(--terre); width: .9em; height: .9em; }
.chapo { color: var(--encre-2); max-width: 70ch; margin: 0 0 18px; }

.carte-bloc {
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 18px 18px 14px; box-shadow: var(--ombre);
}
.grille { display: grid; gap: 14px; }
.grille-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grille-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  font: 600 .88rem/1 var(--sans); padding: 9px 13px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--papier); color: var(--encre);
  cursor: pointer; text-decoration: none; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--sable-2); }
.btn:active { transform: translateY(1px); }
.btn.plein { background: var(--terre); border-color: var(--terre); color: #fff; }
.btn.plein:hover { background: #9c4522; }
.btn.clair { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn.clair:hover { background: rgba(255, 255, 255, .22); }
.btn.copie.ok { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- puces, badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.badge {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; background: var(--sable-2); color: var(--encre-2);
}
.bouton-badge { border: 0; cursor: zoom-in; font-family: var(--sans); }
.bouton-badge:hover { background: var(--trait); }
.badge.date { background: #fbe9d0; color: #7a4a12; }
.badge.alerte { background: #f7dcd4; color: var(--alerte); }
.badge.source { background: var(--mer-clair); color: #0b4f66; }

/* ---------- citations ---------- */
.citation {
  margin: 8px 0; padding: 8px 12px 8px 14px;
  border-left: 3px solid var(--mer); background: #f3f8fa; border-radius: 0 8px 8px 0;
  font-family: var(--serif); font-size: 1rem;
}
.citation q { quotes: "« " " »"; }
.citation cite { display: block; font: 600 .76rem/1.4 var(--sans); font-style: normal; color: var(--mer); margin-top: 3px; }

/* ---------- centralités ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.filtre {
  font: 600 .84rem var(--sans); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--trait); background: var(--papier); color: var(--encre-2);
}
.filtre[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }
.t-historique { --c: var(--t-historique); }
.t-affaires { --c: var(--t-affaires); }
.t-logistique { --c: var(--t-logistique); }
.t-vitrine { --c: var(--t-vitrine); }
.t-savoir { --c: var(--t-savoir); }
.t-elites { --c: var(--t-elites); }
.t-populaire { --c: var(--t-populaire); }
.t-pouvoir { --c: var(--t-pouvoir); }
.t-marges { --c: var(--t-marges); }
.centralite { border-top: 5px solid var(--c, var(--terre)); }
.centralite[hidden] { display: none; }
.centralite > summary { list-style: none; cursor: pointer; }
.centralite > summary::-webkit-details-marker { display: none; }
.centralite .titre-c { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.centralite .titre-c h3 { margin: 0; color: var(--c, var(--encre)); }
.centralite .lieux { color: var(--encre-2); font-size: .92rem; margin: 2px 0 0; }
.centralite .chevron { transition: transform .2s; color: var(--encre-2); }
.centralite[open] .chevron { transform: rotate(180deg); }
.centralite .corps { margin-top: 10px; }
.chiffres { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 6px 0; }
.chiffre { background: var(--sable); border-radius: 10px; padding: 8px 10px; }
.chiffre b { display: block; font-size: 1.15rem; color: var(--encre); }
.chiffre span { font-size: .82rem; color: var(--encre-2); }
.plan-tip {
  display: flex; gap: .5em; align-items: flex-start; margin-top: 10px; padding: 9px 11px;
  background: #fff6e0; border: 1px dashed #e0b55b; border-radius: 10px; font-size: .92rem;
}
.plan-tip .lucide { color: var(--or); margin-top: .2em; }
.vignettes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.vignettes button { padding: 0; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; cursor: zoom-in; background: none; }
.vignettes img { width: 120px; height: 84px; object-fit: cover; }

/* ---------- cartes ---------- */
.onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.onglet {
  font: 700 .9rem var(--sans); padding: 9px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--trait); background: var(--papier); color: var(--encre-2);
  display: inline-flex; gap: .45em; align-items: center;
}
.onglet[aria-selected="true"] { background: var(--mer); color: #fff; border-color: var(--mer); }
.panneau[hidden] { display: none; }
.carte-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.carte-image { background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px; cursor: zoom-in; }
.idee-force { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 8px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--trait); }
.tableau th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-2); background: var(--sable); }
.tableau td .citation { margin: 4px 0 0; font-size: .88rem; }
.scroll-x { overflow-x: auto; }
.legende-vide {
  border: 2px dashed var(--trait); border-radius: 10px; padding: 10px 12px; background: var(--papier);
}
.legende-vide ol { margin: 4px 0; }
.legende-vide li::marker { color: var(--encre-2); font-weight: 700; }
.legende-vide .ligne { display: block; border-bottom: 1px dotted var(--encre-2); height: 1.4em; opacity: .45; }

/* ---------- chemins ---------- */
.chemin { border-left: 5px solid var(--mer); }
.chemin:nth-child(2) { border-left-color: var(--terre); }
.chemin:nth-child(3) { border-left-color: var(--t-savoir); }
.chemin > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.chemin > summary::-webkit-details-marker { display: none; }
.chemin > summary h3 { margin: 0; }
.chemin .logique { color: var(--encre-2); font-size: .92rem; margin: 2px 0 0; }
.chemin[open] .chevron { transform: rotate(180deg); }
.partie { border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--sable); }
.partie h4 { margin: 0 0 4px; color: var(--encre); text-transform: none; letter-spacing: 0; font-size: 1rem; }
.renvois { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.colonnes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.timing { font-family: var(--mono); font-size: .85rem; background: var(--encre); color: #fff; padding: 6px 10px; border-radius: 8px; display: inline-block; }

/* ---------- questions ---------- */
.question { background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; }
.question > summary { cursor: pointer; font-weight: 700; display: flex; gap: .5em; align-items: flex-start; list-style: none; }
.question > summary::-webkit-details-marker { display: none; }
.question > summary .lucide { color: var(--terre); margin-top: .25em; }
.question[open] > summary { margin-bottom: 6px; }

/* ---------- chronologie ---------- */
.frise { list-style: none; padding: 0; margin: 0; position: relative; }
.frise::before { content: ""; position: absolute; left: 74px; top: 6px; bottom: 6px; width: 2px; background: var(--trait); }
.frise li { display: grid; grid-template-columns: 66px 1fr; gap: 22px; padding: 6px 0; position: relative; }
.frise li::before { content: ""; position: absolute; left: 69px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--terre); border: 2px solid var(--sable); }
.frise .an { font-weight: 800; text-align: right; color: var(--encre); }
.frise .ref { font-size: .76rem; color: var(--mer); font-weight: 600; margin-left: .4em; }

/* ---------- galerie ---------- */
.galerie { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.galerie figure { margin: 0; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.galerie button { padding: 0; border: 0; background: #eee; cursor: zoom-in; }
.galerie img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.galerie figcaption { padding: 8px 10px 10px; font-size: .84rem; color: var(--encre-2); }
.galerie figcaption b { color: var(--encre); display: block; margin-bottom: 2px; }

/* ---------- tableau sources ---------- */
.source-carte h3 { display: flex; gap: .45em; align-items: center; }
.source-carte .meta { font-size: .88rem; color: var(--encre-2); margin: 0 0 6px; }

/* ---------- checklist ---------- */
.checklist { list-style: none; padding: 0; }
.checklist label { display: flex; gap: .6em; align-items: flex-start; cursor: pointer; padding: 5px 0; }
.checklist input { width: 18px; height: 18px; margin-top: .2em; accent-color: var(--ok); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--encre-2); }

/* ---------- visionneuse ---------- */
dialog.visionneuse { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.visionneuse::backdrop { background: rgba(20, 26, 34, .86); }
dialog.visionneuse img { max-width: 96vw; max-height: 86vh; background: #fff; border-radius: 10px; }
dialog.visionneuse p { color: #fff; margin: 8px 4px 0; font-size: .9rem; max-width: 90vw; }
dialog.visionneuse .fermer { position: fixed; top: 14px; right: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px);
  background: var(--encre); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; opacity: 0; transition: .25s; pointer-events: none; z-index: 50;
  display: flex; gap: .5em; align-items: center;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.hors-ecran { position: fixed; left: -99999px; top: 0; width: 800px; }

footer { text-align: center; color: var(--encre-2); font-size: .85rem; padding: 30px 16px 50px; }

@media (max-width: 760px) {
  .carte-layout { grid-template-columns: 1fr; }
  .hero { padding: 40px 16px 30px; }
  .frise::before { left: 58px; }
  .frise li { grid-template-columns: 50px 1fr; }
  .frise li::before { left: 53px; }
}

@media print {
  .nav, .btn, .filtres, .onglets, .hero .actions, .toast { display: none !important; }
  .hero { background: none; color: var(--encre); padding: 0; }
  .consigne { border-color: var(--trait); }
  .panneau[hidden] { display: block !important; }
  details > *:not(summary) { display: block !important; }
  .carte-bloc { box-shadow: none; break-inside: avoid; }
}
