/* Siraj Remote — documentation : mise en page, thème clair/sombre, composants.
   Chargé après le CSS du site (intégré dans le <head>). Aucune ressource externe. */

:root {
  --d-bg: #F3F4F6; --d-surface: #FFFFFF; --d-text: #0F1623; --d-text-2: #4B5567;
  --d-line: #E3E6EB; --d-link: #0F1623; --d-link-deco: #F5B335; --d-accent: #F5B335;
  --d-accent-ink: #8A5A00; --d-side-bg: #FFFFFF;
  --d-note: #E8F0FF; --d-note-line: #8FB4FF; --d-note-ink: #1D4ED8;
  --d-warn: #FDECEA; --d-warn-line: #F2766B; --d-warn-ink: #B3261E;
  --d-tip: #FFF3D6; --d-tip-line: #F5B335; --d-tip-ink: #8A5A00;
  --d-step: #0F1623; --d-shadow: 0 1px 2px rgba(15,22,35,.06), 0 8px 24px -12px rgba(15,22,35,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --d-bg: #0B111C; --d-surface: #141D2B; --d-text: #E6EAF0; --d-text-2: #C9D1DE;
    --d-line: #263349; --d-link: #E6EAF0; --d-side-bg: #0F1623;
    --d-note: #16233A; --d-warn: #2A1A1C; --d-tip: #2A2412;
    --d-note-ink: #8FB4FF; --d-warn-ink: #F2766B; --d-tip-ink: #F5C25A;
    --d-accent-ink: #F5C25A; --d-step: #1E2A3D; --d-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --d-bg: #0B111C; --d-surface: #141D2B; --d-text: #E6EAF0; --d-text-2: #C9D1DE;
  --d-line: #263349; --d-link: #E6EAF0; --d-side-bg: #0F1623;
  --d-note: #16233A; --d-warn: #2A1A1C; --d-tip: #2A2412;
  --d-note-ink: #8FB4FF; --d-warn-ink: #F2766B; --d-tip-ink: #F5C25A;
  --d-accent-ink: #F5C25A; --d-step: #1E2A3D; --d-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

body.docs { background: var(--d-bg); color: var(--d-text); }
.docs a:hover { color: var(--d-accent-ink); }
.docs .site-header { color: var(--on-dark); }

/* ---------- Grille générale ---------- */
.docs-layout {
  max-width: 1400px; margin-inline: auto; padding: 0 24px 80px;
  display: grid; column-gap: 40px; align-items: start; justify-content: center;
  grid-template-columns: 280px minmax(0, 760px) 220px;
  grid-template-areas: "crumbs crumbs bar" "side main toc";
}
.docs-layout > .crumbs { grid-area: crumbs; }
.docs-layout > .docs-bar { grid-area: bar; }
.docs-layout > .docs-sidebar { grid-area: side; }
.docs-layout > .docs-article { grid-area: main; min-width: 0; }
.docs-layout > .docs-toc { grid-area: toc; }

.docs .crumbs { max-width: none; margin: 0; padding: 22px 0 18px; color: var(--d-text-2); }
.docs .crumbs a { color: var(--d-text-2); }
.docs .crumbs a:hover { color: var(--d-accent-ink); text-decoration: underline; }
.docs .crumbs li + li::before { color: var(--d-text-2); opacity: .6; }
.docs .crumbs [aria-current] { color: var(--d-text); font-weight: 600; }

.docs-bar { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding-top: 14px; padding-bottom: 12px; }
.docs-theme, .docs-menu-btn, .docs-sidebar-close {
  align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  font: 600 14px/1 var(--font-body); color: var(--d-text); background: var(--d-surface); border: 1px solid var(--d-line);
}
.docs-theme:hover, .docs-menu-btn:hover { border-color: var(--d-accent); }
.docs-theme { display: inline-flex; }
.docs-menu-btn, .docs-sidebar-close { display: none; }

/* ---------- Barre latérale ---------- */
.docs-sidebar {
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--d-side-bg); border: 1px solid var(--d-line); border-radius: 18px; padding: 14px 12px 16px;
  font-size: 15px; scrollbar-width: thin;
}
.docs-home-link { display: block; padding: 8px 10px; border-radius: 10px; font-weight: 700; text-decoration: none; margin-top: 8px; }
.docs-sidebar a { color: var(--d-text); text-decoration: none; }
.docs-sidebar a:hover { color: var(--d-accent-ink); background: color-mix(in srgb, var(--d-accent) 12%, transparent); }
.docs-sidebar a[aria-current="page"] { background: color-mix(in srgb, var(--d-accent) 22%, transparent); box-shadow: inset 3px 0 0 var(--d-accent); font-weight: 700; }
.docs-sec { margin-top: 4px; }
.docs-sec > summary {
  cursor: pointer; list-style: none; padding: 9px 10px; border-radius: 10px; font: 700 12.5px/1.2 var(--font-display);
  letter-spacing: .06em; text-transform: uppercase; color: var(--d-text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.docs-sec > summary::-webkit-details-marker { display: none; }
.docs-sec > summary::after { content: ""; width: 7px; height: 7px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-inline-end: 4px; }
.docs-sec[open] > summary::after { transform: rotate(-135deg); }
.docs-sec.is-current > summary { color: var(--d-text); }
.docs-sec ol { list-style: none; margin: 2px 0 6px; padding: 0; }
.docs-sec li a { display: block; padding: 7px 10px 7px 14px; border-radius: 8px; line-height: 1.35; }

/* ---------- Recherche ---------- */
.docs-search { position: relative; display: block; }
.docs-search[hidden] { display: none; }
.docs-search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 12px; border: 1px solid var(--d-line);
  background: var(--d-surface); color: var(--d-text); font: 500 15px var(--font-body);
}
.docs-search input::placeholder { color: var(--d-text-2); opacity: .8; }
.docs-search-ico { position: absolute; inset-inline-start: 13px; top: 13px; color: var(--d-text-2); pointer-events: none; }
.docs-results {
  list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; z-index: 30; inset-inline: 0; max-height: 70vh; overflow: auto;
  background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 14px; box-shadow: var(--d-shadow); text-align: start;
}
.docs-results[hidden] { display: none; }
.docs-results a { display: block; padding: 9px 11px; border-radius: 9px; text-decoration: none; color: var(--d-text); }
.docs-results a strong { display: block; font-size: 15px; }
.docs-results a small { display: block; color: var(--d-text-2); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.docs-results a small b { font-weight: 600; color: var(--d-accent-ink); }
.docs-results li[aria-selected="true"] a, .docs-results a:hover { background: color-mix(in srgb, var(--d-accent) 18%, transparent); }
.docs-results .docs-none { padding: 10px 12px; color: var(--d-text-2); font-size: 14px; }

/* ---------- Article ---------- */
.docs-article { font-size: 1.0625rem; line-height: 1.7; }
.docs-head h1 { font-weight: 800; font-size: 2.2rem; line-height: 1.12; letter-spacing: -0.03em; color: var(--d-text); }
.docs-summary { margin-top: 14px; font-size: 1.15rem; line-height: 1.6; color: var(--d-text-2); max-width: 62ch; }
.docs-platforms { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.docs-platforms li {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--d-surface); border: 1px solid var(--d-line); color: var(--d-text);
}
.docs-platforms li.is-off { opacity: .55; text-decoration: line-through; color: var(--d-text-2); }
.docs-platforms li.is-plan { background: var(--d-tip); border-color: var(--d-tip-line); color: var(--d-tip-ink); }

.docs-prose { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; max-width: 75ch; color: var(--d-text); }
.docs-prose > * { margin: 0; }
.docs-prose h2 { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--d-line); font-size: 1.6rem; font-weight: 700; line-height: 1.25; color: var(--d-text); }
.docs-prose h3 { margin-top: 12px; font-size: 1.2rem; font-weight: 700; color: var(--d-text); }
.docs-prose h2:first-child { margin-top: 0; }
.docs-prose :is(h2, h3) { position: relative; scroll-margin-top: 88px; }
.docs-prose .anchor { position: absolute; inset-inline-start: -1.1em; padding-inline: .3em; color: var(--d-text-2); text-decoration: none; opacity: 0; font-weight: 400; }
.docs-prose :is(h2, h3):hover .anchor, .docs-prose .anchor:focus-visible { opacity: 1; }
.docs-prose a { color: var(--d-link); font-weight: 600; text-decoration: underline; text-decoration-color: var(--d-link-deco); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.docs-prose a:hover { color: var(--d-accent-ink); }
.docs-prose a.anchor { text-decoration: none; }
.docs-prose a.ext { display: inline; }
.docs-prose .ext-icon { display: inline; vertical-align: -1px; margin-inline-start: 3px; }
.docs-prose strong { color: var(--d-text); }
.docs-prose ul { padding-inline-start: 1.3rem; display: flex; flex-direction: column; gap: 8px; }
.docs-prose li::marker { color: var(--d-accent-ink); font-weight: 700; }
.docs-prose li > ul { margin-top: 8px; }
.docs-prose li > p { margin-top: 6px; }

/* Étapes numérotées : pastilles marine, numéro ambre */
.docs-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.docs-steps > li { position: relative; padding-inline-start: 44px; min-height: 30px; counter-increment: step; }
.docs-steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--d-step); color: var(--d-accent); border: 1px solid var(--navy-line);
  font: 700 14px/1 var(--font-mono);
}
.docs-steps .step-result { margin-top: 8px; color: var(--d-text-2); }
.docs-steps > li > ul { margin-top: 8px; }

