/* En-tête du site : couleurs Saint-Barthélemy */
.container-header {
    background: #39551d;
    background-image: none;
    border-bottom: 4px solid #d7ad20;
}

/* Logo : taille réduite et proportions conservées */
.container-header .navbar-brand img {
    max-width: 320px;
    max-height: 95px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Slogan */
.container-header .site-description {
    color: #fff1d9;
    font-size: 0.95rem;
    margin-top: 8px;
}

/* Adaptation aux smartphones */
@media (max-width: 600px) {
    .container-header .navbar-brand img {
        max-width: 100%;
        max-height: 75px;
    }
}

/* =========================================
   MENU PRINCIPAL - STYLE MODERNE
   ========================================= */

/* Liens du menu principal */
.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* Survol et navigation au clavier */
.container-header .mod-menu > li:hover > a,
.container-header .mod-menu > li:hover > span,
.container-header .mod-menu > li > a:focus-visible {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Sous-menus */
.container-header .mod-menu .mod-menu__sub {
    background-color: #ffffff;
    border-top: 3px solid #d7ad20;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 230px;
}

/* Liens des sous-menus */
.container-header .mod-menu .mod-menu__sub a,
.container-header .mod-menu .mod-menu__sub span {
    color: #39551d;
    padding: 9px 12px;
    border-radius: 5px;
}

/* Survol des sous-menus */
.container-header .mod-menu .mod-menu__sub li:hover > a,
.container-header .mod-menu .mod-menu__sub li:hover > span {
    background-color: #edf2e6;
    color: #263c12;
}

/* ========================================
   ACCUEIL MATHÉMATIQUES - VERSION COLORÉE
   ======================================== */

.math-accueil {
    max-width: 1100px;
    margin: 0 auto;
    padding: 35px 15px 45px;
    font-family: inherit;
}

.math-intro {
    text-align: center;
    margin-bottom: 42px;
}

.math-eyebrow {
    color: #397f7b;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.math-intro h1 {
    color: #24384a;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin: 14px 0;
}

.math-intro p {
    color: #627184;
    font-size: 1.08rem;
    line-height: 1.7;
}

/* Grille des quatre années */
.math-annees {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

/* Cartes */
.math-carte {
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 28px;
    border-radius: 18px;
    text-decoration: none !important;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 6px 22px rgba(30,50,70,0.06);
    transition: transform 0.25s ease,
                box-shadow 0.25s ease;
}

.math-carte:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 35px rgba(30,50,70,0.14);
}

.math-carte:focus-visible {
    outline: 3px solid #24384a;
    outline-offset: 4px;
}

.math-carte-haut {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.math-numero {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.math-symbole {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
}

.math-carte h2 {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: #24384a;
}

.math-carte p {
    color: #596a78;
    margin: 0 0 25px;
    font-size: 0.98rem;
}

.math-action {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Couleurs par année */
.math-bleu {
    background: #e7f0fc;
    color: #3678c8;
}

.math-turquoise {
    background: #e1f5f1;
    color: #138f89;
}

.math-orange {
    background: #fff0dc;
    color: #c4751e;
}

.math-violet {
    background: #f0e9fa;
    color: #8664c2;
}

/* Signature */
.math-baseline {
    margin-top: 38px;
    text-align: center;
    color: #788493;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Smartphones */
@media (max-width: 700px) {
    .math-annees {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .math-carte {
        min-height: 210px;
        padding: 24px;
    }

    .math-accueil {
        padding: 25px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .math-carte {
        transition: none;
    }
    .math-carte:hover {
        transform: none;
    }
}

/* Cartes des cours et exercices - Saint-Bar */

ul.math-chapitre {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

ul.math-chapitre > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.math-chapitre > li > a {
    display: flex;
    align-items: center;
    min-height: 85px;
    padding: 20px;
    background: #e7f0ff;
    color: #2359a6;
    border: 1px solid #c9dcfa;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(20, 50, 90, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

ul.math-chapitre > li > a:hover,
ul.math-chapitre > li > a:focus-visible {
    background: #d5e6ff;
    color: #17427e;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(20, 50, 90, 0.12);
}

@media (max-width: 600px) {
    ul.math-chapitre {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    ul.math-chapitre > li > a {
        transition: none;
    }
}

/* Cartes des chapitres - Première année */

.math-chapitres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.math-chapitres .math-carte {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 190px;
    padding: 24px;
    background: #e7f0ff;
    border: 1px solid #c9dcfa;
    border-radius: 16px;
    color: #2359a6;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(20, 50, 90, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.math-chapitres .math-carte:hover,
.math-chapitres .math-carte:focus-visible {
    background: #d8e8ff;
    color: #17427e;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(20, 50, 90, 0.14);
}

.math-chapitres .math-carte-icone {
    font-size: 2rem;
    line-height: 1;
}

.math-chapitres .math-carte strong {
    font-size: 1.2rem;
}

.math-chapitres .math-carte-lien {
    margin-top: auto;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .math-chapitres {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .math-chapitres .math-carte {
        transition: none;
    }
}

/* En-tête moderne - Première année */

.math-hero-1 {
    position: relative;
    overflow: hidden;
    padding: 45px 50px;
    margin: 0 0 30px;
    border-radius: 22px;
    background: linear-gradient(125deg, #173c78, #3577d4 70%, #67b5f5);
    color: white;
    box-shadow: 0 10px 30px rgba(25, 70, 140, 0.16);
}

.math-hero-1 .math-hero-badge {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 30px;
    background: rgba(255,255,255,0.18);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.math-hero-1 h1 {
    position: relative;
    z-index: 1;
    margin: 22px 0 12px;
    color: white;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.15;
}

.math-hero-1 p {
    position: relative;
    z-index: 1;
    max-width: 550px;
    margin: 0 0 25px;
    color: #e6f2ff;
    font-size: 1.05rem;
    line-height: 1.7;
}

.math-hero-1 .math-hero-symbol {
    position: absolute;
    right: 35px;
    top: 35px;
    color: rgba(255,255,255,0.17);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    letter-spacing: 8px;
    pointer-events: none;
}

.math-hero-1 .math-hero-footer {
    display: inline-block;
    padding: 10px 16px;
    background: white;
    color: #2359a6;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .math-hero-1 {
        padding: 30px 24px;
        border-radius: 16px;
    }

    .math-hero-1 .math-hero-symbol {
        right: 12px;
        top: 15px;
        font-size: 3rem;
    }
}

/* En-tête harmonisé avec la présentation moderne */


.container-header {
    background: #763B48;
    background-image: none;
}

/* En-tête bordeaux */

.container-header {
    background: #763B48;
    background-image: none;
    border-bottom: none;
    position: relative;
    padding-bottom: 12px;
}

.container-header::after {
    content: "";
    position: absolute;
    bottom: 13px;
    left: 0;
    right: 0;
    height: 3px;
    background: #E7B94E;
}

/* Présentation modernisée des leçons */

/* Vidéos */
.com-content-article .video-youtube {
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30, 60, 100, 0.12);
    margin: 24px auto 32px !important;
}

/* Titres des sections */
.com-content-article h2 {
    color: #244F87;
    font-weight: 700;
    font-size: 1.45rem;
    margin-top: 32px;
    margin-bottom: 16px;
}

/* Anciens boutons de liens */
.com-content-article a.dd-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: 10px;
    background: #E8F0FC !important;
    background-image: none !important;
    color: #214F90 !important;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background 0.2s, transform 0.2s;
}

.com-content-article a.dd-button:hover {
    background: #D3E4FA !important;
    transform: translateY(-2px);
}

/* Éviter les anciens titres minuscules */
.com-content-article h4 {
    font-size: 1rem !important;
    line-height: 1.6;
}

/* Icônes modernes des cours et exercices */

/* Masquer les anciennes images */
.com-content-article a:has(> img[src*="iconexercice"]) img,
.com-content-article a:has(> img[src*="logonotecoursinfo"]) img {
    display: none;
}

/* Icône de remplacement */
.com-content-article a:has(> img[src*="iconexercice"]),
.com-content-article a:has(> img[src*="logonotecoursinfo"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    vertical-align: middle;
    margin-right: 8px;
    text-decoration: none;
}

/* Exercices : crayon vert */
.com-content-article a:has(> img[src*="iconexercice"]) {
    background: #E4F5EE;
}

.com-content-article a:has(> img[src*="iconexercice"])::before {
    content: "✎";
    font-size: 24px;
    color: #187956;
}

/* Notes de cours : livre bleu */
.com-content-article a:has(> img[src*="logonotecoursinfo"]) {
    background: #E2EDFF;
}

.com-content-article a:has(> img[src*="logonotecoursinfo"])::before {
    content: "▤";
    font-size: 25px;
    color: #245AA0;
}

/* Cartes modernes pour les ressources pédagogiques */

.com-content-article a.dd-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    width: min(100%, 480px);
    padding: 16px 44px 16px 18px;
    margin: 5px 0;
    background: #F4F8FF !important;
    background-image: none !important;
    border: 1px solid #DCE7F6 !important;
    border-radius: 14px;
    color: #214F90 !important;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(30,60,100,.05);
    position: relative;
    transition: all .2s ease;
}

.com-content-article a.dd-button::after {
    content: "↗";
    position: absolute;
    right: 18px;
    font-size: 22px;
    font-weight: 400;
}

.com-content-article a.dd-button:hover {
    background: #E7F0FF !important;
    border-color: #A9C8F3 !important;
    box-shadow: 0 8px 22px rgba(30,60,100,.12);
    transform: translateY(-3px);
}

/* Harmonisation des icônes */
.com-content-article a:has(> img[src*="iconexercice"]),
.com-content-article a:has(> img[src*="logonotecoursinfo"]) {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-right: 10px;
}

/* =========================================
   NOUVELLE PRÉSENTATION DES LEÇONS
   ========================================= */

.math-lecon {
    max-width: 900px;
    margin: 0 auto;
}

/* Sections */
.math-lecon .math-section {
    margin: 0 0 38px;
}

.math-lecon .math-section h2 {
    color: #244F87;
    font-size: 1.4rem;
    font-weight: 750;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E3EAF3;
}

/* Vidéo */
.math-lecon .video-youtube {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    margin: 20px auto 30px;
    overflow: hidden;
    border-radius: 16px;
    background: #111827;
    box-shadow: 0 10px 30px rgba(30, 60, 100, .12);
}

.math-lecon .video-youtube iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cartes ressources */
.math-lecon a.math-ressource {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 18px 22px;
    margin-bottom: 12px;
    border: 1px solid #DFE6F0;
    border-radius: 16px;
    background: #FFFFFF;
    color: #25354B;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(30, 60, 100, .05);
    transition: transform .2s ease,
                box-shadow .2s ease,
                border-color .2s ease;
}

.math-lecon a.math-ressource:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(30, 60, 100, .12);
    border-color: #A9C8F3;
}

/* Icône */
.math-lecon .math-ressource-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 25px;
}

/* Notes de cours : bleu */
.math-lecon .math-note .math-ressource-icone {
    background: #E5EFFF;
}

/* Exercices : vert */
.math-lecon .math-exercice .math-ressource-icone {
    background: #E5F6ED;
}

/* Texte */
.math-lecon .math-ressource-texte {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.math-lecon .math-ressource-texte strong {
    color: #25354B;
    font-size: 1rem;
    font-weight: 700;
}

.math-lecon .math-ressource-texte small {
    color: #738297;
    font-size: .85rem;
}

/* Flèche */
.math-lecon .math-ressource-fleche {
    color: #8CA0BB;
    font-size: 25px;
    transition: transform .2s ease;
}

.math-lecon a.math-ressource:hover
.math-ressource-fleche {
    transform: translate(3px, -3px);
}

/* Adaptation aux smartphones */
@media (max-width: 600px) {
    .math-lecon a.math-ressource {
        gap: 12px;
        padding: 14px;
    }

    .math-lecon .math-ressource-icone {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        font-size: 21px;
    }
}
/* =========================================
   MODERNISATION DES LEÇONS DE MATHÉMATIQUES
   ========================================= */

/* Conteneur de la leçon */
.math-lecon {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Titres des sections */
.math-lecon h3,
.math-lecon h4,
.math-lecon .math-section h3 {
    color: #20558d;
    font-weight: 700;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dce6f1;
}

/* Encadrés pédagogiques */
.math-lecon .math-definition,
.math-lecon .math-note {
    background: #eef5ff;
    border-left: 4px solid #2871c4;
    border-radius: 8px;
    padding: 18px 22px;
    margin: 20px 0;
}

/* Notation mathématique */
.math-lecon .math-notation {
    background: #f5f7fb;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 18px 0;
}

/* Invariants sur deux colonnes */
.math-lecon .math-invariants ul {
    columns: 2;
    column-gap: 35px;
}

.math-lecon .math-invariants li {
    break-inside: avoid;
}

/* Images */
.math-lecon img {
    max-width: 100%;
    height: auto;
}

/* Vidéos */
.math-lecon .video-youtube {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    margin: 20px auto;
}

.math-lecon .video-youtube iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 10px;
}

/* Adaptation aux petits écrans */
@media (max-width: 600px) {
    .math-lecon .math-invariants ul {
        columns: 1;
    }
}
/* Cadres des sections pédagogiques */
.math-lecon .math-section {
    background: #ffffff;
    border: 1px solid #e0e7ef;
    border-left: 5px solid #2364a5;
    border-radius: 6px;
    padding: 18px 22px;
    margin: 24px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Titres des sections */
.math-lecon .math-section h2,
.math-lecon .math-section h3 {
    color: #174f8a;
    margin-top: 0;
}
.math-lecon .math-section {
    border-left: 8px solid red !important;
    background: #fff4f4 !important;
}
/* Cadres des leçons - version définitive */
.math-lecon .math-section {
    background: #ffffff !important;
    border: 1px solid #e0e7ef !important;
    border-left: 5px solid #2364a5 !important;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0 30px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}
/* Exemples de calculs algébriques */
.math-exemples-grille {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.math-exemple {
    min-width: 0;
    overflow-x: auto;
    background: #f8fbff;
    border: 1px solid #dce6f1;
    border-radius: 10px;
    padding: 14px;
}

.math-exemple table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.math-exemple td {
    border: none !important;
    padding: 5px 7px !important;
    vertical-align: top;
    white-space: nowrap;
}

.math-exemple td:nth-child(2) {
    color: #2364a5;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 900px) {
    .math-exemples-grille {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   NAVIGATION DES CHAPITRES - CARTES MODERNES
   ========================================== */

/* Espacement du module */
.math-menu-cartes {
    margin: 24px 0 32px;
}

/* Supprimer les puces */
.math-menu-cartes .math-chapitre,
.math-menu-cartes .math-chapitre ul {
    list-style: none;
    padding-left: 0;
}

/* Cartes des rubriques */
.math-menu-cartes .math-chapitre > li {
    margin-bottom: 14px;
}

/* Liens et titres cliquables */
.math-menu-cartes .math-chapitre a {
    display: block;
    padding: 16px 20px;
    background: #e8f1ff;
    color: #20558d;
    border: 1px solid #cbdcf5;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Effet au survol */
.math-menu-cartes .math-chapitre a:hover,
.math-menu-cartes .math-chapitre a:focus-visible {
    background: #d7e8ff;
    border-color: #9cbce8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30,70,130,.12);
}

/* Sous-rubriques */
.math-menu-cartes .math-chapitre ul {
    margin: 12px 0 18px 18px;
    display: grid;
    grid-template-columns: repeat(
        auto-fit, minmax(220px, 1fr)
    );
    gap: 12px;
}

/* Cartes des sous-rubriques */
.math-menu-cartes .math-chapitre ul a {
    background: #f5f9ff;
    border-color: #e0e9f5;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Smartphones */
@media (max-width: 650px) {
    .math-menu-cartes .math-chapitre ul {
        grid-template-columns: 1fr;
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .math-menu-cartes .math-chapitre a {
        transition: none;
    }

    .math-menu-cartes .math-chapitre a:hover {
        transform: none;
    }
}

/* ==========================================
   CARTES DES SOUS-MENUS - JOOMLA 6
   ========================================== */

/* Sous-menu déplié : grille de cartes */
.math-menu-cartes .math-chapitre
.mod-menu__sub {
    list-style: none;
    padding: 12px 0;
    margin: 0;

    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

/* Éléments des sous-menus */
.math-menu-cartes .math-chapitre
.mod-menu__sub > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Cartes cliquables */
.math-menu-cartes .math-chapitre
.mod-menu__sub > li > a {
    display: flex;
    align-items: center;
    min-height: 75px;
    padding: 18px 20px;

    background: #f1f7ff;
    color: #20558d;
    border: 1px solid #d3e3f7;
    border-radius: 14px;

    font-weight: 600;
    text-decoration: none;

    box-shadow: 0 4px 12px rgba(30,70,130,.06);
    transition: all .2s ease;
}

/* Survol */
.math-menu-cartes .math-chapitre
.mod-menu__sub > li > a:hover {
    background: #e0efff;
    border-color: #a9c9ef;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(30,70,130,.12);
}

/* Smartphone */
@media (max-width: 650px) {
    .math-menu-cartes .math-chapitre
    .mod-menu__sub {
        grid-template-columns: 1fr;
    }
}

/* TEST - Cartes des sous-sous-menus */


/* Cartes des activités - présentation affinée */

ul.math-chapitre ul.mod-menu__sub {
    padding: 14px 0 !important;
    margin: 0 !important;
}

ul.math-chapitre ul.mod-menu__sub li a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 18px 22px !important;
    margin: 6px 0 !important;

    background: #ffffff !important;
    color: #344b65 !important;
    border: 1px solid #dce5ef !important;
    border-left: 4px solid #b69a52 !important;
    border-radius: 10px !important;

    font-size: 0.98rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;

    box-shadow: 0 3px 10px rgba(0,0,0,.04);
    transition: background .2s, box-shadow .2s;
}

ul.math-chapitre ul.mod-menu__sub li a::after {
    content: "→";
    font-size: 1.2rem;
    color: #9a7d36;
    margin-left: 12px;
}

ul.math-chapitre ul.mod-menu__sub li a:hover {
    background: #f6f8fc !important;
    border-color: #c5d5e8 !important;
    border-left-color: #9a7d36 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

@media (prefers-reduced-motion: reduce) {
    ul.math-chapitre ul.mod-menu__sub li a {
        transition: none;
    }
}

/* Cartes des activités mathématiques */

.math-activites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.math-activite-carte {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px;
  min-height: 90px;
  background: #ffffff;
  border: 1px solid #e3e7ed;
  border-left: 4px solid #c5a04b;
  border-radius: 10px;
  color: #294765;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.math-activite-carte:hover {
  background: #f5f8ff;
  border-left-color: #a9832f;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

@media (max-width: 650px) {
  .math-activites-grid {
    grid-template-columns: 1fr;
  }
}
/* Cartes des lecons - premiere annee */

.math-cartes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.math-carte-lecon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #edf5ff;
    border: 1px solid #77a9dc;
    border-radius: 12px;
    color: #174b83 !important;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.2s;
}

.math-carte-lecon:hover {
    background: #dcecff;
    border-color: #286db0;
    transform: translateY(-2px);
}

.math-carte-lecon span {
    font-size: 22px;
    margin-left: 12px;
}
/* Activites GeoGebra - cartes dorees */

.math-carte-activite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: #fffdf8;
    border: 1px solid #e4b65e;
    border-radius: 12px;
    color: #80520d !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: 0.2s;
}

.math-carte-activite:hover {
    background: #fff2d8;
    border-color: #c28b25;
    transform: translateY(-2px);
}
/* Cartes des chapitres de mathématiques */

.math-cartes-grid {
    align-items: start;
}

.math-cartes-grid .math-carte {
    min-height: 0 !important;
    height: auto !important;
    padding: 18px 20px !important;
    border: 1px solid #dce6f2;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.math-cartes-grid .math-carte strong {
    font-size: 16px;
    line-height: 1.4;
}

.math-cartes-grid .math-carte:hover {
    border-color: #397dcc;
    box-shadow: 0 6px 18px rgba(25, 75, 140, 0.12);
    transform: translateY(-2px);
}

/* Cinquième carte : Outils interactifs */

.math-accueil .math-outils {
    margin-top: 22px;
    padding: 26px 30px;
    border-radius: 18px;
    background: linear-gradient(115deg, #16345f, #3177c8);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(20, 55, 105, 0.15);
}

.math-accueil .math-outils-contenu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.math-accueil .math-outils-icone {
    font-size: 46px;
    color: #ffffff;
    line-height: 1;
}

.math-accueil .math-outils h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 25px;
}

.math-accueil .math-outils p {
    margin: 0 0 12px;
    color: #eef5ff;
}

.math-accueil .math-outils-action {
    display: inline-block;
    font-weight: 700;
    color: #ffffff;
}

@media (max-width: 600px) {
    .math-accueil .math-outils {
        padding: 22px;
    }

    .math-accueil .math-outils-contenu {
        align-items: flex-start;
        gap: 15px;
    }

    .math-accueil .math-outils-icone {
        font-size: 32px;
    }
}
/* Outils interactifs – article 158 uniquement */
.outils-page { max-width: 1140px; margin: 24px auto; padding: 0 16px; color: #1e3150; }
.outils-page *, .outils-page *::before, .outils-page *::after { box-sizing: border-box; }
.outils-page .hero { background: linear-gradient(120deg,#123b74,#317fc8); color: white; border-radius: 20px; padding: 36px 42px; }
.outils-page .eyebrow { font-size: 12px; letter-spacing: 2px; font-weight: 800; opacity: .85; }
.outils-page .hero h1 { font-size: clamp(29px,4vw,44px); margin: 10px 0; color: white; }
.outils-page .hero p { margin: 0; color: #e6f2ff; line-height: 1.6; }
.outils-page .categories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; margin: 22px 0 34px; }
.outils-page .category { display: block; padding: 24px 26px; border-radius: 16px; text-decoration: none; background: white; border: 1px solid #dbe6f2; box-shadow: 0 4px 14px #193f6b0d; color: #153f78; transition: .2s; }
.outils-page .category:hover, .outils-page .resource:hover { transform: translateY(-2px); border-color: #3e83c4; box-shadow: 0 8px 20px #173c6a1a; }
.outils-page .category .symbol { font-size: 28px; display: block; margin-bottom: 10px; }
.outils-page .category strong { display: block; font-size: 20px; }
.outils-page .category small { display: block; margin-top: 8px; color: #596b80; font-size: 14px; }
.outils-page .category .more { display: block; margin-top: 16px; font-weight: 700; }
.outils-page .section { margin: 36px 0 42px; scroll-margin-top: 20px; }
.outils-page .section h2 { font-size: 26px; margin: 0 0 6px; color: #1e3150; }
.outils-page .section p { color: #586b80; margin: 0 0 18px; }
.outils-page .resources { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.outils-page .resource { display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: #193c66; background: white; border: 1px solid #dce7f3; border-radius: 13px; padding: 18px; min-height: 130px; transition: .2s; }
.outils-page .resource strong { font-size: 16px; line-height: 1.35; }
.outils-page .resource small { color: #687a8f; }
.outils-page .resource span { margin-top: auto; color: #2268aa; font-size: 13px; font-weight: 700; }
.outils-page a.back { display: inline-block; margin-top: 15px; color: #2268aa; }
@media (max-width: 760px) {
  .outils-page .categories, .outils-page .resources { grid-template-columns: 1fr; }
  .outils-page .hero { padding: 28px; }
  .outils-page { margin: 15px auto; }
}

.math-accueil a.math-outils {
    display: block;
    text-decoration: none;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.math-accueil a.math-outils:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(20, 55, 105, 0.22);
}
/* Article 159 – Fascicules */

.fascicules-page{font-family:inherit;max-width:1050px;margin:20px auto 45px;color:#243246}.fascicules-page *{box-sizing:border-box}.fascicules-page .f-hero{background:linear-gradient(115deg,#243b60,#486b91);border-radius:22px;padding:36px 38px;color:white;box-shadow:0 12px 28px #203b601a}.fascicules-page .f-kicker{font-size:12px;letter-spacing:.13em;text-transform:uppercase;font-weight:750;opacity:.84}.fascicules-page h1{font-size:clamp(28px,4vw,40px);line-height:1.16;margin:10px 0;color:white}.fascicules-page .f-hero p{max-width:670px;line-height:1.6;margin:0;color:#eef5ff}.fascicules-page .f-intro{margin:30px 2px 18px;font-size:17px;font-weight:700}.fascicules-page .f-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.fascicules-page .f-card{border-radius:19px;padding:24px;min-height:215px;display:flex;flex-direction:column;box-shadow:0 7px 22px #1e31460c;border:1px solid #0000000a}.fascicules-page .f-number{font-size:13px;font-weight:800;letter-spacing:.08em}.fascicules-page h2{font-size:23px;line-height:1.22;margin:18px 0 10px;color:inherit}.fascicules-page .f-card p{font-size:14px;line-height:1.55;margin:0 0 18px}.fascicules-page .f-action{margin-top:auto;font-size:14px;font-weight:750}.fascicules-page .f-blue{background:#e7f0fc;color:#174c91}.fascicules-page .f-orange{background:#fff0dc;color:#96570c}.fascicules-page .f-purple{background:#f0e8fa;color:#65408f}.fascicules-page .f-note{background:#f5f7fa;border-left:4px solid #9aabc1;border-radius:9px;padding:14px 17px;margin-top:25px;font-size:13px;line-height:1.5;color:#526173}@media(max-width:740px){.fascicules-page .f-grid{grid-template-columns:1fr}.fascicules-page .f-card{min-height:170px}.fascicules-page .f-hero{padding:27px 23px}}
/* Ressources complémentaires - Accueil */

.ressources-complementaires {
  margin: 45px auto 25px;
  max-width: 1100px;
}

.ressources-complementaires h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #28334b;
}

.ressources-complementaires > p {
  color: #64748b;
  margin-bottom: 24px;
}

.carte-fascicules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  padding: 26px;
  border-radius: 18px;
  background: #e8f1fc;
  color: #193d70;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(0,0,0,.07);
  transition: transform .2s, box-shadow .2s;
}

.carte-fascicules:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
}

.carte-fascicules .carte-icone {
  font-size: 2rem;
}

.carte-fascicules strong {
  font-size: 1.35rem;
}

.carte-fascicules .carte-action {
  font-weight: 700;
  color: #285c9a;
  margin-top: 8px;
}

/* Liens et liste des fascicules de première année */
.fascicules-page .f-card-link{text-decoration:none;display:flex;color:#174c91;transition:transform .15s ease,box-shadow .15s ease}
.fascicules-page .f-card-link:hover,.fascicules-page .f-card-link:focus-visible{transform:translateY(-3px);box-shadow:0 12px 26px #1e314626;text-decoration:none;color:#174c91}
.fascicules-page .f-year-section{margin-top:38px;scroll-margin-top:25px}
.fascicules-page .f-year-heading{background:#e7f0fc;border-radius:17px;padding:22px 26px;color:#174c91}
.fascicules-page .f-year-heading h2{margin:8px 0;font-size:25px}
.fascicules-page .f-year-heading p{margin:0;font-size:14px}
.fascicules-page .f-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-top:17px}
.fascicules-page .f-resource{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px 17px;background:#fff;border:1px solid #dce5f1;border-radius:12px;text-decoration:none;color:#243b60;font-size:14px;line-height:1.4;box-shadow:0 3px 12px #1e314608}
.fascicules-page .f-resource:hover,.fascicules-page .f-resource:focus-visible{background:#f3f8ff;border-color:#94b5df;color:#174c91;text-decoration:none}
.fascicules-page .f-resource-arrow{font-size:19px;flex-shrink:0;color:#376aab}
.fascicules-page .f-back{margin:20px 0 0;font-size:14px}
@media(max-width:740px){.fascicules-page .f-links{grid-template-columns:1fr}}
/* Complément à ajouter à la fin de user.css : couleurs des sections 3e et 4e */
.fascicules-page .f-year-orange .f-year-heading{background:#fff0df;color:#9a4b13}
.fascicules-page .f-year-purple .f-year-heading{background:#f2eafa;color:#713a9d}
.fascicules-page .f-year-orange .f-resource:hover,.fascicules-page .f-year-orange .f-resource:focus-visible{background:#fff8ef;border-color:#e9b987;color:#874311}
.fascicules-page .f-year-purple .f-resource:hover,.fascicules-page .f-year-purple .f-resource:focus-visible{background:#faf5ff;border-color:#c4a4e4;color:#713a9d}
.fascicules-page .f-year-orange .f-resource-arrow{color:#b86724}
.fascicules-page .f-year-purple .f-resource-arrow{color:#854caa}

/* Ressources complémentaires : deux cartes côte à côte */
.ressources-complementaires .ressources-grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.ressources-complementaires .ressources-grille > a {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

/* Variante verte : Tests et correctifs */
.ressources-complementaires .carte-tests {
  background: #e7f5eb;
  color: #24633c;
}

.ressources-complementaires .carte-tests strong,
.ressources-complementaires .carte-tests .carte-action {
  color: #24633c;
}

/* Adaptation aux téléphones */
@media (max-width: 650px) {
  .ressources-complementaires .ressources-grille {
    grid-template-columns: 1fr;
  }
}

/* PAGE TESTS ET CORRECTIFS */

.math-tests {
  max-width: 1200px;
  margin: 0 auto;
}

.tests-entete {
  background: #eaf3ff;
  border-left: 6px solid #2464a4;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 28px;
}

.tests-entete h2 {
  color: #174d85;
  margin: 0 0 10px;
}

.tests-entete p {
  margin: 0;
}

.tests-grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.tests-carte {
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 15px rgba(0,0,0,.06);
  min-width: 0;
}

.tests-carte h3 {
  padding: 14px;
  border-radius: 9px;
  color: white;
  font-size: 1.2rem;
  margin: 0 0 20px;
}

.tests-premiere h3 {
  background: #2672bb;
}

.tests-troisieme h3 {
  background: #dc8728;
}

.tests-quatrieme h3 {
  background: #8251b4;
}

.tests-liste a {
  display: block;
  padding: 9px 0;
  text-decoration: none;
  border-bottom: 1px solid #e8edf2;
  overflow-wrap: anywhere;
}

.tests-liste a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .tests-grille {
    grid-template-columns: 1fr;
  }
}
/* Bannière Saint-Bar - format panoramique */

.banniere-saintbar {
    width: 100%;
    overflow: hidden;
}

/* Bannière complète, sans recadrage */
.banniere-saintbar img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .banniere-saintbar img {
        height: 150px;
    }
}
/* Menu bordeaux plus compact */

.container-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.container-header .container-nav {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.container-header .mod-menu {
    column-gap: 14px;
    row-gap: 2px;
}

.container-header .mod-menu > li {
    margin: 0;
    padding: 0;
}

.container-header .mod-menu > li > a {
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 0.85rem;
    line-height: 1.3;
}
/* Navigation minimaliste : uniquement Accueil */

.container-header .mod-menu > li {
    display: none !important;
}

.container-header .mod-menu > li:first-child {
    display: block !important;
}

.container-header .container-nav {
    min-height: 0 !important;
    padding: 6px 20px !important;
}

.container-header .mod-menu {
    margin: 0 !important;
    padding: 0 !important;
}
/* Lien Accueil centré dans le bandeau */

.container-header .container-nav {
    justify-content: center !important;
}

.container-header .mod-menu > li:first-child > a {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 5px 16px;
}
/* Supprimer le liseré doré du menu */
.container-header {
    border-bottom: none !important;
}

.container-header .container-nav {
    border-bottom: none !important;
}
/* Masquer l'ancien bandeau de navigation */
.container-header {
    display: none !important;
}
/* Bouton Accueil sur la bannière */

.banniere-saintbar {
    position: relative;
}

.saintbar-accueil {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 2;
    display: inline-block;
    padding: 10px 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    color: #174d60;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.saintbar-accueil:hover {
    background: #e0ae13;
    color: #173b45;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .saintbar-accueil {
        top: 10px;
        right: 10px;
        padding: 7px 12px;
        font-size: 0.85rem;
    }
}
/* Bouton Accueil plus visible */

.banniere-saintbar .saintbar-accueil {
    top: 22px;
    right: 28px;
    padding: 13px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 2px solid #e0ae13;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.96);
    color: #174d60;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
}

.banniere-saintbar .saintbar-accueil:hover {
    background: #e0ae13;
    color: #173b45;
}

@media (max-width: 768px) {
    .banniere-saintbar .saintbar-accueil {
        top: 10px;
        right: 10px;
        padding: 8px 13px;
        font-size: 0.9rem;
    }
}

/* Examens et révisions */

.math-examens {
    max-width: 1200px;
    margin: 0 auto;
}

.examens-entete {
    background: #eaf3ff;
    border-left: 6px solid #2464a4;
    padding: 26px;
    border-radius: 12px;
    margin-bottom: 28px;
}

.examens-surtitre {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #2464a4;
    margin-bottom: 10px;
}

.examens-entete h2 {
    color: #174d85;
    margin: 0 0 12px;
}

.examens-entete p {
    margin: 0;
    color: #42576b;
}

.examens-grille {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.examens-carte {
    background: #fff;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.examens-carte h3 {
    color: #fff;
    padding: 16px;
    border-radius: 9px;
    font-size: 1.2rem;
    margin: 0;
}

.examens-premiere h3 {
    background: #2672bb;
}

.examens-troisieme h3 {
    background: #dc8728;
}

.examens-quatrieme h3 {
    background: #8251b4;
}

.examens-carte p {
    color: #526579;
    flex: 1;
    margin: 0;
}

.examens-bouton {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 9px;
    background: #edf4fc;
    color: #174d85;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.examens-bouton:hover {
    background: #dbeafd;
    color: #123e6b;
}

@media (max-width: 900px) {
    .examens-grille {
        grid-template-columns: 1fr;
    }
}

/* Carte Examens et révisions - Accueil */

.ressources-complementaires .carte-examens {
    background: #f3edff;
    border-color: #d8c8f4;
    color: #593a87;
}

.ressources-complementaires .carte-examens:hover {
    background: #ebe0ff;
    border-color: #bca4e8;
}

.ressources-complementaires .carte-examens .carte-action {
    color: #6b42a0;
}

/* Cartes PDF des examens et révisions */
.math-revisions-troisieme .math-resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin: 12px 0;
  text-align: left;
  background: #fff;
  border: 1px solid #e6e2db;
  border-radius: 12px;
  color: #20558d;
  text-decoration: none;
  transition: all .2s ease;
}

.math-revisions-troisieme .math-resource-card:hover {
  border-color: #dc8728;
  background: #fffaf4;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(0,0,0,.07);
}

.math-revisions-troisieme .math-resource-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.math-revisions-troisieme .math-resource-card small {
  color: #61748b;
  margin-top: 4px;
}

.math-revisions-troisieme .math-resource-card > span:last-child {
  margin-left: auto;
}

/* Examens et révisions - Quatrième année */

.math-revisions-quatrieme .math-resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin: 12px 0;
  text-align: left;
  background: #fff;
  border: 1px solid #e6dff0;
  border-radius: 12px;
  color: #20558d;
  text-decoration: none;
  transition: all .2s ease;
}

.math-revisions-quatrieme .math-resource-card:hover {
  border-color: #8251b4;
  background: #faf6ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(0,0,0,.07);
}

.math-revisions-quatrieme .math-resource-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.math-revisions-quatrieme .math-resource-card small {
  display: block;
  color: #61748b;
  margin-top: 4px;
}

.math-revisions-quatrieme .math-resource-card > span:last-child {
  margin-left: auto;
}

/* Examens et révisions - Première année */

.math-revisions-premiere .math-resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin: 12px 0;
  text-align: left;
  background: #fff;
  border: 1px solid #d9e6f5;
  border-radius: 12px;
  color: #20558d;
  text-decoration: none;
  transition: all .2s ease;
}

.math-revisions-premiere .math-resource-card:hover {
  border-color: #2672bb;
  background: #f5f9ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(0,0,0,.07);
}

.math-revisions-premiere .math-resource-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.math-revisions-premiere .math-resource-card small {
  display: block;
  color: #61748b;
  margin-top: 4px;
}

.math-revisions-premiere .math-resource-card > span:last-child {
  margin-left: auto;
}

/* Navigation Saint-Bar : turquoise doux */

.saintbar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.saintbar-navigation .saintbar-bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #E0AE13;
    border-radius: 30px;
    background: rgba(255,255,255,.96);
    color: #205D61;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.saintbar-navigation .saintbar-bouton:hover {
    background: #5D9D9C;
    color: #ffffff;
    transform: translateY(-2px);
}

.saintbar-navigation .saintbar-bouton:focus-visible {
    outline: 3px solid #205D61;
    outline-offset: 3px;
}

/* Position des trois boutons sur la bannière */

.banniere-saintbar .saintbar-navigation {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 10;
}


/* Navigation sous la bannière */


/* ==========================================
   NAVIGATION SOUS LA BANNIÈRE
   ========================================== */


/* ==========================================
   NAVIGATION EN BAS DE PAGE
   ========================================== */

.saintbar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;

    max-width: 1000px;
    margin: 30px auto 45px;
    padding: 18px 12px;

    border-top: 1px solid #dceae8;
}

.saintbar-navigation .saintbar-bouton {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 20px;
    margin: 0;

    background: #e8f5f3;
    color: #286d70;
    border: 1px solid #9bcbc7;
    border-radius: 30px;

    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;

    box-shadow: none;
    transition: background .2s, transform .2s;
}

.saintbar-navigation .saintbar-bouton:hover {
    background: #5d9d9c;
    color: #ffffff;
    transform: translateY(-2px);
}

.saintbar-navigation .saintbar-bouton:focus-visible {
    outline: 3px solid #286d70;
    outline-offset: 3px;
}

@media (max-width: 650px) {
    .saintbar-navigation {
        gap: 7px;
        margin: 22px auto 30px;
        padding: 15px 8px;
    }

    .saintbar-navigation .saintbar-bouton {
        padding: 9px 11px;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .saintbar-navigation .saintbar-bouton {
        transition: none;
    }

    .saintbar-navigation .saintbar-bouton:hover {
        transform: none;
    }
}


/* Accueil : bandeau Pourquoi ce site ? plus discret */

.math-pourquoi-site {
    margin-top: 10px !important;
    margin-bottom: 12px !important;
}

.math-pourquoi-site .math-pourquoi-lien {
    padding: 11px 18px !important;
    gap: 12px !important;
    background: #fff7f8 !important;
    border: 1px solid #e8a5ab !important;
    border-left: 3px solid #e30613 !important;
    border-radius: 9px !important;
    box-shadow: none !important;
}

.math-pourquoi-icone {
    font-size: 20px !important;
}

.math-pourquoi-texte {
    gap: 2px !important;
    font-size: 13px !important;
}

.math-pourquoi-texte strong {
    font-size: 15px !important;
}

.math-pourquoi-action {
    font-size: 12px !important;
}

/* Rétablir la présentation du bandeau */

.math-pourquoi-site .math-pourquoi-lien {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #333 !important;
}

.math-pourquoi-site .math-pourquoi-texte {
    display: flex !important;
    flex: 1;
    flex-direction: column !important;
    gap: 2px;
    color: #555;
    font-size: 13px;
}

.math-pourquoi-site .math-pourquoi-texte strong {
    color: #a81524;
    font-size: 15px;
}

.math-pourquoi-site .math-pourquoi-icone {
    color: #e30613;
}

.math-pourquoi-site .math-pourquoi-action {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 650px) {
    .math-pourquoi-site .math-pourquoi-lien {
        flex-wrap: wrap !important;
    }

    .math-pourquoi-site .math-pourquoi-action {
        width: 100%;
        padding-left: 32px;
    }
}

/* =========================================
   BANDEAUX CAP SUR... - ANNÉES 2, 3 ET 4
   Même présentation que la première année
   ========================================= */

.math-hero-2,
.math-hero-3,
.math-hero-4 {
    position: relative;
    overflow: hidden;
    padding: 45px 50px;
    margin: 0 0 30px;
    border-radius: 22px;
    color: white;
    box-shadow: 0 10px 30px rgba(25, 70, 140, 0.12);
}

/* Deuxième année : turquoise */
.math-hero.math-hero-2 {
    background: linear-gradient(
        125deg, #08665f, #159e91 70%, #5fd3c2
    );
    border: none;
}

/* Troisième année : orange */
.math-hero.math-hero-3 {
    background: linear-gradient(
        125deg, #a84d0a, #e58b29 70%, #ffc477
    );
}

/* Quatrième année : violet */
.math-hero.math-hero-4 {
    background: linear-gradient(
        125deg, #51308d, #835ac5 70%, #b99cf0
    );
}

/* Éléments communs aux trois bandeaux */
.math-hero-2 .math-hero-badge,
.math-hero-3 .math-hero-badge,
.math-hero-4 .math-hero-badge {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 30px;
    background: rgba(255,255,255,0.18);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.math-hero-2 h1,
.math-hero-3 h1,
.math-hero-4 h1 {
    position: relative;
    z-index: 1;
    margin: 22px 0 12px;
    color: white;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.15;
}

.math-hero-2 p,
.math-hero-3 p,
.math-hero-4 p {
    position: relative;
    z-index: 1;
    max-width: 550px;
    margin: 0 0 25px;
    color: rgba(255,255,255,0.9);
    font-size: 1.05rem;
    line-height: 1.7;
}

.math-hero-2 .math-hero-symbol,
.math-hero-3 .math-hero-symbol,
.math-hero-4 .math-hero-symbol {
    position: absolute;
    right: 35px;
    top: 35px;
    color: rgba(255,255,255,0.17);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    letter-spacing: 8px;
    pointer-events: none;
}

.math-hero-2 .math-hero-footer,
.math-hero-3 .math-hero-footer,
.math-hero-4 .math-hero-footer {
    display: inline-block;
    padding: 10px 16px;
    background: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.math-hero-2 .math-hero-footer { color: #08665f; }
.math-hero-3 .math-hero-footer { color: #a84d0a; }
.math-hero-4 .math-hero-footer { color: #51308d; }

@media (max-width: 600px) {
    .math-hero-2,
    .math-hero-3,
    .math-hero-4 {
        padding: 30px 24px;
        border-radius: 16px;
    }

    .math-hero-2 .math-hero-symbol,
    .math-hero-3 .math-hero-symbol,
    .math-hero-4 .math-hero-symbol {
        right: 12px;
        top: 15px;
        font-size: 3rem;
    }
}
/* Deuxième année : cartes turquoise */
.math-chapitres .math-carte-2 {
    background: #dff5f1 !important;
    border: 1px solid #b9e8df !important;
    color: #176e65 !important;
}

.math-chapitres .math-carte-2 strong,
.math-chapitres .math-carte-2 .math-carte-symbole,
.math-chapitres .math-carte-2 .math-carte-lien {
    color: #087f76 !important;
}
/* TROISIÈME ANNÉE — ORANGE */

/* Bandeau principal */
.math-hero-3 {
    position: relative;
    overflow: hidden;
    padding: 45px 50px;
    margin: 0 0 30px;
    border-radius: 22px;
    background: linear-gradient(125deg, #a84b12, #e58a25 70%, #f7bc69);
    color: white;
    box-shadow: 0 10px 30px rgba(170, 85, 20, 0.16);
}

.math-hero-3 .math-hero-badge {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 30px;
    background: rgba(255,255,255,0.18);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.math-hero-3 h1 {
    color: white;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 22px 0 12px;
}

.math-hero-3 p {
    color: #fff4e5;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Cartes des chapitres */
.math-chapitres .math-carte-3 {
    background: #fff0dc !important;
    border: 1px solid #f4d4aa !important;
    color: #98510d !important;
}

.math-chapitres .math-carte-3 strong,
.math-chapitres .math-carte-3 .math-carte-symbole,
.math-chapitres .math-carte-3 .math-carte-lien {
    color: #a85b0b !important;
}

/* Adaptation smartphone */
@media (max-width: 600px) {
    .math-hero-3 {
        padding: 30px 24px;
        border-radius: 16px;
    }
}

/* QUATRIÈME ANNÉE — CARTES VIOLETTES */

.math-chapitres .math-carte-4 {
    background: #f0e8fc !important;
    border: 1px solid #d9c5f3 !important;
    color: #644096 !important;
}

.math-chapitres .math-carte-4 strong,
.math-chapitres .math-carte-4 .math-carte-symbole,
.math-chapitres .math-carte-4 .math-carte-lien {
    color: #7045a8 !important;
}

/* Bouton Retour à l'accueil sur la bannière Saint-Bar */

.banniere-saintbar {
    position: relative;
}

.banniere-saintbar .saintbar-accueil {
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 10;

    display: inline-block;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.92);
    color: #176b70;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease;
}

.banniere-saintbar .saintbar-accueil:hover {
    background: white;
    color: #0b5055;
}

/* Adaptation aux petits écrans */
@media (max-width: 600px) {
    .banniere-saintbar .saintbar-accueil {
        top: 10px;
        right: 10px;
        padding: 7px 11px;
        font-size: 12px;
    }
}
/* TEST TEMPORAIRE — VISIBILITÉ DU BOUTON */

.banniere-saintbar .saintbar-accueil {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
}
/* Coins arrondis des sections des leçons */
.math-lecon .math-section {
    border-radius: 14px;
    overflow: hidden;
}
/* LOT 1 - 25 lecons : complement a AJOUTER EN FIN de user.css.
   Ne remplace aucune regle existante (banniere, menus, cartes, annees). */
.math-lecon { line-height: 1.7; color: #30343b; }
.math-lecon h2, .math-lecon h3, .math-lecon h4 {
  font-family: inherit; text-align: left; line-height: 1.35;
}
.math-lecon h2 { color: #174a70; border-bottom: 2px solid #d8e6f0; padding-bottom: .45rem; }
.math-lecon h3 { color: #245e83; border-left: 4px solid #d2a24b;
  padding: .45rem .75rem; background: #f5f8fb; border-radius: 0 7px 7px 0; }
/* Le user.css actuel impose h4 a 1rem !important : ce selecteur est plus precis. */
.com-content-article .math-lecon h4 { font-size: 1.12rem !important; color: #325a72; }
.math-lecon p { margin: .65rem 0 1rem; }
.math-lecon a:not(.dd-button) { text-underline-offset: 3px; }
.math-lecon a.dd-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.math-lecon img { max-width: 100%; height: auto; }
.math-lecon iframe { max-width: 100%; }
.math-lecon .math-table-scroll { overflow-x: auto; max-width: 100%; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
.math-lecon .math-table-scroll table { width: 100%; border-collapse: collapse; }
.math-lecon .math-table-scroll th, .math-lecon .math-table-scroll td {
  padding: .55rem .7rem; border: 1px solid #d9e1e7; vertical-align: top;
}
.math-lecon .math-table-scroll tr:nth-child(even) { background: #f7f9fb; }
@media (max-width: 600px) {
  .math-lecon h2 { font-size: 1.35rem; }
  .math-lecon h3 { font-size: 1.18rem; }
  .com-content-article .math-lecon h4 { font-size: 1.06rem !important; }
}
/* Ressources : conserver le crayon dans le cadre */
.math-ressource {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.math-ressource > a:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.math-ressource .icon-edit,
.math-ressource .edit-icon {
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 4px;
}
/* Ressources : crayon juste après le texte */
.math-ressource > a:first-child {
    flex: 0 1 auto;
    min-width: 0;
}

.math-ressource .icon-edit,
.math-ressource .edit-icon {
    margin-left: 6px;
    margin-right: 0;
}