/* === Layout général du viewer Cyberflemme === */

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  display: flex; /* la couleur de texte vient des thèmes onelight*.css */
}

/* Palette One Light pour la nav */
:root {
  --onelight-fg:      #383a42;  /* texte principal */
  --onelight-blue:    #4078f2;  /* bleu (navigation) */
  --onelight-purple:  #a626a4;  /* violet */
  --onelight-orange:  #c18401;  /* orange */
  --onelight-green:   #50a14f;  /* vert */
  --onelight-yellow:  #e5c07b;  /* jaune */
}

/* Conteneur principal */
.layout {
  display: flex;
  width: 100%;
  position: relative;
  z-index: 1; /* contenu au-dessus du fond/GIF */
}

/* Sidebar de navigation */
.sidebar {
  width: 250px;
  padding: 15px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.1);
  color: var(--onelight-fg);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar h1 {
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 1rem;
  white-space: nowrap;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin-bottom: 0.4rem;
}

.sidebar button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sidebar button.active {
  font-weight: 200;
  text-decoration: underline;
}

/* Zone de texte markdown (#write) */
#write {
  flex: 1;
  max-width: 1000px;
  margin: 40px auto;
  padding: 24px;
  box-sizing: border-box;
  margin-top: 70px;  /* à ajuster si besoin selon la hauteur de la barre */

  color: var(--text-color);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

/* === Couche GIF fixe + bouton Dark/Light === */

#mutou2-layer {
  position: fixed;
  right: 10px;
  bottom: 10px;
  width: 150px;
  height: 150px;
  pointer-events: none;
  background-image: url('./op3.gif');
  background-repeat: no-repeat;
  background-size: contain;
  z-index: 10;
}

/* Bouton Dark/Light posé par-dessus le GIF */
.theme-toggle-btn {
  position: absolute;
  left: 0;
  bottom: 0;

  pointer-events: auto; /* le bouton reste cliquable */

  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.6);
  color: var(--onelight-fg);
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Séparateur et sous-titre pour la zone TOC */
.sidebar-separator {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 16px 0 10px;
}

/* Titres "Catégories" / "Navigation" = bleu (navigation) */
.sidebar-subtitle {
  color: var(--onelight-blue);
  font-size: 1.7rem;
  margin: 0 0 8px;
  opacity: 0.9;
}

/* === TOC (Navigation dans le document courant) === */

#toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 400;
}

#toc-list li {
  margin-bottom: 13px;
}

#toc-list li.toc-level-1 {
  margin-top: 2px;
}

/* Indentation par niveau de titre */
.toc-level-1 { padding-left: 0; }
.toc-level-2 { padding-left: 15px; }
.toc-level-3 { padding-left: 30px; }
.toc-level-4 { padding-left: 45px; }
.toc-level-5 { padding-left: 60px; }
.toc-level-6 { padding-left: 75px; }

#toc-list a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* H1 dans le TOC = bleu (navigation) */
#toc-list .toc-level-1 a {
  color: var(--onelight-blue);
  font-weight: 400;
}

/* H2 dans le TOC = texte normal */
#toc-list .toc-level-2 a {
  color: var(--onelight-fg);
}

/* H3 et plus dans le TOC = texte normal */
#toc-list .toc-level-3 a,
#toc-list .toc-level-4 a,
#toc-list .toc-level-5 a,
#toc-list .toc-level-6 a {
  color: var(--onelight-fg);
}

/* Survol dans le TOC */
#toc-list a:hover {
  color: var(--onelight-blue);
  text-decoration: underline;
}

/* === Normaliser la graisse uniquement dans les menus du viewer === */

/* 1) Menu des documents (boutons de la liste #doc-list) */
.sidebar #doc-list button {
  font-weight: 400 !important;
}

/* Bouton actif légèrement plus marqué */
.sidebar #doc-list button.active {
  font-weight: 600 !important;
}

/* 2) Sommaire des titres (TOC) */
.sidebar #toc-list,
.sidebar #toc-list li,
.sidebar #toc-list a {
  font-weight: 400 !important;
}

/* Catégories (noms de dossiers) */

.nav-category-toggle {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.2rem 0;
  cursor: pointer;
}

.sidebar .nav-category-toggle {
  color: var(--onelight-orange);   /* dossiers = orange */
  font-weight: 800;
  font-size: 1.4rem;
}

/* Liste des fichiers (docs) */
.nav-doc-list {
  margin-left: 0.9rem;
}

/* Fichiers : vert par défaut */
.sidebar .nav-doc-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 0;
  margin: 0;
  text-decoration: none;

  border: none;
  background: transparent;
  font: inherit;
  font-weight: 300;
  font-size: 0.95rem;

  color: var(--onelight-green);
}

/* Survol d’un fichier : vert souligné */
.sidebar .nav-doc-link:hover {
  color: var(--onelight-green);
  text-decoration: underline;
}

/* Fichier actif : jaune, plus marqué */
.sidebar .nav-doc-link.active-doc {
  color: var(--onelight-yellow);
  font-weight: 600;
  text-decoration: underline;
}
/* Barre doc précédente / suivante en haut, sur la largeur du contenu */
#doc-toolbar {
  position: fixed;
  top: 0;
  left: 250px;   /* largeur de la sidebar */
  right: 0;
  z-index: 20;

  display: none;               /* cachée par défaut */
  flex-direction: column;      /* boutons l'un en dessous de l'autre */
  gap: 4px;
  padding: 6px 16px;

  /* fond léger pour la lisibilité */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}

/* Boutons Précédent / Suivant, pleine largeur */
.doc-nav-btn {
  width: 100%;
  text-align: left;

  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: var(--onelight-fg);

  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.doc-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