/* Touches */
.docs kbd { background: var(--navy-3); color: var(--on-dark); border: 1px solid var(--navy-line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-size: .86em; white-space: nowrap; }

/* Encadrés */
.callout { border-inline-start: 4px solid var(--c-line); background: var(--c-bg); border-radius: 0 12px 12px 0; padding: 14px 18px 14px 16px; font-size: 1rem; line-height: 1.6; }
.callout--note { --c-line: var(--d-note-line); --c-bg: var(--d-note); --c-ink: var(--d-note-ink); }
.callout--warning { --c-line: var(--d-warn-line); --c-bg: var(--d-warn); --c-ink: var(--d-warn-ink); }
.callout--tip { --c-line: var(--d-tip-line); --c-bg: var(--d-tip); --c-ink: var(--d-tip-ink); }
.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 700 12.5px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--c-ink); }
.callout, .callout p, .callout li { color: var(--d-text); }
.callout { display: block; }
.callout .callout-title { color: var(--c-ink); }
.callout > p + p, .callout > ul { margin-top: 8px; }
.callout > ul { padding-inline-start: 1.2rem; }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--d-line); background: var(--d-surface); -webkit-overflow-scrolling: touch; }
.docs-prose table { border-collapse: collapse; width: 100%; font-size: .96rem; line-height: 1.5; }
.docs-prose th, .docs-prose td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--d-line); vertical-align: top; }
.docs-prose tbody tr:last-child td { border-bottom: 0; }
.docs-prose thead th { background: var(--navy); color: var(--white); font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.docs-prose td:first-child { min-width: 9rem; }

/* Figures */
.docs-fig { margin: 8px 0; }
.docs-fig img { width: auto; max-width: 100%; height: auto; border: 1px solid var(--d-line); border-radius: 12px; box-shadow: var(--d-shadow); background: var(--d-surface); }
.docs-fig picture { display: block; }
.docs-fig--light-only img { padding: 0; }
:root[data-theme="dark"] .docs-fig--light-only img { padding: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .docs-fig--light-only img { padding: 6px; } }
.docs-fig figcaption { margin-top: 8px; font-size: .9rem; color: var(--d-text-2); text-align: center; }
.docs-shot-missing {
  display: grid; place-items: center; min-height: 160px; aspect-ratio: 16 / 9; max-height: 280px; border: 2px dashed var(--d-line); border-radius: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--d-line) 45%, transparent) 14px 15px); color: var(--d-text-2);
  font-size: .9rem; font-weight: 600; letter-spacing: .02em;
}

