/* ===== Base ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
               Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
               "Segoe UI Emoji";
  line-height: 1.5;
  color: #0f172a; /* slate-900 */
  background: #f8fafc; /* slate-50 */
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.site {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0b1020; /* dark navy */
  color: #e5e7eb;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.brand .logo { font-size: 28px; }
.brand .title a { color: #fff; font-weight: 700; }
.brand .title small { display: block; color: #9ca3af; }

.nav { margin: 12px 0 24px; }
.nav-section {
  margin: 18px 0 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9ca3af;
}
.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: #e5e7eb;
}
.nav-link:hover { background: rgba(148,163,184,.15); }

.sidebar-foot {
  margin-top: auto;
  font-size: 12px;
  color: #94a3b8;
}
.sidebar-foot .muted { opacity: .7; }

.content {
  padding: 32px 28px;
  max-width: 980px;
}
.page {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(2,6,23,.06);
  padding: 28px 28px;
}
.page img { max-width: 100%; border-radius: 8px; }

.page-foot {
  margin: 18px 4px;
  color: #334155;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .site { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-bottom: 1px solid #111827; }
}

/* ===================================================================== */
/* =================== PATCH ANTI-DÉCALAGE /cmd (mobile) =============== */
/* ===================================================================== */

/* Bloque tout scroll horizontal global */
html, body, .site { overflow-x: hidden; }

/* Evite que la colonne contenu pousse le grid en largeur */
.site { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }

/* Sécurité : la zone article ne déborde pas et peut clipper l’overflow */
.content, .page {
  min-width: 0;
  overflow-x: clip; /* évite un scroll horizontal global */
}

/* Casse les très longues chaînes (URLs, mots collés, code inline) */
.page,
.page p,
.page li,
.page a,
.page code,
.page td,
.page th {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Blocs de code : ne débordent plus, wrap + scroll local si besoin */
.page pre {
  background: #0b1020;
  color: #e5e7eb;
  border: 1px solid #111827;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  white-space: pre-wrap;  /* empêche le dépassement horizontal */
  overflow-x: auto;       /* garde un scroll local si ligne très longue */
}
.page pre code { white-space: inherit; }

/* Tables fluides + scroll local en mobile (pas de scroll du body) */
.page table { width: 100%; border-collapse: collapse; }
.page th, .page td { padding: 10px; border: 1px solid #e2e8f0; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 880px) {
  .page table {
    display: block;
    overflow-x: auto;      /* le scroll reste confiné à la table */
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

/* Optionnel : assure que la zone contenu ne crée pas de largeur intrinsèque */
.content { width: 100%; }
