/* ═══════════════════════════════════════════════════════════════════
   Fulgurite — Documentation publique
   Design basé sur preview.html · Charte brand-charter.md v1.0
   Strike. Save. Restore.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --color-storm:           #0d1b2a;
  --color-storm-light:     #1a2f45;
  --color-night:           #111827;
  --color-night-card:      #1a2535;
  --color-lightning:       #eea400;
  --color-lightning-hover: #d69500;
  --color-lightning-glow:  rgba(238, 164, 0, 0.30);
  --color-lightning-soft:  rgba(238, 164, 0, 0.12);
  --color-plasma:          #4fc3f7;
  --color-plasma-bg:       #e0f7fa;
  --color-plasma-soft:     rgba(79, 195, 247, 0.12);
  --color-glass:           #c9a96e;
  --color-sand:            #f5f0e8;
  --color-sand-alt:        #f9f6f0;
  --color-surface:         #ffffff;
  --color-success-bg:      #e0f7fa;
  --color-success-text:    #006064;
  --color-error:           #e63946;
  --color-error-bg:        #fee2e2;
  --color-error-text:      #991b1b;
  --color-warning:         #f59e0b;
  --color-warning-bg:      #fef3c7;
  --color-warning-text:    #92400e;
  --color-info:            #6b9fd4;
  --color-info-bg:         #dbeafe;
  --color-info-text:       #1e40af;
  --color-text:            #1f2937;
  --color-text-muted:      #6b7280;
  --color-text-strong:     #111827;
  --color-border:          #d1d5db;
  --color-border-soft:     rgba(13, 27, 42, 0.08);
  --color-border-dark:     #2d3f52;
  --font-heading:          'Nunito', sans-serif;
  --font-body:             'Montserrat', sans-serif;
  --font-mono:             ui-monospace, 'JetBrains Mono', 'Fira Code', monospace;
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md:        0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-lg:        0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-lightning: 0 0 16px rgba(238, 164, 0, 0.30);
  --shadow-plasma:    0 0 12px rgba(79, 195, 247, 0.25);
  --sidebar-width:    300px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--color-sand) 0%, #efe7dc 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
code, pre { font-family: var(--font-mono); }

/* ─── Layout principal ───────────────────────────────────────── */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.sidebar {
  background: linear-gradient(180deg, var(--color-storm) 0%, var(--color-night) 100%);
  color: var(--color-sand);
  padding: var(--space-8);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ─── Brand ──────────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex-shrink: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--color-lightning);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--color-lightning);
  border-radius: 1px;
}

.brand-mark::before {
  left: 9px;
  top: 7px;
  width: 4px;
  height: 26px;
}

.brand-mark::after {
  left: 11px;
  top: 11px;
  width: 18px;
  height: 4px;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  transform: rotate(-28deg);
  transform-origin: left center;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  line-height: 1.1;
  color: #fff;
  display: block;
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(245, 240, 232, 0.72);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Sidebar navigation ─────────────────────────────────────── */

.sidebar-section-title {
  font-family: var(--font-body);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 232, 0.55);
  margin: var(--space-6) 0 var(--space-3);
  flex-shrink: 0;
}

.sidebar-section-title:first-of-type {
  margin-top: 0;
}

.nav {
  display: grid;
  gap: 4px;
  flex-shrink: 0;
}

.nav a {
  color: rgba(245, 240, 232, 0.88);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.nav a.is-active,
.nav a.active {
  background: rgba(238, 164, 0, 0.12);
  border-color: rgba(238, 164, 0, 0.24);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--color-lightning);
  font-weight: 600;
}

.nav a:hover:not(.is-active):not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav .count {
  font-size: 0.72rem;
  color: rgba(245, 240, 232, 0.55);
  font-family: var(--font-mono);
  font-weight: 400;
  flex-shrink: 0;
}

.nav a.is-active .count,
.nav a.active .count {
  color: var(--color-lightning);
}

/* ─── Sidebar cards ──────────────────────────────────────────── */

