:root {
    --primary: #000000;
    --primary-dark: #1e3a8a;
    --h1-color: #1e3a8a;
    --h2-color: #333333;
    --gray-50: #f8f8f8;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-300: #d0d0d0;
    --gray-400: #c0c0c0;
    --gray-500: #909090;
    --gray-600: #707070;
    --gray-700: #505050;
    --gray-800: #303030;
    --gray-900: #000000;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --border-color: var(--gray-200);
}

[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --border-color: #404040;
    --h1-color: #3b82f6;
    --h2-color: #cccccc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
  }
  
  .updates-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
    max-width: 100%;
  }

.sidebar {
    width: 20rem;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--bg-primary);
    padding: 32px 0 0 0;
    z-index: 10;
    position: fixed;
    height: 90vh;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.25rem;
    padding: 0 2rem 1.5rem 2rem;
    letter-spacing: -1px;
}

.sommaire {
    padding: 0 2rem;
}

.sommaire a {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
}

.sommaire a:hover {
    background: var(--bg-secondary);
    color: var(--gray-700);
}

.sommaire a.active {
    background: var(--gray-100);
    color: var(--gray-700);
}

.sub-chapter-detail {
    padding-left: 1rem;
}

.content {
    flex: 1;
    padding: 2rem;
    margin-left: 20rem;
    background: var(--bg-primary);
    overflow-y: auto;
    text-align: left;
    box-sizing: border-box;
}

.markdown-content {
    max-width: 65ch;
    margin: 0 auto;
}

.content h1, .content h2, .content h3, .content h4 {
    text-align: left;
    margin-left: 0;
    padding-left: 0;
    color: var(--gray-700);
}

.content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--h1-color);
}

.content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--h2-color);
}

.content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    position: relative;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-bottom: 3px solid var(--gray-400);
    border-radius: 2px;
}

.content p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.95em;
}

.content pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.content ul,
.content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px auto;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content th,
.content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.content th {
    background: var(--bg-secondary);
}

blockquote {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--gray-900);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-style: italic;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

blockquote p {
    padding-left: 0;
    display: block;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

blockquote p:not(:last-child) {
    margin-bottom: 0.5rem;
}

  
  table {
    width: 100%; /* Utilise toute la largeur disponible */
    border-collapse: collapse; /* Supprime l'espacement entre les bordures des cellules */
    margin-bottom: 20px; /* Espacement après la table */
    background-color: #ffffff; /* Fond de la table */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Ombre portée légère pour la profondeur */
  }
  
  th, td {
    text-align: left; /* Alignement du texte dans les cellules */
    padding: 8px; /* Espacement interne dans les cellules */
    border-bottom: 1px solid #ddd; /* Bordure de séparation des lignes */
  }
  
  th {
    background-color: #f8f8f8; /* Fond des en-têtes de colonne */
    color: #333; /* Couleur du texte des en-têtes */
    font-weight: bold; /* Texte en gras pour les en-têtes */
  }
  
  tr:hover {
    background-color: #f5f5f5; /* Changement de fond au survol d'une ligne */
  }
  
  /* Style pour améliorer l'apparence des bordures de la table si nécessaire */
  table, th, td {
    border: 1px solid #ddd; /* Bordure légère autour de la table et des cellules */
  }
  
  /* Styliser les bordures et les rayures des lignes pour améliorer la lisibilité */
  /* Couleur de fond pour les lignes impaires */
  
  /*
  tbody tr:nth-child(odd) {
    background-color: #f9f9f9; 
  }
  */
  
  blockquote {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--gray-900);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-style: italic;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  blockquote p {
    padding-left: 0;
    display: block;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
  }

  blockquote p:not(:last-child) {
    margin-bottom: 0.5rem;
  }
  
.treeview, .treeview ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.tree-parent {
  position: relative;
  padding-left: 1.2em;
  font-weight: bold;
  margin-top: 1rem;
  cursor: pointer;
  color: var(--gray-700);
  padding: 0.25rem 0 0.25rem 1.2em;
  user-select: none;
}

.tree-parent::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 0.2em;
  font-size: 0.8em;
  transition: transform 0.2s;
  color: var(--gray-700);
}

