/* =========================================================
   module-nodejs.css — Module Node.js & Express
   MonMiniLab
   Couleur accent : vert Node.js #68a063
   ========================================================= */

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

:root {
  --navy:   #09183a;
  --navy2:  #122050;
  --blue:   #0052e0;
  --white:  #ffffff;
  --off:    #f4f6fb;
  --text:   #1a2744;
  --muted:  #6b7a99;
  --border: #dde3f0;
  --accent: #68a063;
  --accent2: #3d7a39;
  --accent-bg: #f0fdf4;
}

html { scroll-behavior: smooth; }
body { font-family: 'IBM Plex Sans', sans-serif; background: var(--white); color: var(--text); line-height: 1.7; }

nav:not(.lesson-nav) {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  padding: 0 2.5rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--white); text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.nav-pip { width: 28px; height: 28px; border-radius: 7px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.nav-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.nav-breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; }
.nav-breadcrumb a:hover { color: var(--white); }
.nav-breadcrumb strong { color: rgba(255,255,255,0.85); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: rgba(255,255,255,0.55); font-size: 0.82rem; text-decoration: none; transition: color 0.15s; }
.nav-link:hover { color: var(--white); }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 60px); }

.sidebar { background: var(--off); border-right: 1px solid var(--border); padding: 1.5rem 0; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar-back { display: block; padding: 0.4rem 1.25rem 0.9rem; font-size: 0.8rem; color: var(--muted); text-decoration: none; transition: color 0.12s; }
.sidebar-back:hover { color: var(--accent); }
.sidebar-title { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 1.25rem; margin-bottom: 0.75rem; }
.chapter-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.62rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 1rem 1.25rem 0.4rem; }
.lesson-link { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 1.25rem; font-size: 0.82rem; color: var(--text); text-decoration: none; line-height: 1.4; transition: background 0.12s, color 0.12s; border-left: 2px solid transparent; }
.lesson-link:hover { background: #bbf7d0; color: var(--accent); }
.lesson-link.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.lesson-link.overview { font-weight: 600; }
.lesson-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex-shrink: 0; transition: background 0.12s; }
.lesson-link.active .lesson-dot, .lesson-link:hover .lesson-dot { background: var(--accent); }

.main { padding: 2.5rem 4rem; }

.lesson-header { margin-bottom: 2rem; }
.lesson-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.lesson-header h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--navy); }
.lesson-header h1 span { color: var(--accent); }

.lesson-content h2 { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin: 2rem 0 0.75rem; letter-spacing: -0.01em; }
.lesson-content h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 1.5rem 0 0.5rem; }
.lesson-content p { margin-bottom: 1rem; font-size: 0.93rem; }
.lesson-content ul, .lesson-content ol { margin: 0 0 1rem 1.3rem; font-size: 0.93rem; }
.lesson-content li { margin-bottom: 0.3rem; }

