/* ===== Reset ===== */
* {
  box-sizing: border-box;
}

/* ===== Global ===== */
html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #edf2f7;
  color: #2d3748;
}

/* ===== Layout ===== */
body {
  margin: 0 auto;
  margin-left: 280px; /* espace pour la sidebar gauche */
  padding: 50px 60px 70px 80px;
  max-width: 980px;
}

/* ===== Sidebar de navigation (gauche) ===== */
nav#sitenav {
  position: fixed;
  top: 0;
  left: 0;
  width: 265px;
  height: 100vh;
  background: #1e293b;
  padding: 36px 18px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Titre de la sidebar */
nav#sitenav::before {
  content: "Navigation";
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #475569;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #334155;
}

div.sitenav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

div.sitenav + div.sitenav {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #334155;
}

span.navlink {
  display: block;
}

span.navlink-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
  margin-bottom: 5px;
}

nav#sitenav a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  background: #334155;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
  border-left: 3px solid #3b82f6;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

nav#sitenav a:hover {
  background: #475569;
  color: #f1f5f9;
  border-left-color: #60a5fa;
}

/* ===== Table des matières ===== */
nav#TOC {
  background: #ffffff;
  border-radius: 10px;
  padding: 22px 28px;
  margin: 30px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #3b82f6;
}

nav#TOC > ul {
  margin: 0;
  padding-left: 18px;
}

nav#TOC ul ul ul {
  display: none;
}

nav#TOC li {
  margin: 6px 0;
}

nav#TOC a {
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
}

nav#TOC a:hover {
  text-decoration: underline;
}

/* ===== Header du document ===== */
header#title-block-header {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px 40px;
  margin-bottom: 30px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
}

/* ===== Titres ===== */
h1 {
  font-size: 34px;
  margin-top: 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  color: #0f172a;
}

h2 {
  margin-top: 40px;
  color: #0f172a;
}

h3 {
  margin-top: 30px;
  color: #1e293b;
}

/* ===== Liens ===== */
a {
  color: #2563eb;
}

a:hover {
  text-decoration: underline;
}

/* ===== Images ===== */
img {
  max-width: 100%;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ===== Code ===== */
code {
  background: #e2e8f0;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

/* ===== Abstract ===== */
div.abstract {
  background: #f8fafc;
  border-radius: 8px;
  padding: 18px 22px;
  border-left: 4px solid #94a3b8;
  margin-top: 20px;
  color: #475569;
}

div.abstract-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

/* ===== Figures ===== */
figure {
  margin: 24px 0;
  text-align: center;
}

figcaption {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
  font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  body {
    margin-left: 0;
    padding: 24px 24px 90px 24px;
    max-width: 100%;
  }

  nav#sitenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 40vh;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 6px;
    overflow-y: auto;
  }

  nav#sitenav::before {
    display: none;
  }

  div.sitenav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  div.sitenav + div.sitenav {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}