.sidebar-cards {
  margin-top: auto;
  padding-top: var(--space-8);
  display: grid;
  gap: var(--space-3);
}

.sidebar-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

.sidebar-card .label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 232, 0.55);
  margin-bottom: var(--space-2);
}

.sidebar-card .value {
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.5;
}

/* ─── Overlay mobile ─────────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.sidebar-overlay.is-active {
  display: block;
  opacity: 1;
}

/* ─── Burger toggle ──────────────────────────────────────────── */

.sidebar-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-storm);
  color: var(--color-sand);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background 0.18s ease;
}

.sidebar-toggle:hover { background: var(--color-storm-light); }

.sidebar-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.sidebar-toggle[aria-expanded="true"] .sidebar-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.sidebar-toggle[aria-expanded="true"] .sidebar-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.sidebar-toggle[aria-expanded="true"] .sidebar-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Main ────────────────────────────────────────────────────── */

.main {
  padding: var(--space-8);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* ─── Topbar ─────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.search-input::placeholder { color: var(--color-text-muted); }

.search-input:focus {
  background: #fff;
  border-color: rgba(13, 27, 42, 0.25);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(13, 27, 42, 0.06);
}

/* Masquer le X natif de type="search" */
.search-input::-webkit-search-cancel-button { display: none; }

/* ─── Search dropdown ────────────────────────────────────────── */

.search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

.search-panel:empty { display: none; }

.search-loading,
.search-empty {
  padding: var(--space-4) var(--space-6);
  color: var(--color-text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.search-loading::before { content: ''; }

/* Résultat individuel */
.search-result {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
  cursor: pointer;
}

.search-result:last-child { border-bottom: 0; }

.search-result:hover,
.search-result.is-focused {
  background: var(--color-sand-alt);
}

.search-result__title {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-strong);
  line-height: 1.4;
}

.search-result__desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result__sections {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.search-result__section {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-sand);
  border: 1px solid var(--color-border-soft);
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.search-result__section:hover {
  background: var(--color-lightning-soft);
  color: var(--color-storm);
  border-color: rgba(238, 164, 0, 0.25);
}

/* Highlight du terme recherché */
.search-panel mark {
  background: var(--color-lightning-soft);
  color: var(--color-storm);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ─── Language switcher ──────────────────────────────────────── */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(13, 27, 42, 0.06);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: calc(var(--radius-md) - 2px);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.lang-option.is-active {
  background: var(--color-surface);
  color: var(--color-storm);
  box-shadow: var(--shadow-sm);
}

.lang-option:hover:not(.is-active) {
  color: var(--color-storm);
  background: rgba(13, 27, 42, 0.04);
}

.button-primary,
.button-secondary {
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button-primary {
  background: var(--color-lightning);
  color: var(--color-night);
  box-shadow: var(--shadow-md);
}

.button-primary:hover {
  background: var(--color-lightning-hover);
  box-shadow: var(--shadow-lightning);
}

.button-secondary {
  background: transparent;
  color: var(--color-storm);
  border-color: var(--color-border);
}

.button-secondary:hover {
  background: rgba(13, 27, 42, 0.05);
  border-color: rgba(13, 27, 42, 0.2);
}

.docs-dev-link {
  background: var(--color-lightning-soft);
  border-color: rgba(238, 164, 0, 0.26);
  color: var(--color-storm);
  font-weight: 700;
}

.docs-dev-link:hover {
  background: rgba(238, 164, 0, 0.18);
  border-color: rgba(238, 164, 0, 0.4);
  box-shadow: var(--shadow-sm);
}

/* ─── Hero (page index) ──────────────────────────────────────── */

.hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-storm) 0%, #10253d 58%, #0f1d2e 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: 60px;
  top: 38px;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-lightning), transparent);
  transform: rotate(-18deg);
  opacity: 0.7;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: var(--space-8);
  padding: var(--space-12);
}

.hero-content {}

.hero h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  line-height: 1.1;
  max-width: 18ch;
  color: #fff;
}

