/* Sinjar, août 2014 — récit sur carte 3D (v11, 24/09/2026 : charte v5, audits technique et récit-design)
   Couleurs : brique #B85A44 = actions de l'État islamique ; ivoire (--lin) = population ; or (--or-clair) = lieu actif et interface. Jamais de vert. */
#sj { position: relative; color: var(--lin, #E7E0D2); background: #0a1826; --sj-g: clamp(20px, 4vw, 48px); --sj-brique: #B85A44; }

/* Scène : ciel de nuit avec lueur d'horizon, vignettage, grain */
.sj-stage {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 8%, rgba(221,187,116,.07) 0%, rgba(221,187,116,0) 45%),
    radial-gradient(90% 80% at 50% 35%, #1f3a52 0%, #11263a 45%, #0a1826 80%, #07111b 100%);
}
.sj-stage::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(110% 90% at 50% 50%, rgba(0,0,0,0) 55%, rgba(4,9,15,.55) 100%);
}
.sj-stage::after {
  content: ""; position: absolute; inset: -50%; z-index: 3; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.sj-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; opacity: 0; transition: opacity 1.6s ease; }
.sj--ready .sj-canvas { opacity: 1; }

/* Étiquettes : trait fin + nom, style éditorial */
.sj-labels { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; transition: opacity .5s ease; }
.sj-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; text-align: center; opacity: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.25;
  color: rgba(255,255,255,.9); text-shadow: 0 0 2px #000, 0 1px 4px rgba(0,0,0,.9), 0 0 12px rgba(0,0,0,.5);
  transition: opacity .5s ease, color .5s ease;
  padding-bottom: 14px;
}
.sj-label::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 12px; background: rgba(255,255,255,.55); }
.sj-label[data-a="g"] { text-align: right; padding-right: 7px; }
.sj-label[data-a="g"]::after { left: auto; right: 0; }
.sj-label[data-a="d"] { text-align: left; padding-left: 7px; }
.sj-label[data-a="d"]::after { left: 0; }
.sj-label b { display: block; font-weight: 800; }
/* Cyrillique : capitales plus larges, interlettrage réduit pour que les noms proches ne se chevauchent pas (v12) */
#sj[data-lang="ru"] .sj-label { letter-spacing: .05em; }
.sj-label span { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: none; color: rgba(255,255,255,.72); }
.sj-label span:empty { display: none; }
.sj-label.on { color: var(--or-clair, #DDBB74); font-size: 13px; }
.sj-label.on::after { background: var(--or-clair, #DDBB74); height: 16px; }
.sj-label.on span { color: #efdcb4; font-size: 11px; }
/* Noms de pays : repères discrets, en Spectral italique */
.sj-label--pays { padding: 0; }
.sj-label--pays b { font: italic 300 16px/1 var(--serif, Georgia, serif); letter-spacing: .3em; text-transform: uppercase; color: rgba(231,224,210,.62); text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.sj-label--pays::after { display: none; }
.sj-label--note { padding: 0; text-transform: none; letter-spacing: .02em; }
.sj-label--note b { font: italic 300 14px/1 var(--serif, Georgia, serif); color: #e2b3a6; }
.sj-label--note::after { display: none; }

/* Date courante, en grand, en bas à droite (ne recouvre plus les lieux) */
.sj-date {
  position: absolute; right: calc(var(--sj-g) + 56px); bottom: 56px; top: auto; z-index: 5; margin: 0;
  font: 300 clamp(30px, 3.4vw, 54px)/1 var(--serif, Georgia, serif); letter-spacing: -.01em; color: var(--lin, #E7E0D2);
  text-shadow: 0 4px 24px rgba(0,0,0,.45); pointer-events: none; text-align: right; max-width: 40vw; transition: opacity .5s;
}
.sj-date:empty { display: none; }
.sj--intro .sj-date { opacity: 0; }

/* Frise de progression */
.sj-rail { position: absolute; right: var(--sj-g); top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 14px; }
.sj-rail button { position: relative; width: 12px; height: 12px; padding: 0; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; background: transparent; cursor: pointer; transition: all .3s ease; }
.sj-rail button:hover { border-color: #fff; }
.sj-rail button:focus-visible { border-color: #fff; outline: 2px solid var(--or-clair, #DDBB74); outline-offset: 3px; }
.sj-rail button.on { background: var(--or-clair, #DDBB74); border-color: var(--or-clair, #DDBB74); transform: scale(1.25); }
.sj-rail span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff; opacity: 0; transition: opacity .2s ease; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.sj-rail button:hover span, .sj-rail button:focus-visible span { opacity: 1; }
@media (min-width: 801px) { .sj-labels { clip-path: inset(0 72px 0 0); } }

/* Légende : n'apparaît que pour les tracés du chapitre en cours */
.sj-legende { position: absolute; left: 12px; bottom: 32px; z-index: 5; margin: 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--lin-2, #A7B1BC); pointer-events: none; }
.sj-legende li { display: none; align-items: center; gap: 8px; margin: 4px 0 0; }
.sj-legende li::before { content: ""; width: 22px; height: 0; border-top: 1px dashed #f7f4ee; }
.sj-legende .l-front { display: flex; }
.sj--attaque .l-att, .sj--couloir .l-cou, .sj--siege .l-siege, .sj--captivite .l-capt { display: flex; }
.sj-legende .l-att::before, .sj-legende .l-capt::before { border-top: 3px solid var(--sj-brique); }
.sj-legende .l-capt::before { border-top-width: 2px; }
.sj-legende .l-siege::before { border-top: 2px dashed var(--sj-brique); }
.sj-legende .l-cou::before { border-top: 3px solid var(--lin, #E7E0D2); }
.sj--hommage .sj-legende, .sj--intro .sj-legende { opacity: 0; }

.sj-attrib { position: absolute; left: 12px; bottom: 10px; z-index: 5; margin: 0; font-size: 11px; color: rgba(255,255,255,.62); }
.sj-loading { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; color: #c9d2da; font-size: 15px; letter-spacing: .04em; }
.sj--ready .sj-loading, .sj--static .sj-loading { display: none; }

/* Chapitres qui défilent sur la carte */
.sj-chapters { position: relative; z-index: 10; margin-top: -100vh; margin-top: -100dvh; padding: 0 0 55vh; pointer-events: none; }
.sj-intro { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 120px var(--sj-g) 80px; pointer-events: none; }
.sj-intro::before { content: ""; position: absolute; inset: 0 0 -20vh; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(11,24,38,.94) 0%, rgba(11,24,38,.74) 40%, rgba(11,24,38,0) 72%);
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.sj-intro > * { max-width: 46rem; }
.sj-intro__kicker { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--or-clair, #DDBB74); }
.u-site #sj .sj-intro h1, #sj .sj-intro h1 { margin: 0; font: 300 clamp(56px, 8.5vw, 124px)/.95 var(--serif, Georgia, serif); letter-spacing: -.02em; color: var(--lin, #E7E0D2); text-shadow: none; }
.u-site #sj .sj-intro h1 em, #sj .sj-intro h1 em { font-style: italic; color: var(--or-clair, #DDBB74); }
.sj-intro__lead { margin: 28px 0 0; max-width: 40ch; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--lin, #E7E0D2); }
.sj-intro__warn { margin: 22px 0 0; max-width: 58ch; font-size: 14.5px; line-height: 1.6; color: var(--lin-2, #A7B1BC); border-left: 1px solid var(--or, #C8A15A); padding-left: 14px; }
.sj-intro__actions { margin: 22px 0 0; }
.sj-sans3d { pointer-events: auto; background: none; border: 0; border-bottom: 1px solid var(--or, #C8A15A); padding: 0 0 .2em; color: var(--lin, #E7E0D2); font: 600 .9rem/1.4 var(--sans, system-ui, sans-serif); cursor: pointer; }
.sj-sans3d:hover { border-bottom-color: var(--lin, #E7E0D2); }
.sj-scroll { margin-top: 40px; display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lin-2, #A7B1BC); }
.sj-scroll::after { content: ""; width: 1px; height: 46px; background: linear-gradient(var(--or-clair, #DDBB74), rgba(221,187,116,0)); animation: sj-drop 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes sj-drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.u-site .sj-chap, .sj-chap {
  pointer-events: auto; width: min(460px, calc(100% - 2 * var(--sj-g)));
  margin: 0 0 80vh var(--sj-g); padding: 28px 32px 22px;
  background: rgba(8,18,29,.9); border: 0; border-top: var(--filet, 1px solid rgba(200,161,90,.55)); border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity .6s ease, transform .6s ease;
}
.sj--ready .sj-chap:not(.on) { opacity: .28; transform: translateY(16px); }
.sj-chap:last-child { margin-bottom: 0; }
.sj-chap__date { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--or-clair, #DDBB74); }
.u-site #sj .sj-chap h2, #sj .sj-chap h2 { margin: 0 0 16px; font: 300 clamp(28px, 2.4vw, 36px)/1.1 var(--serif, Georgia, serif); letter-spacing: -.01em; color: var(--lin, #E7E0D2); }
.sj-chap__txt p { margin: 0 0 13px; font-size: 17px; line-height: 1.62; color: var(--lin, #E7E0D2); }
.sj-chap__fig { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 16px 0 6px; padding-top: 14px; border-top: var(--filet-sombre, 1px solid rgba(231,224,210,.14)); }
.sj-chap__fig > div { flex: 1 1 auto; max-width: 100%; }
.sj-chap__fig b { display: block; font: 300 34px/1 var(--serif, Georgia, serif); letter-spacing: 0; color: var(--lin, #E7E0D2); white-space: nowrap; }
.sj-chap__fig span { display: block; max-width: 22ch; margin-top: 6px; font-size: 12.5px; color: var(--lin-2, #A7B1BC); line-height: 1.35; }
.sj-src { margin-top: 12px; font-size: 13px; color: var(--lin-2, #A7B1BC); }
.sj-src summary { cursor: pointer; font-weight: 600; color: #cfd9e2; list-style: none; }
.sj-src summary::-webkit-details-marker { display: none; }
.sj-src summary::before { content: "+ "; color: var(--or-clair, #DDBB74); }
.sj-src[open] summary::before { content: "– "; }
.sj-src ul { margin: 8px 0 0 1.1em; padding: 0; }
.sj-src li { margin-bottom: 5px; line-height: 1.4; }
.sj-src li i { font-style: normal; color: #8795a3; }
.sj-src__h { margin: 12px 0 0 !important; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--or-clair, #DDBB74); }
.u-site .sj-src a { color: #dfe7ee; }
.sj-cert { margin: 8px 0 0; font-size: 12.5px; color: var(--lin-2, #A7B1BC); }

/* Chapitre final « En mémoire » */
.sj-fin__soleil { width: 36px; height: 36px; margin: 20px 0 8px; }
.sj-fin__liens { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin: 18px 0 10px !important; }
.sj-fin__asso { font-size: 13.5px; line-height: 1.55; color: var(--lin-2, #A7B1BC); }
.u-site #sj .sj-fin__asso a.lien { color: var(--lin, #E7E0D2); }
#sj .sj-chap--fin { border-top-color: var(--or-clair, #DDBB74); }

/* Mention « tracé schématique » du couloir */
.sj-note-couloir { position: absolute; left: 46%; bottom: 36px; z-index: 5; transform: translateX(-50%); margin: 0; max-width: min(400px, 30vw); padding: 8px 14px; border-left: 1px solid var(--or, #C8A15A); background: rgba(8,18,29,.82); color: var(--lin, #E7E0D2); font-size: 13px; line-height: 1.4; text-align: left; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.sj--couloir .sj-note-couloir { opacity: 1; }

/* Espacements : le thème impose des marges aux paragraphes des pages */
.u-page #sj + .uyf-block { border-top: 0; }
.u-page #sj p { margin: 0; }
.u-page #sj .sj-intro__kicker { margin: 0 0 18px; }
.u-page #sj .sj-intro__lead { margin: 28px 0 0; }
.u-page #sj .sj-intro__warn { margin: 22px 0 0; }
.u-page #sj .sj-intro__actions { margin: 22px 0 0; }
.u-page #sj .sj-scroll { margin-top: 40px; }
.u-page #sj .sj-chap__date { margin: 0 0 10px; }
.u-page #sj .sj-chap__txt p { margin: 0 0 13px; }
.u-page #sj .sj-cert { margin: 8px 0 0; }
.u-page #sj .sj-src ul { margin: 8px 0 0 1.1em; }
.u-page #sj .sj-fin__asso { margin: 0 0 6px; }

/* Sans WebGL, sans JavaScript ou en cas d'échec : le récit reste pleinement lisible */
.sj--static .sj-stage { background: #0e2233 url(relief-texture-768.jpg) center / cover no-repeat; }
.sj--static .sj-stage::before { background: rgba(8,18,29,.55); }
.sj--static .sj-canvas, .sj--static .sj-attrib, .sj--static .sj-rail, .sj--static .sj-date, .sj--static .sj-legende, .sj--static .sj-sans3d { display: none; }
.sj--static .sj-chap { opacity: 1; transform: none; background: rgba(8,18,29,.94); }

/* « Lire sans la carte » */
.sj--texte .sj-stage { display: none; }
.sj--texte .sj-chapters { margin-top: 0; padding-bottom: 64px; }
.sj--texte .sj-intro { min-height: auto; padding-top: 64px; }
.sj--texte .sj-intro::before { background: none; }
.sj--texte .sj-scroll { display: none; }
.u-site #sj.sj--texte .sj-chap, #sj.sj--texte .sj-chap { opacity: 1; transform: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; margin: 0 auto 28px; width: min(46rem, calc(100% - 2 * var(--sj-g))); }

@media (max-width: 800px) {
  .sj-date { display: none; }
  .sj-rail { display: none; }
  .sj-legende { display: none; }
  .sj-attrib { display: none; }   /* l'attribution figure dans « Méthode » */
  .sj-intro { padding-top: 96px; justify-content: flex-end; padding-bottom: 14vh; }
  .sj-intro::before { background: linear-gradient(0deg, rgba(11,24,38,.97) 0%, rgba(11,24,38,.84) 58%, rgba(11,24,38,0) 90%); }
  .u-site .sj-chap, .sj-chap { margin: 0 auto 110vh; padding: 20px 20px 16px; background: rgba(8,18,29,.93); }
  .sj-chap__txt p { font-size: 15.5px; line-height: 1.55; }
  .sj-chap__fig { gap: 16px; }
  .sj-chap__fig b { font-size: 26px; }
  .sj-label { font-size: 9.5px; }
  .sj-label span { display: none; }
  .sj-label.on { font-size: 11px; }
  .sj-label--pays b { font-size: 13px; letter-spacing: .24em; }
  /* Tant que l'intro est à l'écran, les étiquettes du relief chevaucheraient l'avertissement (sinjar.js pose .sj--intro) */
  .sj--intro .sj-labels { opacity: 0; }
  .sj-note-couloir { left: 12px; transform: none; top: auto; bottom: 41vh; max-width: 58vw; font-size: 11.5px; padding: 6px 10px; }
}
/* Téléphone en paysage : pas de frise ni de grande date par-dessus la carte */
@media (max-height: 500px) and (orientation: landscape) {
  .sj-rail, .sj-date, .sj-legende, .sj-attrib { display: none; }
  .sj-intro { padding-top: 32px; padding-bottom: 32px; }
  .u-site #sj .sj-intro h1, #sj .sj-intro h1 { font-size: 48px; }
  .sj-intro__lead { font-size: 16px; margin-top: 14px; }
  .u-site .sj-chap, .sj-chap { width: min(420px, 50vw); padding: 16px 20px 12px; margin-bottom: 110vh; }
  .sj-chap__txt p { font-size: 14.5px; line-height: 1.5; }
  .u-site #sj .sj-chap h2, #sj .sj-chap h2 { font-size: 24px; margin-bottom: 10px; }
  .sj-chap__fig b { font-size: 24px; }
  .sj-note-couloir { left: auto; right: 12px; transform: none; max-width: 42vw; bottom: 12px; top: auto; }
  .sj-label { font-size: 9.5px; } .sj-label.on { font-size: 10.5px; } .sj-label span, .sj-label--pays, .sj-label:not(.on) { display: none; }
  .sj-note-couloir { font-size: 11px; padding: 5px 9px; }
  .sj-chap__fig { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sj-chap, .sj-label, .sj-canvas, .sj-date { transition: none; }
  .sj--ready .sj-chap:not(.on) { transform: none; }
  .sj-scroll::after { animation: none; }
}

@media print {
  .sj-stage, .sj-scroll, .sj-intro__actions { display: none !important; }
  #sj, .sj-chapters { background: #fff !important; color: #000 !important; margin: 0 !important; padding: 0 !important; }
  .sj-intro { min-height: 0; padding: 0 0 12pt; }
  .sj-intro::before { display: none; }
  .u-site #sj .sj-intro h1, #sj .sj-intro h1 { color: #000; font-size: 32pt; }
  .u-site #sj .sj-intro h1 em, #sj .sj-intro h1 em { color: #6b4a00; }
  .sj-intro__kicker { color: #6b4a00; }
  .sj-intro__lead, .sj-intro__warn { color: #000 !important; }
  .u-site .sj-chap, .sj-chap, .sj--ready .sj-chap:not(.on) { opacity: 1 !important; transform: none !important; width: auto; margin: 0 0 14pt !important; padding: 8pt 0 0; background: none; border: 0; border-top: 1px solid #c8a15a; box-shadow: none; backdrop-filter: none; break-inside: avoid-page; }
  .u-site #sj .sj-chap h2, #sj .sj-chap h2, .sj-chap__txt p, .sj-chap__fig span, .sj-src, .sj-src summary, .u-site .sj-src a, .sj-cert, .sj-src li i, .sj-fin__asso, .sj-chap__fig b { color: #000 !important; }
  .sj-chap__date, .sj-src__h { color: #6b4a00; }
  .sj-src ul { display: block; }
  .sj-fin__soleil, .sj-fin__liens { display: none; }
}
