/* ═══════════════════════════════════════════════════════════════
   ObjectifCyber — module.css
   Barre de progression · Layout module · Sidebar · Leçons
   ═══════════════════════════════════════════════════════════════ */

/* ═══ BARRE DE PROGRESSION LECTURE ═══ */
#read-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--teal) 100%);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 900;
  transition: transform 0.1s linear;
}

/* ═══ HERO MODULE ═══ */
.module-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  padding-block: var(--sp-12) var(--sp-10);
  position: relative;
  overflow: hidden;
}

.module-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 90% 50%, rgba(13,138,126,.12) 0%, transparent 70%);
  pointer-events: none;
}

.module-hero-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
  position: relative;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--sp-5);
}

.module-hero-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: var(--sp-4);
}

.module-hero h1 {
  color: var(--white);
  margin-bottom: var(--sp-3);
}

.module-hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-size: 0.85rem;
  color: rgba(255,255,255,.65);
}

.module-meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.module-meta-item strong { color: var(--white); }

/* ═══ LAYOUT MODULE (2 colonnes : contenu + sidebar) ═══ */
.module-layout {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
  padding-block: var(--sp-10);
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--sp-10);
  align-items: start;
}

/* ═══ CONTENU PRINCIPAL ═══ */
.module-content { min-width: 0; }

/* ═══ OBJECTIF ═══ */
.module-objective {
  background: linear-gradient(135deg, var(--info-bg) 0%, rgba(13,138,126,.06) 100%);
  border: 1px solid rgba(26,111,196,.2);
  border-radius: var(--r);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.module-objective-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: var(--sp-3);
}

.module-objective h3 {
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}

.module-objective ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.module-objective li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 0.9rem;
  color: var(--text);
}

.module-objective li::before {
  content: '→';
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══ LEÇON ═══ */
.lecon {
  margin-bottom: var(--sp-12);
  scroll-margin-top: calc(var(--header-h) + var(--sp-6));
}

.lecon-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 2px solid var(--gray-100);
}

.lecon-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.lecon-header h2 {
  font-size: 1.3rem;
  line-height: 1.3;
}

.lecon p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: var(--sp-4);
}

/* ═══ SIDEBAR NAVIGATION ═══ */
.module-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
  max-height: calc(100vh - var(--header-h) - var(--sp-12));
  overflow-y: auto;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  overflow: hidden;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-nav {
  list-style: none;
  padding: var(--sp-2);
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
  line-height: 1.4;
}

.sidebar-nav li a:hover {
  background: var(--gray-50);
  color: var(--navy);
}

.sidebar-nav li a.active {
  background: var(--info-bg);
  color: var(--blue);
  font-weight: 600;
}

.sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  flex-shrink: 0;
  transition: background var(--dur-fast);
}

.sidebar-nav li a.active .sidebar-dot,
.sidebar-nav li a:hover .sidebar-dot {
  background: var(--blue);
}

/* ═══ SIDEBAR — PROGRESSION DU MODULE ═══ */
.sidebar-progress {
  padding: var(--sp-4);
  border-top: 1px solid var(--gray-100);
}

.sidebar-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.sidebar-progress-bar {
  height: 4px;
  background: var(--gray-100);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  border-radius: 2px;
  transition: width var(--dur) var(--ease);
}

/* ═══ SIDEBAR — QUIZ RAPIDE ═══ */
.sidebar-quiz-cta {
  padding: var(--sp-4);
  border-top: 1px solid var(--gray-100);
  text-align: center;
}

.sidebar-quiz-cta a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 14px;
  background: var(--orange);
  color: var(--white);
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-fast);
}

.sidebar-quiz-cta a:hover { background: var(--orange-lt); }

/* ═══ NAVIGATION INTER-MODULES ═══ */
.module-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 2px solid var(--gray-100);
}

.module-nav-prev,
.module-nav-next {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-5);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  text-decoration: none;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.module-nav-prev:hover,
.module-nav-next:hover {
  border-color: var(--blue);
  background: var(--info-bg);
}

.module-nav-next { text-align: right; }

.module-nav-dir {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.module-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.module-nav-next .module-nav-title { justify-content: flex-end; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1023px) {
  .module-layout {
    grid-template-columns: 1fr;
  }

  .module-sidebar { display: none; }
}

@media (max-width: 767px) {
  .module-layout { padding-inline: var(--sp-4); }

  .module-nav { grid-template-columns: 1fr; }

  .module-nav-next { text-align: left; }
  .module-nav-next .module-nav-title { justify-content: flex-start; }
}