.hero h1 em,
.hero h1 span {
  color: var(--color-lightning);
  font-style: normal;
}

.hero .baseline {
  margin-top: var(--space-4);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-lightning);
  font-size: 0.9rem;
}

.hero p {
  margin: var(--space-4) 0 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  max-width: 62ch;
  font-size: 0.95rem;
}

.hero-side {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.metric-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.metric-card .meta {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card .big {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: #fff;
  line-height: 1;
}

.metric-card .desc {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Eyebrow ─────────────────────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.eyebrow--plasma {
  background: rgba(79, 195, 247, 0.12);
  border: 1px solid rgba(79, 195, 247, 0.28);
  color: var(--color-plasma);
}

.eyebrow--lightning {
  background: var(--color-lightning-soft);
  border: 1px solid rgba(238, 164, 0, 0.24);
  color: var(--color-lightning);
}

/* Sur fond sombre, plasma par défaut */
.hero .eyebrow { background: rgba(79,195,247,0.12); border: 1px solid rgba(79,195,247,0.28); color: var(--color-plasma); }

/* Sur fond clair, lightning par défaut */
.page-header .eyebrow,
.card .eyebrow,
.article .eyebrow { background: var(--color-lightning-soft); border: 1px solid rgba(238,164,0,0.22); color: #7f5200; }

/* ─── Page header (pages de contenu, hors index) ─────────────── */

.page-header {
  margin-bottom: var(--space-2);
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.1;
  color: var(--color-storm);
}

.page-header h1 span,
.page-header h1 em {
  color: var(--color-lightning);
  font-style: normal;
}

.page-header p {
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 78ch;
  font-size: 0.96rem;
}

.page-header .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--space-4);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(13, 27, 42, 0.06);
  border: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
}

/* ─── Cards grid (index) ─────────────────────────────────────── */

.section-title {
  margin: 0 0 var(--space-6);
  font-family: var(--font-heading);
  color: var(--color-storm);
  font-size: 1.55rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: var(--space-8);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.card h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--color-storm);
}

.card p.lead {
  margin: 0 0 var(--space-6);
  color: var(--color-text-muted);
  line-height: 1.7;
  font-size: 0.93rem;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.doc-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: linear-gradient(180deg, #fff 0%, #fcfbf8 100%);
}

.doc-item .kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.doc-item h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-night);
}

.doc-item p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--color-sand-alt);
  color: var(--color-storm);
  border: 1px solid #ece3d6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-badge--success { background: var(--color-success-bg); color: var(--color-success-text); }
.status-badge--running { background: var(--color-success-bg); color: var(--color-success-text); box-shadow: var(--shadow-plasma); animation: pulse-plasma 1.8s ease-in-out infinite; }
.status-badge--warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.status-badge--error   { background: var(--color-error-bg);   color: var(--color-error-text);   }

@keyframes pulse-plasma {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 195, 247, 0.55); }
  50%       { box-shadow: 0 0 0 6px rgba(79, 195, 247, 0); }
}

/* ─── Timeline ────────────────────────────────────────────────── */

.timeline {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-sand-alt);
  border: 1px solid #ebe4da;
}

.timeline-track {
  position: relative;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-storm), var(--color-lightning), var(--color-storm));
  transform: translateY(-50%);
  opacity: 0.35;
}

.timeline-node {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--color-lightning);
  border: 2px solid #fff;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(238, 164, 0, 0.14);
}

.timeline-node.now {
  background: var(--color-plasma);
  box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.16);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* ─── Mini list (sidebar-style) ───────────────────────────────── */

.mini-list {
  display: grid;
  gap: 0;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.mini-row:last-child { border-bottom: 0; }

.mini-row .title {
  font-weight: 600;
  color: var(--color-night);
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.mini-row .sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.mini-row .time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Variante spans (mini-label / mini-value) */
.mini-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.mini-value {
  font-size: 0.85rem;
  color: var(--color-night);
  text-align: right;
  line-height: 1.5;
}

/* ─── Definition list (glossaire) ────────────────────────────── */

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.definition-item {
  background: rgba(13, 27, 42, 0.025);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border-left: 3px solid var(--color-lightning);
}

.definition-item h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-storm);
}

