/* =========================================================
   THEME: Pounichka — edition.css
   Version réorganisée, claire et commentée
   Conserver l'ordre et les sections ; éviter les ajouts "essais" non validés.
   ========================================================= */

/* ===========================
   VARIABLES GLOBALES
   =========================== */
:root {
  --menu-blue: #004494;
  --bg-page: #f9f9f9;
  --step-bg: #ffffff;
  --text-color: #000;
  --step-border-radius: 10px;
  --step-box-shadow: 0 2px 6px rgba(0,0,0,0.10);
  --desktop-header-top-height: 50px;  /* bande haut */
  --desktop-header-bottom-height: 40px; /* bande sous */
  --desktop-header-total: calc(var(--desktop-header-top-height) + var(--desktop-header-bottom-height));
  --sidebar-width: 260px;
}

/* ===========================
   RESET / GLOBALS
   =========================== */
html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-color);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

a { color: var(--menu-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ===========================
   HEADER (STRUCTURE)
   =========================== */

/* Les trois bandes (2 desktop, 1 mobile) sont gérées via .desktop-only / .mobile-only */

.desktop-only { display: block; }
.mobile-only  { display: none; }

/* Desktop header - bande haute (nom du site) + bande inférieure (icônes / actions) */
#desktop-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

#desktop-header .banner-top {
  height: var(--desktop-header-top-height);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;
}

#desktop-header .banner-bottom {
  height: var(--desktop-header-bottom-height);
  width: 100%;
  background-color: #DDDDDD;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Mobile header: unique bande affichée sur mobiles */
#mobile-header {
  width: 100%;
  background-color: #DDDDDD;
  position: relative;
  z-index: 10001;
}

#mobile-header .mobile-banner {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
}

/* ===========================
   LAYOUT PRINCIPAL (SIDEBAR + CONTENT)
   =========================== */

/* Conteneur article (le template met id=primary et class tutoriel-container) */
#primary.tutoriel-container {
  display: block; /* on adapte via media queries */
  padding: 0;
}

/* Sidebar menu (menu dynamique créé à partir des <div class="step-content">) */
#sidebar {
  background: var(--menu-blue);
  color: #fff;
  z-index: 9999;
}

#menu-title {
  background: var(--menu-blue);
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
}

/* Liste d'items du menu */
#sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#sidebar ul li {
  padding: 10px 12px;
  cursor: pointer;
  color: #fff;
  background: var(--menu-blue);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
#sidebar ul li:hover { background: #003366; }
#sidebar ul li strong:first-child { font-weight: 700; }

/* Zone principale de contenu (articles) */
#content {
  padding: 0 20px;
  margin-bottom: -5px; 			/* espace avant footer */
}

/* Plain title block */
.plain-block {
  font-size: 28px;
  font-weight: 700;
  padding: 10px 0 20px 0;
  color: var(--text-color);
}

/* ===========================
   BLOCS D'ÉTAPES (step-content)
   =========================== */
.step-content {
  background: var(--step-bg);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: var(--step-border-radius);
  box-shadow: var(--step-box-shadow);
}

.step-content h2 {
  color: var(--menu-blue);
  font-size: 22px;
  margin: 0 0 5px 0;
}

.step-content ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
.step-content ul li::before {
  content: "✔";
  color: #00cc00;
  font-weight: bold;
  margin-right: 8px;
}

/* ===========================
   NAVIGATION ENTRE ARTICLES
   =========================== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.nav-previous a, .nav-next a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
}
.nav-previous a:hover, .nav-next a:hover { color: #0078D7; }

/* ===========================
   FOOTER (nouveau bloc .site-footer + container footer-edition.php)
   =========================== */
/* .site-footer : structure réutilisable */
.site-footer,
footer.site-footer,
#colophon {
  background: #DDDDDD;
  color: #000;
  text-align: center;
  padding: 12px 20px;
  box-sizing: border-box;
  margin-top: 1px;
}

