/* AnzarSeha — feuille de style du corpus éditorial.
   Reprend la charte de la vitrine et des documents juridiques : même police
   AnzarSans servie depuis la même adresse, mêmes jetons, mêmes cartes à
   ombre-anneau. Aucun appel à un tiers — la politique de sécurité du site
   interdit toute origine externe, et c'est très bien ainsi.

   Volontairement AUTONOME plutôt que dépendante de /legal/legal.css : les
   documents juridiques et le corpus éditorial évoluent à des rythmes
   différents, et une feuille partagée ferait qu'une retouche éditoriale
   pourrait casser une page juridique.

   Prend en charge les trois langues, dont l'arabe en écriture de droite à
   gauche : les marges internes sont exprimées en propriétés logiques
   (`padding-inline-start`), pas en gauche/droite, pour que la mise en page se
   retourne d'elle-même. */

@font-face {
  font-family: 'AnzarSans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/presentation/fonts/anzarsans.woff2) format('woff2');
}

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --fg: #0f172a;
  --muted-fg: #556278;
  --soft-fg: #5b6b81;
  --border: #e3e8ef;
  --muted: #eef2f7;
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --primary-soft: #eff6ff;
  --anzar: #0C4A6E;
  --seha: #0D9488;
  --blue-soft: #e0f2fe;
  --blue-fg: #0369a1;
  --radius-card: 16px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .05), 0 0 0 1px var(--border);
  --ring: #1d4ed8;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'AnzarSans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* L'arabe se lit mieux un cran plus grand et plus aéré : les diacritiques et
   les liaisons demandent de la hauteur de ligne, pas seulement de la chasse. */
html[lang="ar"] body { font-size: 17px; line-height: 1.85; }

.wrap { max-width: 776px; margin: 0 auto; padding: 0 24px; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  background: var(--card); color: var(--primary-strong);
  padding: 10px 16px; border-radius: 0 0 12px 0; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-card); text-decoration: none;
}
.skip:focus { inset-inline-start: 0; }