.definition-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ─── Content layout (article + aside) ───────────────────────── */

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-8);
  align-items: start;
}

/* ─── Article ─────────────────────────────────────────────────── */

.article {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
  min-width: 0;
}

.article h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-storm);
  margin: 0 0 var(--space-4);
}

.article h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-storm);
  margin: var(--space-8) 0 var(--space-3);
}

.article h3:first-child { margin-top: 0; }

.article p,
.article li {
  color: var(--color-text);
  line-height: 1.8;
  font-size: 0.95rem;
}

.article p { margin: 0 0 var(--space-4); }
.article p:last-child { margin-bottom: 0; }

.article ul,
.article ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.4rem;
}

.article ul { list-style: disc; }
.article ol { list-style: decimal; }

.article li + li { margin-top: 6px; }

.article strong { color: var(--color-text-strong); }

/* Sections dans article (pas de fond propre — héritent du blanc) */
.article section,
.content-section {
  padding: 0;
  margin-bottom: var(--space-8);
  scroll-margin-top: var(--space-8);
  background: none;
  border: none;
  box-shadow: none;
}

.article section:last-child,
.content-section:last-child { margin-bottom: 0; }

/* Grilles dans article */
.comparison-grid,
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

/* Cartes dans article */
.content-card {
  background: rgba(13, 27, 42, 0.025);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.content-card h3 {
  margin: 0 0 var(--space-3) !important;
  font-size: 0.98rem !important;
}

/* Listes stylisées dans article */
.check-list,
.plain-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
  display: grid;
  gap: 8px;
}

.check-list li,
.plain-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.65;
}

.check-list li::before,
.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-lightning);
}

/* Step list */
.step-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
  display: grid;
  gap: 12px;
  counter-reset: doc-step;
}

.step-list li {
  position: relative;
  padding: 16px 16px 16px 64px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: rgba(13, 27, 42, 0.02);
  line-height: 1.65;
}

.step-list li::before {
  counter-increment: doc-step;
  content: counter(doc-step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--color-lightning-soft);
  color: #7f5200;
  border: 1px solid rgba(238, 164, 0, 0.2);
}

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(13, 27, 42, 0.03);
  border: 1px solid var(--color-border-soft);
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-lightning);
  line-height: 1;
}

.stat-card__label {
  margin-top: 8px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Callouts ────────────────────────────────────────────────── */

.callout {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  padding: var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-info-text);
  font-size: 0.91rem;
  line-height: 1.65;
  margin: var(--space-6) 0;
}

.callout--info {
  background: var(--color-info-bg);
  border-left-color: var(--color-info);
  color: var(--color-info-text);
}

.callout--warn {
  background: var(--color-warning-bg);
  border-left-color: var(--color-warning);
  color: var(--color-warning-text);
}

.callout--danger {
  background: var(--color-error-bg);
  border-left-color: var(--color-error);
  color: var(--color-error-text);
}

.callout--ok {
  background: #e8faf1;
  border-left-color: #1a9d5c;
  color: #146b3e;
}

.callout a { text-decoration: underline; color: inherit; }

/* ─── Tables ─────────────────────────────────────────────────── */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-4) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.reference-table,
.matrix-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  font-size: 0.9rem;
  margin: 0;
  border: none;
  box-shadow: none;
}

.reference-table th,
.reference-table td,
.matrix-table th,
.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.reference-table th,
.matrix-table th {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: rgba(13, 27, 42, 0.04);
}

.reference-table tbody tr:nth-child(even),
.matrix-table tbody tr:nth-child(even) {
  background: #fcfbf8;
}

.reference-table tbody tr:last-child td,
.matrix-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ─── Bouton raccourcis ──────────────────────────────────────── */

.shortcuts-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  flex-shrink: 0;
}