/* Listes de définitions (index de section, glossaire) */
.docs-index dt { font: 700 1.1rem/1.3 var(--font-display); margin-top: 22px; }
.docs-index dt:first-child { margin-top: 0; }
.docs-index dd { margin: 4px 0 0; color: var(--d-text-2); }
.docs-dl dt { font-weight: 700; margin-top: 10px; }
.docs-dl dd { margin: 2px 0 0; padding-inline-start: 1rem; }

/* Sommaire « Dans cet article » */
.docs-toc { position: sticky; top: 84px; font-size: 14px; line-height: 1.4; max-height: calc(100vh - 100px); overflow: auto; }
.docs-toc h2 { font: 700 12.5px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--d-text-2); margin-bottom: 10px; }
.docs-toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--d-line); }
.docs-toc a { display: block; padding: 5px 0 5px 12px; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--d-text-2); text-decoration: none; }
.docs-toc a:hover { color: var(--d-text); }
.docs-toc a.is-active { color: var(--d-text); font-weight: 700; border-inline-start-color: var(--d-accent); }
.docs-toc-inline { display: none; margin-top: 20px; background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 12px; padding: 4px 16px; font-size: 15px; }
.docs-toc-inline summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.docs-toc-inline ol { margin: 0 0 10px; padding-inline-start: 1.1rem; display: flex; flex-direction: column; gap: 6px; }
.docs-toc-inline a { color: var(--d-link); }