/* ── Barre supérieure ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-in {
  max-width: 776px; margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar-r { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--shadow-card); flex: none; }
.brand .wm { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.1; }
.brand .wm .a { color: var(--anzar); }
.brand .wm .s { color: var(--seha); }

.langs { display: inline-flex; align-items: center; gap: 2px; background: var(--muted); border-radius: 999px; padding: 2px; }
.langs .lg {
  font-size: 12px; font-weight: 600; text-decoration: none; color: var(--soft-fg);
  padding: 4px 10px; border-radius: 999px; line-height: 1.4;
}
.langs .lg:hover { color: var(--primary-strong); }
.langs .lg.is-on { background: var(--card); color: var(--anzar); box-shadow: var(--shadow-card); }

.topbar .home {
  font-size: 13px; font-weight: 600; color: var(--primary-strong); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 70%, transparent); white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.topbar .home:hover { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
@media (max-width: 560px) { .topbar .home { display: none; } }

/* ── En-tête du document ──────────────────────────────────────────────── */
.doc-head { padding: 30px 0 0; }
.crumb { font-size: 13px; color: var(--soft-fg); margin: 0; }
.crumb a { color: var(--primary-strong); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb [aria-current] { color: var(--soft-fg); }

h1 {
  font-weight: 800; font-size: clamp(29px, 5vw, 44px); line-height: 1.06;
  letter-spacing: -.03em; margin: 22px 0 0; color: var(--fg);
}
html[lang="ar"] h1 { letter-spacing: 0; line-height: 1.35; }

.meta {
  font-size: 11.5px; color: var(--soft-fg); margin: 16px 0 0;
  font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
html[lang="ar"] .meta { letter-spacing: 0; text-transform: none; font-size: 13px; }

.lead { font-size: clamp(16.5px, 1.6vw, 18.5px); line-height: 1.62; color: var(--muted-fg); margin: 18px 0 0; }
html[lang="ar"] .lead { line-height: 1.9; }

/* ── Sommaire ─────────────────────────────────────────────────────────── */
.toc { margin: 30px 0 0; border-radius: var(--radius-card); background: var(--card); padding: 20px 22px; box-shadow: var(--shadow-card); }
.toc h2 { font-size: 11px; color: var(--soft-fg); margin: 0 0 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
html[lang="ar"] .toc h2 { letter-spacing: 0; text-transform: none; font-size: 13px; }
.toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: 30px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.toc li { counter-increment: toc; font-size: 14.5px; margin: 0 0 8px; break-inside: avoid; }
.toc li a { color: var(--fg); text-decoration: none; border-bottom: 1px solid transparent; }
.toc li a::before {
  content: counter(toc, decimal-leading-zero); margin-inline-end: 9px;
  color: var(--primary); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
}
.toc li a:hover { border-bottom-color: var(--primary); }

/* ── Sections ─────────────────────────────────────────────────────────── */
main { padding: 24px 0 0; counter-reset: sec; }
section.art { padding: 34px 0; border-top: 1px solid var(--border); scroll-margin-top: 76px; }
section.art > h2 {
  counter-increment: sec; font-weight: 800; font-size: 21px; letter-spacing: -.02em;
  line-height: 1.25; margin: 0; display: flex; gap: 13px; align-items: baseline; color: var(--fg);
}
html[lang="ar"] section.art > h2 { letter-spacing: 0; line-height: 1.5; }
section.art > h2::before {
  content: counter(sec, decimal-leading-zero);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 23px; padding: 0 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none;
  transform: translateY(-2px);
}
section.art h3 { font-size: 16.5px; font-weight: 700; margin: 26px 0 0; color: var(--fg); letter-spacing: -.01em; }
section.art p { margin: 14px 0 0; color: var(--muted-fg); }
section.art strong { color: var(--fg); font-weight: 600; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85em;
  background: var(--blue-soft); color: var(--blue-fg); padding: 1px 6px; border-radius: 6px;
  direction: ltr; unicode-bidi: embed;
}

/* ── Listes — marges logiques, pour que l'arabe se retourne seul ──────── */
ul, ol.body { margin: 14px 0 0; list-style: none; display: grid; gap: 10px; }
ul li, ol.body li { position: relative; padding-inline-start: 24px; color: var(--muted-fg); font-size: 15.5px; }
ul li::before {
  content: ""; position: absolute; inset-inline-start: 3px; top: 10px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--seha);
}
ol.body { counter-reset: it; }
ol.body li { counter-increment: it; }
ol.body li::before {
  content: counter(it); position: absolute; inset-inline-start: 0; top: 1px;
  color: var(--primary); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
li strong { color: var(--fg); font-weight: 600; }

/* ── Tableaux ─────────────────────────────────────────────────────────── */
.tbl { margin: 18px 0 0; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); background: var(--card); }
.tbl-scroll { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl caption { text-align: start; padding: 12px 15px 0; font-size: 13px; color: var(--soft-fg); }
.tbl th, .tbl td { text-align: start; padding: 12px 15px; vertical-align: top; border-top: 1px solid var(--border); }
.tbl thead th {
  background: color-mix(in srgb, var(--primary-soft) 60%, var(--card));
  border-top: none; font-size: 10.5px; color: var(--soft-fg); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
}
html[lang="ar"] .tbl thead th { letter-spacing: 0; text-transform: none; font-size: 13px; }
.tbl tbody th { color: var(--fg); font-weight: 600; font-size: 14.5px; }
.tbl td { color: var(--muted-fg); }
.tbl td strong { color: var(--fg); }

/* ── Encadrés ─────────────────────────────────────────────────────────── */
.callout {
  margin: 18px 0 0; border-inline-start: 3px solid var(--primary); background: var(--card);
  border-radius: var(--radius-card); padding: 16px 19px; font-size: 15px; color: var(--muted-fg);
  box-shadow: var(--shadow-card);
}
.callout.green { border-inline-start-color: var(--seha); }
.callout strong { color: var(--fg); font-weight: 600; }

/* ── Figures ──────────────────────────────────────────────────────────── */
.shotfig { margin: 22px 0 0; }
.shotfig img {
  width: 100%; height: auto; display: block; border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); background: var(--muted);
}
.shotfig figcaption { font-size: 13px; color: var(--soft-fg); margin: 10px 0 0; }

/* ── Questions fréquentes ─────────────────────────────────────────────── */
.qa { margin: 16px 0 0; display: grid; gap: 10px; }
.qa details { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.qa summary { cursor: pointer; padding: 15px 19px; list-style: none; display: flex; align-items: center; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; margin-inline-start: auto; color: var(--primary); font-weight: 700; font-size: 18px;
  line-height: 1; flex: none;
}
.qa details[open] summary::after { content: "–"; }
.qa summary h3 { font-size: 15.5px; font-weight: 700; color: var(--fg); margin: 0; }
.qa .qa-a { padding: 0 19px 17px; }
.qa .qa-a p { margin: 0; color: var(--muted-fg); font-size: 15.5px; }

/* ── Sources ──────────────────────────────────────────────────────────── */
.srcs li { font-size: 15px; }

/* ── Liens contextuels ────────────────────────────────────────────────── */
.next { border-top: 1px solid var(--border); padding: 30px 0 0; margin-top: 6px; }
.next > h2 {
  font-size: 11px; color: var(--soft-fg); font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; margin: 0 0 14px;
}
html[lang="ar"] .next > h2 { letter-spacing: 0; text-transform: none; font-size: 13px; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards li { padding: 0; }
.cards li::before { display: none; }
.cards a {
  display: grid; gap: 5px; height: 100%; text-decoration: none;
  background: var(--card); border-radius: var(--radius-card); padding: 15px 17px;
  box-shadow: var(--shadow-card); transition: box-shadow .15s ease, transform .15s ease;
}
.cards a:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .09), 0 0 0 1px color-mix(in srgb, var(--primary) 25%, var(--border)); }
.cards .k { font-weight: 700; font-size: 15px; color: var(--fg); letter-spacing: -.01em; }
.cards .d { font-size: 13.5px; color: var(--soft-fg); line-height: 1.55; }

/* ── Liens en ligne, focus ────────────────────────────────────────────── */
a.inl { color: var(--primary-strong); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }
a.inl:hover { border-bottom-color: var(--primary); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }

/* ── Pied ─────────────────────────────────────────────────────────────── */
.doc-foot { border-top: 1px solid var(--border); margin-top: 30px; padding: 28px 0 64px; }
.doc-foot .nav { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; margin: 18px 0 0; }
.doc-foot .nav a { color: var(--primary-strong); text-decoration: none; }
.doc-foot .nav a:hover { text-decoration: underline; }
.doc-foot .fin { font-size: 12.5px; color: var(--soft-fg); margin: 0; line-height: 1.7; }
.doc-foot .fin + .fin { margin-top: 16px; }

@media print {
  body { background: #fff; }
  .topbar, .next, .skip { display: none; }
  .toc, .tbl, .callout, .qa details { box-shadow: none; border: 1px solid #ddd; }
  .qa details { display: block; }
}
