/* =========================================================
   MIFASCHOOL — Pages de rubriques du Français
   Sous-rubriques affichées en boutons pilules (couleur lavande)
   ========================================================= */

.theme-chips {
    list-style: none !important;
    margin: 4px 0 16px !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.theme-chips li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}
.theme-chips li::marker { content: none; }

.theme-chips .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    color: #4b2e83;
    background: #f1ecfb;
    border: 2px solid #b39ddb;
    border-radius: 999px;
    text-decoration: none !important;
    transition: background .2s, border-color .2s, transform .1s;
}
.theme-chips a.chip:hover {
    background: #e3d9f7;
    border-color: #7e57c2;
    color: #3b2170;
    transform: translateY(-2px);
}

/* Sous-rubrique pas encore créée */
.theme-chips .chip.soon {
    font-weight: normal;
    color: #8a8f9c;
    background: #fff;
    border: 2px dashed #d5cfe3;
    cursor: default;
}

/* Règle déjà maîtrisée (pages de classe) */
.theme-chips a.chip.done {
    color: #27500a;
    background: #eaf3de;
    border-color: #8bc34a;
}
.theme-chips a.chip.done:hover { background: #d8eac1; border-color: #639922; }

/* Badges de niveau sur une carte */
.theme-levels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: -4px 0 10px;
}

/* =========================================================
   PAGES DE CLASSE (classe.php)
   ========================================================= */
.ms-classes-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 18px;
}
.ms-classes-nav a {
    padding: 6px 16px;
    font-weight: bold;
    font-size: .95rem;
    color: #185fa5;
    background: #fff;
    border: 2px solid #b5d4f4;
    border-radius: 999px;
    text-decoration: none;
}
.ms-classes-nav a:hover { background: #e6f1fb; color: #0c447c; }
.ms-classes-nav a.active { background: #cfe3f8; color: #0c447c; border-color: #378add; }

.rules-list h2.ms-matiere-titre {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0 16px;
    padding-bottom: 8px;
    font-size: 1.4rem;
    text-align: left;
    color: var(--ms-navy) !important;
    border-bottom: 2px solid var(--ms-border);
}
.ms-matiere-titre i { color: var(--ms-violet); }

.ms-retour { text-align: center; margin: 28px 0 0; }
.theme-card[id] { scroll-margin-top: 20px; }

/* Courte description d'une carte */
.theme-card-desc {
    margin: -2px 0 12px;
    font-size: .92rem;
    line-height: 1.45;
    color: var(--ms-navy-soft);
}

/* Fil d'Ariane (aussi défini ici pour ne pas dépendre de rule-style.css) */
.ms-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    font-size: .92rem;
    color: #3d5f85;
}
.ms-breadcrumb a { color: #185fa5; font-weight: bold; text-decoration: none; }
.ms-breadcrumb a:hover { text-decoration: underline; }
.ms-breadcrumb .sep { color: #85b7eb; }

/* Groupes de cartes dans une rubrique (ex. « Poser l'opération » / « Calcul mental ») */
.rules-list h2.ms-groupe-titre:first-of-type { margin-top: 8px; }
.ms-groupe-desc { margin: -8px 0 16px; color: var(--ms-navy-soft); }
.themes-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.themes-grid + .ms-groupe-titre { margin-top: 36px; }
@media (max-width: 1000px) { .themes-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .themes-grid.cols-4 { grid-template-columns: 1fr; } }