.tree-parent.open::before {
  transform: rotate(90deg);
}

.tree-parent > ul {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.tree-sub-parent {
  position: relative;
  padding-left: 1.2em;
  font-weight: bold;
  margin-top: 0.5rem;
  cursor: pointer;
  color: var(--gray-700);
  user-select: none;
}
.tree-sub-parent::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 0.2em;
  font-size: 0.8em;
  transition: transform 0.2s;
  color: var(--gray-700);
}
.tree-sub-parent.open::before {
  transform: rotate(90deg);
}
.tree-sub-parent > ul {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  padding-left: 0.8rem;
  display: none;
}
.tree-sub-parent.open > ul {
  display: block;
}

.tree-child a {
  font-weight: normal;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.25rem;
  font-size: smaller;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
}

.tree-child a:hover {
  background: var(--bg-secondary);
  color: var(--gray-700);
}

.tree-child {
  position: relative;
}
.tree-child::before {
  content: '';
}

.mobile-header {
  display: none;
}

/* Overlay pour le menu mobile */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: 3.5rem;
    padding: 0 1rem;
    width: 100%;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  .mobile-header .logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-dark);
    padding: 0;
    margin: 0;
    letter-spacing: -0.5px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
  }

  .menu-toggle:active {
    color: var(--gray-900);
  }

  .menu-overlay {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 320px;
    height: 90vh;
    background: var(--bg-primary);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    border-right: 1px solid var(--border-color);
    padding-top: 3.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .sidebar .logo {
    padding: 1rem 1.5rem 1rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
  }

  .updates-wrapper {
    flex-direction: column;
  }

  .content {
    margin-left: 0;
    padding: 1rem 1rem 2rem 1rem;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .markdown-content {
    max-width: 100%;
    padding: 0 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .content h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .content h2 {
    font-size: 1.35rem;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.4;
  }

  .content h3 {
    font-size: 1.15rem;
    margin: 1.25rem 0 0.5rem;
    line-height: 1.4;
  }

  .content h4 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
  }

  .content p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  .content pre {
    margin: 0.75rem 0;
    padding: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.85rem;
    border-radius: 0.375rem;
  }

  .content code {
    word-break: break-word;
    font-size: 0.9em;
  }

  .content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem;
    margin: 1rem 0;
    max-width: 100%;
    border-collapse: collapse;
  }

  .content table th,
  .content table td {
    padding: 0.5rem 0.375rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  .content table th:first-child,
  .content table td:first-child {
    padding-left: 0.5rem;
  }
  
  .content table th:last-child,
  .content table td:last-child {
    padding-right: 0.5rem;
  }

  .content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 0.375rem;
  }

  .content ul,
  .content ol {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
  }

  .content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
  }

  .content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-left: 3px solid var(--gray-900);
  }

  .sommaire {
    padding: 0 1.5rem;
  }

  .sommaire a {
    padding: 0.5rem 0.25rem;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .tree-parent,
  .tree-sub-parent {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .tree-child {
    display: none;
  }

  .tree-child a {
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  body.menu-open .menu-overlay {
    opacity: 1;
    pointer-events: all;
  }

  .mermaid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    padding: 0.75rem;
  }
}

/* Améliorations pour très petits écrans */
@media (max-width: 480px) {
  .content {
    padding: 0.75rem;
  }

  .content h1 {
    font-size: 1.5rem;
  }

  .content h2 {
    font-size: 1.25rem;
  }

  .content h3 {
    font-size: 1.1rem;
  }

  .sidebar {
    max-width: 85%;
  }

  .mobile-header {
    height: 3rem;
    padding: 0 0.75rem;
  }

  .mobile-header .logo {
    font-size: 1rem;
  }
}
  
.mermaid {
  background: var(--bg-primary);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  text-align: center;
}
  