/* ============================================================
   niveau-index.css — Styles communs aux pages d'accueil de niveau
   (3e, 4e, 5e, 6e…)
   /styles/niveau-index.css
   ============================================================ */

/* ── Reset de base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: var(--ni-bg, #f4f6f9);
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   HERO (bandeau en haut de chaque niveau)
   ══════════════════════════════════════════ */
.niveau-hero {
  background: linear-gradient(135deg, var(--ni-primary, #2C7DA0) 0%, var(--ni-dark, #1a5276) 100%);
  color: white;
  padding: 50px 40px 40px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .2);
}

.niveau-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.niveau-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, .18);
  border: 3px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -.05em;
}

.niveau-badge sup { font-size: .55em; vertical-align: super; }

.niveau-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900;
  margin-bottom: .5rem;
  line-height: 1.2;
}

.niveau-subtitle {
  font-size: 1rem;
  opacity: .88;
  max-width: 600px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   CONTENU PRINCIPAL
   ══════════════════════════════════════════ */
.niveau-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ══════════════════════════════════════════
   SECTION THÈME
   ══════════════════════════════════════════ */
.theme-section {
  margin-bottom: 36px;
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .06);
}

.theme-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ni-dark, #1a5276);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ni-light, #e8f4f9);
}

/* ══════════════════════════════════════════
   GRILLE DES CHAPITRES
   ══════════════════════════════════════════ */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* ══════════════════════════════════════════
   CARTE CHAPITRE
   ══════════════════════════════════════════ */
.chapter-card {
  background: var(--ni-light, #e8f4f9);
  border-radius: 14px;
  padding: 18px 16px;
  border-left: 5px solid var(--ni-primary, #2C7DA0);
  transition: transform .2s ease, box-shadow .2s ease;
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

/* Numéro du chapitre */
.chapter-num {
  display: inline-block;
  background: var(--ni-primary, #2C7DA0);
  color: white;
  font-size: .75rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Titre du chapitre */
.chapter-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ni-dark, #1a5276);
  margin-bottom: 14px;
  line-height: 1.35;
  min-height: 2.5rem;
}

/* ══════════════════════════════════════════
   LIENS D'UN CHAPITRE
   ══════════════════════════════════════════ */
.chapter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chapter-links a {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .18s, transform .15s;
}

.chapter-links a:hover {
  opacity: .85;
  transform: translateY(-1px);
}

/* Couleurs par type de lien — surchargeables par niveau */
.lnk-accueil   { background: var(--ni-lnk-accueil,   #7b3fa0); color: white; }
.lnk-activite  { background: var(--ni-lnk-activite,  #e07b2a); color: white; }
.lnk-cours     { background: var(--ni-lnk-cours,     #2C7DA0); color: white; }
.lnk-exercices { background: var(--ni-lnk-exercices, #1e8a4a); color: white; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.niveau-footer {
  text-align: center;
  padding: 20px;
  font-size: .85rem;
  color: #888;
  border-top: 1px solid #eee;
  margin-top: 20px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .niveau-hero       { padding: 35px 20px 30px; }
  .niveau-main       { padding: 24px 14px 40px; }
  .theme-section     { padding: 20px 16px; }
  .chapters-grid     { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .chapters-grid { grid-template-columns: 1fr; }
  .niveau-hero h1 { font-size: 1.4rem; }
}
