/* =========================================================
   global.css — Styles partagés entre tous les modules
   MonMiniLab · Breizhzion
   ========================================================= */

/* ── Nav CTA button (shared across all pages) ── */
.nav-cta {
  background: var(--blue, #0052e0); color: #fff !important;
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem 1rem;
  border-radius: 6px; text-decoration: none; transition: opacity 0.15s;
}
.nav-cta:hover { opacity: 0.85 !important; color: #fff !important; }

/* ── Hamburger menu (mobile) ── */
nav { position: relative; }
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,0.75); border-radius: 2px;
  transition: all 0.2s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-burger { display: flex; }
  .nav-right {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--navy, #09183a);
    flex-direction: column; gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.5rem 0 1rem;
    z-index: 99;
  }
  .nav-right.open { display: flex; }
  .nav-right .nav-link {
    color: rgba(255,255,255,0.65) !important;
    font-size: 0.9rem; padding: 0.75rem 1.5rem;
    border-radius: 0; display: block;
  }
  .nav-right .nav-link:hover { color: #fff !important; }
  .nav-right .nav-cta {
    margin: 0.75rem 1.5rem 0;
    text-align: center; display: block;
    border-radius: 8px;
  }
  .nav-breadcrumb { display: none !important; }
}

/* ── Progress bar ── */
.lesson-progress-wrap {
  height: 3px;
  background: var(--border, #dde3f0);
  margin-bottom: 0;
}
.lesson-progress-bar {
  height: 3px;
  background: var(--accent, #0052e0);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}
.lesson-progress-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted, #6b7a99);
  text-align: right;
  padding: 0.35rem 1.5rem 0.5rem;
  letter-spacing: 0.03em;
}

/* ── Quiz block ── */
.quiz-block {
  background: var(--off, #f4f6fb);
  border: 1px solid var(--border, #dde3f0);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2.5rem 0;
}
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.quiz-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted, #6b7a99);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.quiz-score-inline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted, #6b7a99);
}
.quiz-question {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy, #09183a);
  margin-bottom: 1rem;
  line-height: 1.55;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #dde3f0);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.88rem;
  user-select: none;
}
.quiz-option:hover { border-color: var(--accent, #0052e0); }
.quiz-option input[type="radio"] {
  accent-color: var(--accent, #0052e0);
  flex-shrink: 0;
}
.quiz-option.correct  { border-color: #059669; background: #f0fdf4; color: #065f46; font-weight: 600; }
.quiz-option.incorrect { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.quiz-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.quiz-check,
.quiz-next,
.quiz-restart {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.quiz-check   { background: var(--accent, #0052e0); color: #fff; }
.quiz-next    { background: var(--navy, #09183a);   color: #fff; }
.quiz-restart { background: var(--accent, #0052e0); color: #fff; margin-top: 1rem; }
.quiz-check:hover,
.quiz-next:hover,
.quiz-restart:hover { opacity: 0.85; transform: translateY(-1px); }
.quiz-feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.55;
  margin-top: 0.75rem;
}
.quiz-feedback.correct   { background: #f0fdf4; color: #065f46; border: 1px solid #86efac; }
.quiz-feedback.incorrect { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.quiz-icon { margin-right: 0.2rem; }
.quiz-result {
  text-align: center;
  padding: 1.5rem 1rem;
}
.quiz-score-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--navy, #09183a);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.quiz-score-big span {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--muted, #6b7a99);
}
.quiz-score-msg {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.quiz-pct {
  font-size: 0.85rem;
  color: var(--muted, #6b7a99);
  margin-bottom: 1.5rem;
}

@keyframes quiz-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Sidebar back link ── */
.sidebar-back {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem 0.9rem;
  font-size: 0.8rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}
.sidebar-back:hover { color: var(--accent); }

/* ── Empêcher débordement horizontal global ── */
html, body { max-width: 100%; overflow-x: hidden; }
pre { max-width: 100%; }
.main { min-width: 0; }

/* ── Responsive lesson content ── */
.lesson-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}
.lesson-content img { max-width: 100%; height: auto; }
.lesson-content { overflow-wrap: break-word; word-break: break-word; }

@media (max-width: 480px) {
  .lesson-nav { flex-direction: column; gap: 0.75rem; }
  .lesson-nav a { justify-content: center; }
}