.shortcuts-trigger:hover {
  background: rgba(13, 27, 42, 0.06);
  color: var(--color-storm);
  border-color: rgba(13, 27, 42, 0.2);
}

/* ─── Panneau raccourcis ─────────────────────────────────────── */

.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: overlayIn 0.18s ease;
}

.shortcuts-overlay[hidden] { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.shortcuts-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 440px;
  animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border-soft);
}

.shortcuts-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: 0.01em;
}

.shortcuts-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.shortcuts-close:hover {
  background: rgba(13, 27, 42, 0.06);
  color: var(--color-text-strong);
}

.shortcuts-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.shortcuts-group {
  padding: var(--space-2) 0;
}

.shortcuts-group + .shortcuts-group {
  border-top: 1px solid var(--color-border-soft);
  padding-top: var(--space-3);
  margin-top: var(--space-2);
}

.shortcuts-group-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.875rem;
  color: var(--color-text);
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.shortcut-sep {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  padding: 0 2px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  background: var(--color-sand);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-strong);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* ─── Code ────────────────────────────────────────────────────── */

pre,
.code-block {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-night);
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid var(--color-border-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }

code,
.code-inline {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-text-strong);
  border: 1px solid rgba(13, 27, 42, 0.08);
}

/* ─── Aside (ToC + metadata) ──────────────────────────────────── */

.article-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: var(--space-8);
  align-self: start;
}

.toc,
.aside-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  backdrop-filter: blur(6px);
}

.toc h3,
.aside-card h3 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--color-storm);
}

.toc a {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid #ede7de;
  font-size: 0.9rem;
  transition: color 0.14s ease, padding-left 0.14s ease;
}

.toc a:last-child { border-bottom: 0; }

.toc a:hover,
.toc a.is-active {
  color: var(--color-lightning);
  padding-left: 4px;
}

/* ─── Page footer & pager ────────────────────────────────────── */

.page-footer {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.page-footer h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-storm);
}

.page-footer p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.pager a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(13, 27, 42, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-strong);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.pager a:hover {
  background: var(--color-lightning-soft);
  border-color: rgba(238, 164, 0, 0.3);
  box-shadow: var(--shadow-lightning);
}

.pager a span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.pager a.pager__prev span::before { content: '← '; }
.pager a.pager__next { text-align: right; }
.pager a.pager__next span::after { content: ' →'; }

/* ─── Footer note ─────────────────────────────────────────────── */

.footer-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  padding: var(--space-4) 0;
}

.footer-note a { color: var(--color-lightning); }

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1280px) {
  :root { --sidebar-width: 260px; }

  .hero-grid { grid-template-columns: 1.3fr 1fr; padding: var(--space-8); }

  .grid-2 { grid-template-columns: 1fr; }

  .content-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--space-6);
  }

  .card-grid-3,
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  /* Le .app n'a plus besoin de colonne sidebar */
  .app { grid-template-columns: 1fr; }

  /* Sidebar → tiroir fixe hors-écran */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .sidebar.is-open { transform: translateX(0); }

  .main {
    padding: var(--space-4) var(--space-6) var(--space-6);
  }

  .topbar {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .topbar-search {
    order: 2;
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar-actions {
    order: 1;
    margin-left: auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .content-layout { grid-template-columns: 1fr; }

  .article-aside { position: static; }

  .hero-grid,
  .grid-2 { grid-template-columns: 1fr; }

  .hero-side { display: none; }

  .sidebar-toggle { display: flex; }
}

@media (max-width: 720px) {
  .main {
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .hero h1 { font-size: 1.7rem; }

  .sidebar-toggle { order: 0; }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    row-gap: var(--space-2);
  }

  .topbar-actions .button-secondary { display: none; }
  .topbar-actions .docs-dev-link { display: inline-flex; }

  .comparison-grid,
  .card-grid-2,
  .card-grid-3,
  .definition-list,
  .stats-strip,
  .pager,
  .doc-grid { grid-template-columns: 1fr; }
}