/* Précédent / suivant */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.docs-pager a {
  display: block; padding: 16px 18px; background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 14px; text-decoration: none;
  font-weight: 700; line-height: 1.35; color: var(--d-text); transition: border-color .15s, transform .15s;
}
.docs-pager a:hover { border-color: var(--d-accent); color: var(--d-text); }
.docs-pager a small { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--d-text-2); }
.docs-pager a[rel="next"] { text-align: end; grid-column: 2; }
.docs-pager a[rel="prev"] { grid-column: 1; }
.docs-meta { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--d-line); font-size: .9rem; color: var(--d-text-2); }

/* ---------- Accueil ---------- */
.docs-hero { background: radial-gradient(70% 90% at 82% 0%, rgba(245,179,53,.2) 0%, rgba(245,179,53,0) 60%), var(--navy); color: var(--on-dark); }
.docs-hero-in { max-width: 1100px; margin-inline: auto; padding: 0 24px 56px; position: relative; }
.docs-hero .crumbs { padding-top: 22px; color: var(--on-dark-3); }
.docs-hero .crumbs a { color: var(--on-dark-2); }
.docs-hero .crumbs a:hover { color: var(--amber); }
.docs-hero .crumbs li + li::before { color: #6B7A93; opacity: 1; }
.docs-hero .crumbs [aria-current] { color: var(--white); }
.docs-hero h1 { margin-top: 22px; font-weight: 800; font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.035em; color: var(--white); max-width: 18ch; }
.docs-hero-intro { margin-top: 18px; max-width: 68ch; font-size: 1.1rem; line-height: 1.65; color: var(--on-dark-2); }
.docs-hero-intro strong { color: var(--white); }
.docs-hero .docs-search { margin-top: 28px; max-width: 560px; }
.docs-hero .docs-search input { height: 52px; border-radius: 14px; background: #fff; color: #0F1623; border-color: #fff; }
.docs-hero .docs-search input::placeholder { color: #4B5567; }
.docs-hero .docs-search-ico { top: 17px; color: #4B5567; }
.docs-hero .docs-results { color: var(--d-text); }
.docs-hero-bar { position: absolute; inset-inline-end: 24px; top: 14px; }
.docs-hero .docs-theme { background: rgba(255,255,255,.08); border-color: #33425A; color: var(--white); }
.docs-hero .docs-theme:hover { border-color: var(--amber); }
.docs-home { max-width: 1100px; margin-inline: auto; padding: 24px 24px 96px; }
.docs-home-rest { max-width: 78ch; margin-top: 24px; }
.docs-home-h { margin-top: 48px; font-size: 1.7rem; font-weight: 800; color: var(--d-text); }
.docs-cards { display: grid; gap: 20px; margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.docs-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 18px; box-shadow: var(--d-shadow); }
.docs-card h3 { font-size: 1.25rem; font-weight: 700; }
.docs-card h3 a { color: var(--d-text); text-decoration: none; }
.docs-card h3 a:hover { color: var(--d-accent-ink); text-decoration: underline; text-decoration-color: var(--d-link-deco); text-decoration-thickness: 2px; }
.docs-card p { color: var(--d-text-2); font-size: .98rem; line-height: 1.55; }
.docs-card ul { list-style: none; padding: 12px 0 0; margin: 4px 0 0; border-top: 1px solid var(--d-line); display: flex; flex-direction: column; gap: 6px; font-size: .96rem; }
.docs-card ul a { color: var(--d-link); text-decoration: underline; text-decoration-color: var(--d-link-deco); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.docs-card-more { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: .95rem; color: var(--d-accent-ink); text-decoration: none; }
.docs-card-more:hover { text-decoration: underline; }

/* ---------- Largeurs intermédiaires ---------- */
@media (max-width: 1199px) {
  .docs-layout { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "crumbs bar" "side main"; column-gap: 32px; }
  .docs-toc { display: none; }
  .docs-toc-inline { display: block; }
}
@media (max-width: 899px) {
  .docs-layout { display: block; padding-inline: 16px; }
  .docs-bar { justify-content: space-between; padding-top: 0; }
  .docs-head h1 { font-size: 1.85rem; }
  .docs-prose .anchor { display: none; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager a[rel="next"], .docs-pager a[rel="prev"] { grid-column: auto; }
  .docs-hero-in, .docs-home { padding-inline: 16px; }
  .docs-hero-bar { position: static; margin-top: 18px; }
  .docs-sidebar-close { margin-bottom: 10px; }
  /* sans JS : sommaire empilé sous le fil d'Ariane ; avec JS : panneau coulissant */
  .docs-sidebar { position: static; max-height: none; margin-bottom: 24px; }
  .js .docs-sidebar {
    position: fixed; z-index: 1000; inset-block: 0; inset-inline-start: 0; width: min(88vw, 340px); max-height: none; margin: 0; border-radius: 0 18px 18px 0;
    transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; padding-top: 16px;
  }
  [dir="rtl"] .js .docs-sidebar { transform: translateX(102%); }
  .js .docs-sidebar.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
  .js .docs-menu-btn, .js .docs-sidebar-close { display: inline-flex; }
  .docs-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(5,8,14,.55); }
  .docs-backdrop[hidden] { display: none; }
}
@media (max-width: 599px) {
  .docs-pager { gap: 12px; }
  .docs-cards { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .docs-sidebar, .js .docs-sidebar.is-open, .docs-pager a, .docs-sec > summary::after { transition: none; }
}

/* ---------- Sélecteur de langue (même mécanisme que le site : select[data-lang-select]) ---------- */
.docs-lang {
  appearance: none; -webkit-appearance: none; height: 40px; padding: 0 34px 0 14px; border-radius: 12px; cursor: pointer;
  font: 600 14px/1 var(--font-body); color: var(--d-text); background: var(--d-surface) no-repeat right 11px center / 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  border: 1px solid var(--d-line);
}
.docs-lang:hover, .docs-lang:focus-visible { border-color: var(--d-accent); }
[dir=rtl] .docs-lang { background-position: left 11px center; padding: 0 14px 0 34px; }
.docs-hero .docs-lang { background-color: rgba(255,255,255,.08); border-color: #33425A; color: var(--white); }
.docs-hero .docs-lang:hover { border-color: var(--amber); }
.docs-hero .docs-lang option, .docs-lang option { background: #0F1623; color: #fff; }
.docs-hero-bar { display: flex; gap: 10px; align-items: center; }