.info-box { display: flex; gap: 1rem; align-items: flex-start; background: var(--accent-bg); border: 1px solid #86efac; border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem 0; font-size: 0.88rem; line-height: 1.6; }
.info-box.warn { background: #fffbeb; border-color: #fcd34d; }
.info-box.tip  { background: #f0fdf4; border-color: #86efac; }
.info-icon { font-size: 1.1rem; flex-shrink: 0; }

.code-block { background: #0f172a; border-radius: 12px; overflow: hidden; margin: 1rem 0 1.5rem; border: 1px solid #1e293b; }
.code-block-header { background: #1e293b; padding: 0.5rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot.r { background: #ef4444; } .code-dot.y { background: #f59e0b; } .code-dot.g { background: #22c55e; }
.code-lang { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: #64748b; letter-spacing: 0.06em; text-transform: uppercase; }
.code-block pre { padding: 1.25rem 1.5rem; overflow-x: auto; font-size: 0.83rem; line-height: 1.7; }

pre { background: #0f172a; border-radius: 10px; padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1rem 0 1.5rem; font-size: 0.83rem; line-height: 1.7; border: 1px solid #1e293b; }
code { font-family: 'IBM Plex Mono', monospace; }
p code, li code { background: var(--accent-bg); color: var(--accent); border-radius: 4px; padding: 0.15rem 0.4rem; font-size: 0.82em; }
pre code { color: #e2e8f0; }
.hl-kw { color: #7dd3fc; } .hl-str { color: #fb923c; } .hl-fn { color: #fbbf24; }
.hl-comment { color: #64748b; font-style: italic; } .hl-key { color: #a78bfa; } .hl-val { color: #34d399; }

.retenir { background: #0f172a; border-radius: 12px; padding: 1.5rem; margin: 2.5rem 0 0; }
.retenir-title { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--accent2); letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.retenir ul { margin-left: 1.2rem; }
.retenir li { color: #cbd5e1; font-size: 0.86rem; margin-bottom: 0.4rem; }
.retenir li strong { color: #e2e8f0; }

.module-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.module-desc { font-size: 0.95rem; color: var(--muted); margin: 1rem 0 1.5rem; line-height: 1.7; }
.module-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.83rem; color: var(--muted); margin-bottom: 1.5rem; }
.meta-val { font-weight: 600; color: var(--text); }
.btn-primary { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--accent); color: white; padding: 0.7rem 1.5rem; border-radius: 8px; font-weight: 700; font-size: 0.9rem; text-decoration: none; transition: opacity 0.15s, transform 0.15s; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.section-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; display: block; }
.obj-list { list-style: none; margin: 0 0 1.5rem; }
.obj-list li { padding: 0.45rem 0 0.45rem 1.4rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); position: relative; }
.obj-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.prereq-box { background: var(--accent-bg); border: 1px solid #86efac; border-radius: 10px; padding: 1rem 1.25rem; font-size: 0.88rem; margin-bottom: 1.5rem; }
.chapters-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.chapter-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chapter-header { background: var(--off); padding: 0.75rem 1.25rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--border); }
.chapter-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.chapter-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.chapter-lessons { list-style: none; }
.chapter-lesson { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.chapter-lesson:last-child { border-bottom: none; }
.lesson-left { display: flex; align-items: center; gap: 0.75rem; }
.lesson-num { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--muted); min-width: 22px; }
.lesson-name { color: var(--text); text-decoration: none; font-weight: 500; }
.lesson-name:hover { color: var(--accent); }
.lesson-badge { font-size: 0.72rem; color: var(--muted); background: var(--off); border-radius: 4px; padding: 0.15rem 0.5rem; }

.lesson-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.lesson-nav a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); font-weight: 600; font-size: 0.88rem; text-decoration: none; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border); transition: background 0.15s, border-color 0.15s; }
.lesson-nav a:hover { background: var(--accent-bg); border-color: var(--accent); }
.lesson-nav .next { background: var(--accent); color: white; border-color: var(--accent); }
.lesson-nav .next:hover { opacity: 0.88; }
.lesson-nav .empty { display: block; }

footer { background: var(--navy); border-top: 1px solid rgba(255,255,255,0.07); padding: 1.5rem 2.5rem; display: flex; align-items: center; justify-content: space-between; }
.footer-brand { color: rgba(255,255,255,0.4); font-size: 0.8rem; }
.footer-brand strong { color: rgba(255,255,255,0.7); }
.footer-links { display: flex; gap: 1.5rem; }
footer a { color: rgba(255,255,255,0.4); font-size: 0.8rem; text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--white); }

@media (max-width: 900px) { .layout { grid-template-columns: 200px 1fr; } .main { padding: 2rem 1.5rem; } }
@media (max-width: 680px) { .layout { grid-template-columns: 1fr; } .sidebar { display: none; } .main { padding: 1.5rem 1rem; } footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.25rem 1rem; } .footer-links { gap: 1rem; } }
