/* Guide public (pages statiques générées par scripts/build-guides.mjs). Couleurs de l'espace connecté (v2/styles/tokens.css). */
:root {
  --bg: #f8fafc; --surface: #fff; --surface-2: #f1f5f9; --primary: #2563eb; --primary-2: #1d4ed8; --primary-muted: #dbeafe;
  --text: #0f172a; --text-2: #475569; --text-3: #64748b; --border: #e2e8f0; --border-strong: #cbd5e1;
  --success: #047857; --success-bg: #d1fae5; --warning: #b45309; --warning-bg: #fef3c7;
  --radius: 0.75rem; --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0.05em 0.35em; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0.6rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.top-guide { font-weight: 500; color: var(--text-2); padding: 0.35rem 0.75rem; border-radius: 0.5rem; background: var(--primary-muted); color: var(--primary-2); }
.spacer { flex: 1; }
.langs { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; font-size: 0.8rem; font-weight: 600; }
.langs a, .langs span { padding: 0.2rem 0.6rem; border-radius: 999px; color: var(--text-3); }
.langs span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.95rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); text-decoration: none; }

/* Fil d'Ariane */
.crumbs { max-width: 1280px; margin: 0 auto; padding: 0.9rem 1rem 0; font-size: 0.85rem; color: var(--text-3); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.crumbs li + li::before { content: '›'; margin-right: 0.35rem; color: var(--border-strong); }
.crumbs a { color: var(--text-3); }

/* Mise en page */
.layout { max-width: 1280px; margin: 0 auto; padding: 1rem; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 2rem; align-items: start; }
.layout.no-side { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
.side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; font-size: 0.9rem; padding-bottom: 1rem; }
.side details { border-bottom: 1px solid var(--border); padding: 0.35rem 0; }
.side summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0.25rem; list-style-position: outside; }
.side summary a { color: var(--text); }
.side ul { list-style: none; margin: 0.2rem 0 0.4rem; padding: 0 0 0 0.6rem; }
.side li a { display: block; padding: 0.25rem 0.6rem; border-radius: 0.4rem; color: var(--text-2); line-height: 1.35; }
.side li a:hover { background: var(--surface-2); text-decoration: none; }
.side a[aria-current='page'] { background: var(--primary-muted); color: var(--primary-2); font-weight: 600; }

/* Article */
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 2.5rem 2.5rem; }
.doc-head h1 { font-size: 2.1rem; line-height: 1.2; margin: 0.15rem 0 0.6rem; letter-spacing: -0.01em; }
.eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1rem; font-size: 0.85rem; color: var(--text-3); }
.lead { font-size: 1.12rem; color: var(--text-2); margin: 0 0 1.5rem; }
.level { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.55rem; border-radius: 999px; }
.level-beginner { background: var(--success-bg); color: var(--success); }
.level-advanced { background: var(--warning-bg); color: var(--warning); }

.toc { border: 1px solid var(--border); background: var(--surface-2); border-radius: 0.6rem; padding: 0.8rem 1.1rem; margin: 0 0 1.75rem; font-size: 0.92rem; }
.toc p { margin: 0 0 0.35rem; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 2rem; }
.toc li { break-inside: avoid; padding: 0.1rem 0; }
.toc li.d3 { padding-left: 1rem; font-size: 0.88rem; }

.prose h2 { font-size: 1.5rem; margin: 2.25rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.prose h2 .anchor, .prose h3 .anchor { margin-left: 0.4rem; color: var(--border-strong); opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0.5rem; }
.prose p, .prose li { color: #1e293b; }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose ol > li::marker { font-weight: 700; color: var(--primary); }
.prose blockquote { margin: 1.25rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--primary); background: #eff6ff; border-radius: 0 0.5rem 0.5rem 0; }
.prose blockquote p { margin: 0.25rem 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 0.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

.shot { margin: 1.5rem 0; }
.shot img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 0.6rem; box-shadow: var(--shadow); background: var(--surface-2); }
.shot figcaption { margin-top: 0.5rem; font-size: 0.86rem; color: var(--text-3); text-align: center; }

.related { list-style: none; padding: 0 !important; display: grid; gap: 0.5rem; }
.related li { margin: 0; display: flex; flex-direction: column; padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: 0.5rem; }
.related a { font-weight: 600; }
.related span { font-size: 0.88rem; color: var(--text-3); }

.cta { margin-top: 2.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: linear-gradient(135deg, #0a1730, #1e3a8a); color: #fff; }
.cta div { flex: 1; min-width: 240px; }
.cta strong { font-size: 1.1rem; }
.cta p { margin: 0.2rem 0 0; color: #cbd5e1; font-size: 0.95rem; }
.cta .btn.primary { background: #fff; color: var(--primary-2); border-color: #fff; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.pager a { display: flex; flex-direction: column; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 0.6rem; font-weight: 600; }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager small { font-weight: 500; color: var(--text-3); }
.pager .next { text-align: right; }

/* Index et catégories */
.cat h2 { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1.35rem; margin: 2rem 0 0.25rem; }
.cat h2 small { font-size: 0.8rem; font-weight: 500; color: var(--text-3); }
.cat > p { margin: 0 0 0.75rem; color: var(--text-2); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.cards a { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; height: 100%; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 0.6rem; color: var(--text); }
.cards a:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.card-title { font-weight: 650; line-height: 1.3; }
.card-desc { font-size: 0.88rem; color: var(--text-3); line-height: 1.45; }

.foot { max-width: 1280px; margin: 1rem auto 0; padding: 1.5rem 1rem 2.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; font-size: 0.85rem; color: var(--text-3); }
.foot a { color: var(--text-3); text-decoration: underline; }
.pick { padding: 4rem 1rem; text-align: center; font-size: 1.1rem; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; order: 2; }
  .doc { padding: 1.25rem 1.1rem 1.5rem; }
  .doc-head h1 { font-size: 1.7rem; }
  .toc ol { columns: 1; }
  .top-guide { display: none; }
}
@media (max-width: 520px) {
  .top .btn.primary { display: none; }
  .pager { grid-template-columns: 1fr; }
}
@media print {
  .top, .side, .cta, .pager, .crumbs, .foot, .toc { display: none; }
  .layout { display: block; }
  .doc { border: 0; box-shadow: none; padding: 0; }
}

/* Lien du lecteur NKE dans l'en-tête, encart de l'index */
.top-link { font-weight: 500; color: var(--text-2); padding: 0.35rem 0.6rem; border-radius: 0.5rem; }
.top-link:hover { background: var(--surface-2); text-decoration: none; }
.callout { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: var(--radius); }
.callout p { flex: 1; min-width: 240px; margin: 0; }
@media (max-width: 960px) { .top-link { display: none; } }