/* zone intérieure max-width */
.site-footer .footer-inner,
footer .footer-inner,
#blog-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 4px 0;
  border-top: 1px solid #222;
}

/* ===========================
   ANCIENNE SECTION "HEADER BLOG" (désactivée mais conservée)
   ===========================
   On garde le bloc commenté pour référence ; ne pas supprimer sans validation.
   =========================== */
/*
#blog-header {
  width: 100%;
  background: #0a0a0a;
  color: white;
  padding: 10px 0;
  text-align: center;
  position: relative;
}

.banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.banner-title { ... }
.user-icon { ... }
...
*/

/* ===========================
   ANCIENNE SECTION "FOOTER BLOG" (désactivée mais conservée)
   =========================== */
/*
#blog-footer {
  width: 100%;
  background: #0a0a0a;
  color: white;
  padding: 15px 0;
  font-size: 0.9rem;
  border-top: 1px solid #222;
}
.footer-inner { ... }
*/

/* ===========================
   VERSION DESKTOP (>= 769px)
   =========================== */
@media (min-width: 769px) {

  /* Sidebar fixe à gauche */
  #sidebar {
    position: fixed;
    top: var(--desktop-header-total); /* sous les 2 bandes du header */
    left: 0;
    width: var(--sidebar-width);
    height: calc(100% - var(--desktop-header-total));
    overflow: auto;
    padding-top: 20px;
    box-sizing: border-box;
  }

  /* Content : décalé à droite de la sidebar et sous header */
  #content {
    margin-left: var(--sidebar-width);
    margin-top: var(--desktop-header-total);
    padding: 18px 28px;
  }

  /* Footer : aligné à droite du menu (prend largeur restante) */
  footer, .site-footer {
    position: relative;
    z-index: 1;
    background-color: #DDDDDD;
    text-align: center;
    padding: 15px 0;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
  }
}

/* ===========================
   VERSION MOBILE (<= 768px)
   =========================== */
@media (max-width: 768px) {

  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  /* Sidebar devient menu sticky en haut (accessible via #menu-title) */
  #sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 8px 0;
  }

  #menu-title {
    display: block !important;
    z-index: 1001;
  }

  #sidebar ul { display: none; }
  #sidebar ul.open { display: block !important; }

  /* Le contenu prend toute la largeur */
  #content {
    margin-left: 0;
    margin-top: 0;
    padding: 14px;
  }
  
  
  /* Footer mobile simplifié */
  footer, .site-footer {
    width: 100%;
    padding: 10px 12px;
    margin: 0;
  }
}

/* MENU MOBILE : forcer visibilité et superposition */
@media (max-width: 768px) {
  #sidebar ul.open {
    display: block !important;
    position: absolute;
    top: 100%;       /* juste en dessous du #menu-title */
    left: 0;
    width: 100%;
    background: var(--menu-blue);
    z-index: 1002;
  }

  #sidebar ul.open li {
    background: var(--menu-blue);
  }
  #sidebar { position: relative; }
}

@media (max-width: 768px) {
  /* Sidebar menu reste sticky en haut */
  #sidebar {
    position: sticky;
    top: 0;          /* toujours tout en haut */
    z-index: 1000;   /* au-dessus du contenu */
  }

  /* Le titre du menu reste visible en permanence */
  #menu-title {
    position: sticky;
    top: 0;
    z-index: 1002;   /* au-dessus de la bannière si nécessaire */
    background: var(--menu-blue);
  }

  /* Le ul du menu déroulé apparaît juste en dessous du titre */
  #sidebar ul.open {

    top: 100%;       /* sous le titre */
    left: 0;
    width: 100%;
    background: var(--menu-blue);
    z-index: 1001;
  }
}



/* ===========================
   UTILITAIRES
   =========================== */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ===========================
   FIN DU FICHIER
   =========================== */
