


/* =========================================================
   1. RÉINITIALISATION ET STYLE GÉNÉRAL
========================================================= */



* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background:
        linear-gradient(
            180deg,
            #eadfc9 0%,
            #f4ecdc 35%,
            #fffdf8 40%,
            #e3d3b8 60%,
            #f3ead9 80%,
            #fffdf8 100%
        );

    background-attachment: fixed;

    color: #222;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 1.25rem;

    line-height: 1.7;
}


/* =========================================================
   2. EN-TÊTE DU SITE
========================================================= */

.newspaper-header {
    position: relative;

    max-width: 1280px;

    margin: auto;

    padding: 25px 30px 15px;

    text-align: center;
}

.top-line {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding: 5px 0;

    border-top: 2px solid #222;
    border-bottom: 1px solid #222;

    font-family: Arial, sans-serif;

    font-size: 0.8rem;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.school-level-trigger {
    position: relative;
    cursor: pointer;
}

.school-level-trigger:focus-visible {
    outline: 1px solid #222;
    outline-offset: 3px;
}

.school-level-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 150;
    width: 205px;
    padding: 5px 0;
    background: #eadfc9;
    text-align: center;
    transform: translateX(-50%);
}

.school-level-menu[hidden] {
    display: none;
}

.school-level-menu a {
    display: block;
    padding: 7px 12px;
    color: #222;
    font: inherit;
    letter-spacing: 1px;
    text-decoration: none;
    white-space: nowrap;
}

.school-level-menu a:hover,
.school-level-menu a:focus-visible {
    background: rgba(255, 253, 248, 0.45);
    outline: none;
}

.newspaper-header h1 {
    margin: 20px 0 10px;

    font-family: Georgia, serif;

    font-size: clamp(2.8rem, 7vw, 5.5rem);

    font-weight: 900;

    line-height: 1;

    letter-spacing: -4px;
}

.subtitle {
    margin: 0;

    font-size: 0.85rem;

    text-transform: uppercase;

    letter-spacing: 4px;
}

/* Petit accès aux comptes, placé comme le prix d'un journal. */
.header-account-link,
.header-contact-link,
.header-student-button {
    position: absolute;
    top: 82px;
    right: 30px;
    padding: 5px 9px;
    color: #222;
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: bold;
    letter-spacing: 1.2px;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid #222;
    border-radius: 0;
    line-height: normal;
}

.header-contact-link {
    right: auto;
    left: 30px;
}

.header-account-link:hover,
.header-account-link:focus-visible,
.header-contact-link:hover,
.header-contact-link:focus-visible,
.header-student-button:hover,
.header-student-button:focus-visible {
    background: #222;
    color: #f5eedc;
}

.header-student-button {
    display: none;
    background: transparent;
    cursor: pointer;
}


/* =========================================================
   3. DATE ET JOUR DU CYCLE
========================================================= */

#school-day {
    font-weight: bold;

    letter-spacing: 1px;

    white-space: nowrap;
}

.school-info {
    white-space: nowrap;
}


/* =========================================================
   4. NAVIGATION PRINCIPALE
========================================================= */

.main-nav {
    position: relative;

    z-index: 1000;

    display: flex;

    justify-content: center;

    align-items: stretch;

    flex-wrap: nowrap;

    background: #1d1d1d;

    border-top: 4px double #1d1d1d;
    border-bottom: 4px double #1d1d1d;
}

.home-link {
    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 110px;

    padding: 12px 22px;

    background: #1d1d1d;

    color: #f5eedc;

    text-align: center;

    text-decoration: none;

    border-right: 1px solid #666;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.home-link .nav-title {
    margin: 0;
}

.nav-item {
    position: relative;

    flex: 1 1 0;

    min-width: 180px;

    max-width: 275px;

    border-right: 1px solid #666;
}

.nav-item:first-of-type {
    border-left: 1px solid #666;
}

.nav-item > a {
    display: flex;

    flex-direction: column;

    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 12px 18px;

    background: #1d1d1d;

    color: #f5eedc;

    text-align: center;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.nav-title {
    display: block;

    font-family: Arial, sans-serif;

    font-size: 0.78rem;

    font-weight: bold;

    line-height: 1.3;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.nav-dates {
    display: block;

    margin-top: 5px;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 0.75rem;

    font-style: italic;

    text-transform: none;

    letter-spacing: normal;

    opacity: 0.8;
}

.home-link:hover,
.home-link:focus,
.nav-item:hover > a,
.nav-item:focus-within > a,
.home-link.active,
.nav-item > a.active {
    background: #bdbdbd;

    color: #222;
}


/* =========================================================
   5. MENUS DÉROULANTS
========================================================= */

.dropdown-menu {
    position: absolute;

    top: 100%;
    left: 0;

    z-index: 2000;

    width: 100%;

    min-width: 270px;

    background: #1d1d1d;

    border: 1px solid #444;

    border-top-color: #666;

    border-bottom: 4px double #1d1d1d;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform: translateY(-6px);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);
}

.dropdown-menu a {
    display: block;

    width: 100%;

    padding: 14px 18px;

    background: #1d1d1d;

    color: #f5eedc;

    text-align: left;

    text-decoration: none;

    border-bottom: 1px solid #555;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus,
.dropdown-menu a.active-course {
    background: #d3d3d3;

    color: #222;
}

.course-number {
    display: block;

    margin-bottom: 3px;

    font-family: Arial, sans-serif;

    font-size: 0.65rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 2px;

    opacity: 0.7;
}

.course-title {
    display: block;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 1rem;

    font-weight: bold;

    line-height: 1.25;
}


/* =========================================================
   6. FEUILLE PRINCIPALE
========================================================= */

.newspaper {
    width: calc(100% - 40px);

    max-width: 1280px;

    margin: 0 auto;

    padding: 40px 30px;

    background:
        linear-gradient(
            90deg,
            rgba(228, 7, 7, 0) 0%,
            rgba(255, 255, 255, 0.637) 8%,
            rgba(255, 255, 255, 0.747) 20%,
            rgba(255, 255, 255, 0.836) 80%,
            rgba(255, 255, 255, 0.568) 92%,
            rgba(255, 255, 255, 0) 100%
        );

    box-shadow:
        -12px 0 25px rgba(0, 0, 0, 0.12),
        12px 0 25px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   7. TITRES GÉNÉRAUX
========================================================= */

h3 {
    margin-bottom: 5px;

    font-size: 1.75rem;

    line-height: 1.1;
}

h4 {
    margin: 0;

    font-size: 1.2rem;
}


/* =========================================================
   8. EN-TÊTE DE L'ACCUEIL
========================================================= */

.lesson-header {
    margin-bottom: 35px;

    padding-bottom: 30px;

    text-align: center;

    border-bottom: 5px double #222;
}

.edition {
    margin-bottom: 5px;

    font-family: Arial, sans-serif;

    font-size: 0.75rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 3px;
}

.lesson-header h2 {
    width: 100%;

    max-width: 1000px;

    margin: 1px auto;

    font-size: clamp(1.9rem, 4vw, 3.15rem);

    line-height: 1.15;
}

.lesson-description {
    max-width: 800px;

    margin: 20px auto 0;

    font-size: 1.05rem;

    font-style: italic;
}


/* =========================================================
   9. ARTICLE D'INTRODUCTION DE L'ACCUEIL
========================================================= */

.lead-story {
    column-count: 3;

    column-gap: 35px;

    column-rule: 1px solid #888;

    margin-bottom: 50px;
}

.lead-story h3,
.lead-story .author {
    column-span: all;
}

.author {
    padding-bottom: 10px;

    font-family: Arial, sans-serif;

    font-size: 0.7rem;

    font-weight: bold;

    letter-spacing: 2px;

    border-bottom: 1px solid #777;
}

.drop-cap::first-letter {
    float: left;

    padding-top: 10px;
    padding-right: 8px;

    font-size: 5rem;

    font-weight: bold;

    line-height: 0.75;
}


/* =========================================================
   10. ENCADRÉS GÉNÉRAUX
========================================================= */

.fact-box {
    margin: 50px 0;

    padding: 25px;

    border: 4px double #222;
}

.fact-box h3 {
    margin-top: 0;

    text-align: center;

    text-transform: uppercase;

    letter-spacing: 2px;
}

.facts {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 20px;
}

.facts div {
    padding: 10px;

    text-align: center;

    border-right: 1px solid #888;
}

.facts div:last-child {
    border-right: none;
}

.facts strong {
    display: block;

    font-size: 1.7rem;
}

.facts span {
    font-size: 0.9rem;
}


/* =========================================================
   11. EN-TÊTES DES PÉRIODES ET DES COURS
========================================================= */

.period-header {
    margin-bottom: 45px;

    padding-bottom: 35px;

    text-align: center;

    border-bottom: 5px double #222;
}

.period-header h2 {
    width: 100%;

    max-width: 1100px;

    margin: 1px auto;

    font-size: clamp(2rem, 4.5vw, 3.6rem);

    line-height: 1.2;
}

.period-description {
    max-width: 1000px;

    margin: 20px auto 0;

    font-size: 1.15rem;

    font-style: italic;
}


/* =========================================================
   12. APERÇU DES PÉRIODES SUR L'ACCUEIL
========================================================= */

.period-overview {
    margin: 30px 0 80px;
}

.period-overview > h3 {
    margin-bottom: 30px;

    padding-bottom: 12px;

    font-size: 1.6rem;

    text-align: center;

    text-transform: uppercase;

    letter-spacing: 1px;

    border-bottom: 2px solid #222;
}

.overview-columns {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 25px 40px;
}

.overview-columns > div {
    padding-top: 15px;

    border-top: 3px solid #222;
}

.overview-columns h4 {
    margin-bottom: 8px;

    font-size: 1.25rem;
}

.overview-columns p {
    margin-top: 0;
}


/* =========================================================
   13. TITRES DES SECTIONS DES PAGES DE PÉRIODE
========================================================= */

.section-title {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 25px;

    padding-bottom: 8px;

    font-family: Arial, sans-serif;

    font-size: 0.8rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 2px;

    border-bottom: 2px solid #222;
}

.section-title span {
    padding: 4px 8px;

    background: #222;

    color: #f5eedc;
}


/* =========================================================
   14. TITRES DES THÈMES DANS LES COURS
========================================================= */

.theme-title {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 35px 0 25px;

    padding-bottom: 8px;

    font-family: Arial, sans-serif;

    font-size: 1rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 2px;

    border-bottom: 2px solid #222;
}

.theme-title span {
    flex-shrink: 0;

    padding: 4px 8px;

    background: #222;

    color: #f5eedc;
}


/* =========================================================
   15. CARTES DES COURS SUR LES PAGES DE PÉRIODE
========================================================= */

.themes-grid {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 30px;
}

.theme-card {
    display: block;

    padding: 25px;

    color: #222;

    text-decoration: none;

    border-top: 4px solid #222;
    border-bottom: 1px solid #777;

    transition:
        transform 0.2s,
        background-color 0.2s,
        box-shadow 0.2s;
}

.theme-card:hover {
    background-color: rgba(0, 0, 0, 0.04);

    transform: translateY(-4px);

    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15);
}

.theme-number {
    margin: 0 0 8px;

    font-family: Arial, sans-serif;

    font-size: 0.7rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 2px;
}

.theme-card h3 {
    margin: 0 0 15px;

    font-size: 1.8rem;

    line-height: 1.1;
}

.theme-card p {
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;

    margin-top: 10px;

    font-family: Arial, sans-serif;

    font-size: 0.75rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 1px;

    border-bottom: 2px solid #222;
}


/* =========================================================
   16. TITRES DE GROUPES GÉNÉRÉS PAR SCRIPT.JS
========================================================= */

.course-section-title {
    grid-column: 1 / -1;

    margin-top: 35px;

    padding: 16px 0 10px;

    border-top: 5px double #222;
    border-bottom: 1px solid #777;
}

.course-section-title:first-child {
    margin-top: 0;
}

.course-section-title span {
    display: block;

    margin-bottom: 4px;

    font-family: Arial, sans-serif;

    font-size: 0.65rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 2px;
}

.course-section-title h3 {
    margin: 0;

    font-size: 1.7rem;
}


/* =========================================================
   17. PAGES DES COURS
========================================================= */

.theme-page .newspaper {
    background:
        linear-gradient(
            90deg,
            rgba(255, 253, 247, 0.55) 0%,
            rgba(255, 253, 247, 0.82) 8%,
            rgba(255, 253, 247, 0.94) 20%,
            rgba(255, 253, 247, 0.94) 80%,
            rgba(255, 253, 247, 0.82) 92%,
            rgba(255, 253, 247, 0.55) 100%
        );
}

.theme-page .course-content {
    margin: 40px 0;
}

.course-section {
    margin: 35px 0;
}

.course-text {
    max-width: 100%;

    line-height: 1.75;
}

.course-text p:first-child {
    margin-top: 0;
}

.course-text p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   18. ENCADRÉS DES COURS
========================================================= */

.theme-page .fact-box {
    margin: 20px 0;

    padding: 10px 18px;

    background: rgba(235, 224, 203, 0.65);

    border: 4px double #222;

    font-size: 1.3rem;
}

.theme-page .fact-box h3 {
    margin: 0 0 6px;

    padding-bottom: 8px;

    font-size: 1.6rem;

    border-bottom: 2px solid #222;
}

.theme-page .fact-box p {
    margin: 6px 0;
}


/* =========================================================
   19. TEXTE + IMAGE
========================================================= */

.course-layout.two-columns {
    display: grid;

    grid-template-columns: 1fr 1fr;

    align-items: start;

    gap: 35px;
}


/* =========================================================
   20. IMAGES
========================================================= */

.course-image {
    margin: 20px auto;

    text-align: center;
}

.course-image img {
    display: block;

    width: 100%;

    max-width: 100%;

    height: auto;

    margin: 0 auto;
}

.course-image-large {
    width: 100%;
}

.course-image figcaption {
    margin-top: 8px;

    font-family: Arial, sans-serif;

    font-size: 0.8rem;

    line-height: 1.4;

    color: #555;
}


/* Image volontairement plus petite */

.small-course-image {
    width: 70% !important;

    max-width: 900px !important;

    margin: 0 auto;
}

/* Carte d'ouverture du cours 2 : présentation plus compacte. */
.theme-02-first-image {
    width: 100% !important;
    max-width: 100% !important;
}
.small-course-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}


/* =========================================================
   21. DEUX IMAGES CÔTE À CÔTE
========================================================= */

.image-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 30px;
}


/* =========================================================
   22. CARTES D'INFORMATION
========================================================= */

.info-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 20px;
}

.info-card {
    padding: 18px;

    background: rgba(255, 255, 255, 0.45);

    border-top: 4px solid #222;
    border-bottom: 1px solid #888;
}

.info-label {
    display: block;

    margin-bottom: 6px;

    font-family: Arial, sans-serif;

    font-size: 0.7rem;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 1.5px;
}

.info-card strong {
    display: block;

    margin-bottom: 8px;

    font-size: 1.2rem;
}

.info-card p {
    margin: 0;

    font-size: 1rem;
}


/* =========================================================
   23. QUESTIONS
========================================================= */

.question-box {
    padding: 20px 25px;

    background: rgba(235, 224, 203, 0.4);

    border-left: 6px solid #222;
}

.question-box h3 {
    margin-top: 0;

    font-size: 1.5rem;
}


/* =========================================================
   24. TABLEAUX
========================================================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.course-table {
    width: 100%;

    border-collapse: collapse;
}

.course-table th,
.course-table td {
    padding: 12px;

    text-align: left;

    border: 1px solid #777;
}

.course-table th {
    background: #222;

    color: #f5eedc;
}


/* =========================================================
   25. VIDÉOS
========================================================= */

.video-container {
    width: 100%;

    aspect-ratio: 16 / 9;

    margin: 20px 0;
}

.video-container iframe,
.video-container video {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


/* =========================================================
   26. PIED DE PAGE
========================================================= */

footer {
    display: flex;

    justify-content: space-between;

    max-width: 1280px;

    margin: 50px auto 0;

    padding: 25px 30px;

    font-family: Arial, sans-serif;

    font-size: 0.7rem;

    text-transform: uppercase;

    letter-spacing: 1px;

    border-top: 5px double #222;
}

.site-page-credit {
    max-width: 1280px;
    margin: 30px auto -34px;
    padding: 0 30px;
    color: #3f3a32;
    font-family: Arial, sans-serif;
    font-size: 0.62rem;
    font-weight: normal;
    letter-spacing: 0.08em;
    text-align: center;
}


/* =========================================================
   27. PROGRESSION DE LECTURE
========================================================= */

.reading-progress-wrapper {
    position: fixed;

    left: 0;
    bottom: 0;

    width: 260px;

    z-index: 9999;

    font-family: Arial, sans-serif;
}

.reading-progress-label {
    display: inline-block;

    margin-left: 10px;
    margin-bottom: 4px;

    padding: 4px 8px;

    background: rgba(245, 238, 224, 0.95);

    border: 1px solid #555;

    font-size: 0.68rem;

    font-weight: bold;

    letter-spacing: 1.5px;

    color: #222;
}

.reading-progress {
    width: 100%;

    height: 8px;

    background: rgba(230, 222, 207, 0.92);

    border-top: 1px solid #555;
    border-right: 1px solid #555;

    overflow: hidden;
}

.reading-progress-bar {
    width: 0%;

    height: 100%;

    background: #222;

    transition: width 0.08s linear;
}

/* =========================================
   TABLETTE
   701px à 1000px
========================================= */

@media (max-width: 1000px) {

    body {
        font-size: 1.1rem;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .home-link {
        flex: 1 1 100%;
        border-right: none;
        border-bottom: 1px solid #666;
    }

    .nav-item {
        flex: 1 1 50%;
        min-width: 0;
        max-width: none;
    }

    .dropdown-menu {
        min-width: 100%;
    }

    .newspaper {
        width: calc(100% - 30px);
        padding: 35px 25px;
    }

    .lead-story {
        column-count: 2;
    }
}


/* =========================================
   MOBILE
   700px et moins
========================================= */

@media (max-width: 700px) {

    /* PAGE */

    body {
        font-size: 1rem;
        line-height: 1.6;
        background-attachment: scroll;
    }

    .newspaper {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 25px 16px;
        box-shadow: none;
    }

    .theme-page .newspaper {
        background: rgba(255, 253, 247, 0.9);
    }


    /* EN-TÊTE */

    .newspaper-header {
        padding: 15px 14px 10px;
    }

    .header-account-link,
    .header-contact-link {
        position: static;
        display: inline-block;
        margin-top: 12px;
    }

    .header-contact-link {
        margin-right: 8px;
    }

    .top-line {
        flex-direction: column;
        gap: 3px;
        font-size: 0.65rem;
        line-height: 1.4;
    }

    .newspaper-header h1 {
        margin: 15px 0 8px;
        font-size: 3.2rem;
        letter-spacing: -2px;
    }

    .subtitle {
        font-size: 0.63rem;
        line-height: 1.5;
        letter-spacing: 1.4px;
    }


    /* NAVIGATION */

    .main-nav {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .home-link,
    .nav-item {
        width: 100%;
        min-width: 0;
        max-width: none;
        border-left: none;
        border-right: none;
    }

    .home-link {
        border-bottom: 1px solid #666;
    }

    .nav-item {
        border-bottom: 1px solid #666;
    }

    .nav-item > a {
        min-height: 58px;
        padding: 10px 15px;
    }

    .nav-title {
        font-size: 0.74rem;
    }

    .nav-dates {
        font-size: 0.68rem;
    }


    /* MENU DÉROULANT */

    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 100%;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .nav-item:hover .dropdown-menu,
    .nav-item:focus-within .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 11px 18px;
    }


    /* TITRE DES COURS */

    .period-header {
        margin-bottom: 28px;
        padding-bottom: 22px;
    }

    .period-header h2 {
        font-size: 2rem;
        line-height: 1.15;
    }

    .period-description {
        font-size: 1rem;
        line-height: 1.5;
    }

    .edition,
    .theme-page .edition {
        font-size: 0.62rem;
        letter-spacing: 1.5px;
    }


    /* TITRES DE THÈMES */

    .theme-title {
        gap: 8px;
        margin: 28px 0 16px;
        font-size: 0.85rem;
        line-height: 1.4;
        letter-spacing: 1px;
    }

    .theme-title span {
        padding: 3px 6px;
    }


    /* COURS */

    .course-section {
        margin: 25px 0;
    }

    .course-text {
        font-size: 1rem;
        line-height: 1.7;
    }


    /* ENCADRÉS */

    .theme-page .fact-box {
        margin: 16px 0;
        padding: 10px 13px;
        border-width: 3px;
        font-size: 1rem;
    }

    .theme-page .fact-box h3 {
        font-size: 1.25rem;
    }


    /* COLONNES */

    .course-layout.two-columns,
    .image-grid,
    .info-grid,
    .overview-columns {
        grid-template-columns: 1fr;
    }


    /* IMAGES */

    .course-image {
        width: 100%;
        margin: 15px auto;
    }

    .course-image img,
    .small-course-image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
    }


    /* PAGES DE PÉRIODE */

    .themes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .theme-card {
        padding: 18px;
    }

    .theme-card h3 {
        font-size: 1.45rem;
    }


    /* ACCUEIL */

    .lead-story {
        column-count: 1;
    }

    .facts {
        grid-template-columns: 1fr;
    }

    .facts div {
        border-right: none;
    }


    /* PIED DE PAGE */

    footer {
        flex-direction: column;
        gap: 5px;
        margin-top: 30px;
        padding: 18px 14px;
        text-align: center;
    }

    .site-page-credit {
        margin: 24px auto -18px;
        padding: 0 14px;
    }


    /* BARRE DE LECTURE */

    .reading-progress-wrapper {
        width: 165px;
    }

    .reading-progress {
        height: 5px;
    }

    .reading-progress-label {
        margin-left: 5px;
        margin-bottom: 3px;
        padding: 3px 5px;
        font-size: 0.55rem;
    }
}

/* ==================================================
   ENCADRÉ SCOLAIRE — MARGE GAUCHE
================================================== */

.school-info-box {
    position: absolute;
    left: 18px;
    top: 380px;

    width: 270px;
    padding: 16px 15px;

    background:
        linear-gradient(
            135deg,
            rgba(248, 244, 232, 0.97),
            rgba(255, 255, 255, 0.97)
        );

    border: 1px solid #9b9587;
    border-top: 4px solid #222;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.12);

    font-family: Georgia, "Times New Roman", serif;
    color: #222;

    z-index: 50;
}

.school-info-box-empty {
    min-height: 220px;
    transition: min-height 0.2s ease;
}

.school-info-box-empty.has-selected-teacher { min-height: 330px; }
.school-info-box-empty.has-selected-group { min-height: 390px; }

.visitor-teacher-picker { padding: 4px 0; }
.visitor-dropdown-control { position: relative; }
.visitor-group-picker { margin-top: 14px; }
.visitor-group-picker[hidden] { display: none; }
.school-info-box .visitor-choice-button { width: 100%; margin: 8px 0 0; padding: 10px 8px; background: #222; color: #f5eedc; font-family: Georgia, "Times New Roman", serif; font-size: 0.72rem; font-weight: bold; letter-spacing: 0.06em; text-transform: uppercase; border: 4px double #f5eedc; outline: 1px solid #222; cursor: pointer; }
.school-info-box .visitor-choice-button:hover, .school-info-box .visitor-choice-button:focus-visible { background: #f5eedc; color: #222; border-color: #222; }
.visitor-choice-options { position: absolute; top: 100%; left: 0; z-index: 60; box-sizing: border-box; width: 100%; margin-top: 7px; padding: 12px; background: #fffaf0; border: 4px double #222; box-shadow: 4px 5px 12px rgba(0, 0, 0, 0.2); text-align: left; }
.visitor-choice-options[hidden] { display: none; }
.visitor-choice-message { margin: 0 0 10px !important; font-size: 0.75rem !important; font-style: italic; text-align: center; }
.visitor-choice-message[hidden] { display: none; }
.visitor-choice-list { display: grid; max-height: 220px; overflow-y: auto; }
.school-info-box .visitor-choice-option { width: 100%; margin: 0; padding: 9px 8px; background: #fffaf0; color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.82rem; font-weight: bold; text-align: left; border: 0; border-bottom: 1px solid #aaa08f; border-radius: 0; cursor: pointer; }
.school-info-box .visitor-choice-option:last-child { border-bottom: 0; }
.school-info-box .visitor-choice-option:hover, .school-info-box .visitor-choice-option:focus-visible { background: #222; color: #f5eedc; outline: none; }
.visitor-selected-teacher, .visitor-selected-group { margin-top: 14px; padding: 11px 9px; background: #fffaf0; text-align: center; border: 4px double #4c463b; }
.visitor-selected-teacher[hidden], .visitor-selected-group[hidden] { display: none; }
.visitor-selected-teacher strong, .visitor-selected-group strong { display: block; font-size: 0.95rem; line-height: 1.25; }
.visitor-student-information { margin-top: 20px; padding-top: 18px; border-top: 4px double #4c463b; }
.visitor-student-information[hidden] { display: none; }
.visitor-student-information .school-info-section { text-align: center; }
.visitor-close-class-button { display: none; }

.school-info-section {
    text-align: center;
}

.school-info-label {
    display: block;

    margin-bottom: 8px;

    font-size: 0.68rem;
    font-weight: bold;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: #555;
}

.school-info-box h3 {
    margin: 0 0 10px;

    font-size: 1rem;
    line-height: 1.2;

    text-transform: uppercase;
}

.school-info-box p {
    margin: 7px 0;

    font-size: 0.85rem;
    line-height: 1.45;
}

.school-info-divider {
    width: 75%;
    height: 1px;

    margin: 16px auto;

    background: #aaa497;
}

.school-info-date {
    font-size: 1.05rem !important;
    font-weight: bold;

    border-top: 1px solid #bbb;
    border-bottom: 1px solid #bbb;

    padding: 7px 0;

    margin: 9px 0 !important;
}

.school-info-small {
    font-size: 0.75rem !important;
    font-style: italic;

    color: #555;
}

.school-schedule-list {
    margin-top: 10px;
    border-top: 3px double #4c463b;
    border-bottom: 1px solid #9b9587;
}

.school-schedule-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 7px 2px;
    text-align: left;
    border-bottom: 1px dotted #9b9587;
}

.school-schedule-row:last-child {
    border-bottom: 0;
}

.school-schedule-row > strong {
    display: inline-grid;
    place-items: center;
    min-height: 26px;
    background: #222;
    color: #f5eedc;
    font-family: Arial, sans-serif;
    font-size: 0.67rem;
}

.school-schedule-row > span {
    min-width: 0;
    font-size: 0.78rem;
    font-weight: bold;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.school-schedule-row small {
    display: block;
    margin-top: 2px;
    color: #555;
    font-size: 0.67rem;
    font-style: italic;
    font-weight: normal;
}


/* ==================================================
   ÉCRANS INTERMÉDIAIRES

   Sur un écran Retina, la largeur CSS est plus petite que le nombre de
   pixels physiques. La feuille reste centrée et devient plus étroite afin
   de conserver deux marges égales et de libérer la place de l'encadré.
================================================== */

@media (min-width: 1300px) and (max-width: 1899px) {

    body.theme-page {
        font-size: 1.05rem;
        line-height: 1.65;
    }

    .theme-page .course-text {
        line-height: 1.65;
    }

    .theme-page .fact-box {
        font-size: 1.05rem;
    }

    .school-info-box {
        left: 18px;
        width: clamp(164px, calc((100vw - 900px) / 2 - 36px), 270px);
    }

    .newspaper {
        width: calc(100% - 40px);
        max-width: 900px;
        margin-right: auto;
        margin-left: auto;
    }

}

@media (min-width: 1100px) and (max-width: 1299px) {

    body.theme-page {
        font-size: 1rem;
        line-height: 1.6;
    }

    .theme-page .course-text {
        line-height: 1.6;
    }

    .theme-page .fact-box {
        font-size: 1rem;
    }

    .school-info-box {
        left: 8px;
        width: 160px;
    }

    .newspaper {
        width: calc(100% - 40px);
        max-width: 760px;
        margin-right: auto;
        margin-left: auto;
    }

}


/* ==================================================
   MOBILE
================================================== */

@media (max-width: 1099px) {

    .school-info-box {
        position: relative;

        left: auto;
        top: auto;

        width: auto;
        max-width: 520px;

        margin: 20px auto;

        box-sizing: border-box;
    }

}

.school-date-cycle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

#current-date {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#school-day {
    font-weight: bold;
    font-size: 1rem;
}

/* =========================================
   DATE + JOUR DU CYCLE
========================================= */

.school-date-cycle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    margin: 8px 0 10px;

    line-height: 1.25;
}


/* DATE */

#current-date {
    display: block;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.78rem;

    text-transform: uppercase;
    letter-spacing: 0.08em;

    color: #555;
}


/* JOUR DU CYCLE */

#school-day {
    display: block;

    margin-top: 2px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: bold;

    letter-spacing: 0.06em;

    color: #222;
}

@media (max-width: 700px) {

    .header-account-link,
    .header-student-button {
        position: static;
        vertical-align: middle;
    }

    .header-student-button {
        display: inline-block;
        margin: 12px 0 0 6px;
    }

    .school-info-box-empty {
        display: none;
        position: fixed;
        left: 50%;
        top: 20px;
        width: calc(100% - 32px);
        max-width: 360px;
        max-height: calc(100vh - 40px);
        margin: 0;
        overflow-y: auto;
        transform: translateX(-50%);
        z-index: 1000;
    }

    .school-info-box-empty.mobile-class-open {
        display: block;
    }

    .school-info-box-empty .visitor-close-class-button {
        position: sticky;
        bottom: 0;
        display: block;
        box-sizing: border-box;
        width: 100%;
        margin: 18px 0 0;
        padding: 10px 12px;
        background: #222;
        color: #f5eedc;
        font-family: Arial, sans-serif;
        font-size: 0.72rem;
        font-weight: bold;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        border: 4px double #f5eedc;
        outline: 1px solid #222;
        border-radius: 0;
        cursor: pointer;
    }

    .school-info-box-empty .visitor-close-class-button:hover,
    .school-info-box-empty .visitor-close-class-button:focus-visible {
        background: #f5eedc;
        color: #222;
        border-color: #222;
    }

}

/* =========================================
   ESPACE COMPTE
========================================= */

.account-page {
    min-height: 100vh;
    padding: 40px 16px;
    background: #e8dfc9;
}

.account-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px;
    background: #fffdf7;
    border-top: 5px double #222;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.account-card.wide { max-width: 980px; }
.account-card.wide { position: relative; }
.account-card h1 { margin-top: 0; }
.account-card label { display: block; margin: 15px 0; font-family: Georgia, "Times New Roman", serif; font-size: 0.9rem; font-weight: bold; letter-spacing: 0.02em; }
.account-card input:not([type="checkbox"]),
.account-card textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 7px; padding: 11px 12px; background: rgba(245, 238, 220, 0.72); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; border: 3px double #4c463b; border-radius: 0; box-shadow: inset 0 1px 5px rgba(70, 55, 35, 0.08); }
.account-card input:not([type="checkbox"]):focus,
.account-card textarea:focus { outline: 2px solid #222; outline-offset: 2px; background: #fffaf0; }
.account-card textarea { min-height: 190px; resize: vertical; line-height: 1.5; }
.contact-card { max-width: 720px; }
.contact-card .account-actions { margin-top: 28px; }
.contact-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.account-card input[readonly] { background: rgba(226, 215, 191, 0.55); color: #4f493f; cursor: default; }
.account-card input[readonly]:focus { outline: none; background: rgba(226, 215, 191, 0.55); }
.account-card input[type="time"] { min-height: 52px; color-scheme: light; }
.account-card input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.72; filter: sepia(1) saturate(0.35); }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 76px !important; }
.account-card .password-toggle-button { position: absolute; top: 50%; right: 8px; transform: translateY(-42%); min-width: 56px; margin: 0; padding: 4px 6px; background: rgba(245, 238, 220, 0.92); color: #222; font-family: Arial, sans-serif; font-size: 0.62rem; letter-spacing: 0.06em; border: 1px solid #222; outline: 0; }
.account-card .password-toggle-button:hover, .account-card .password-toggle-button:focus-visible { background: #222; color: #f5eedc; border-color: #222; outline: 1px solid #222; outline-offset: 2px; }
.account-card button { margin: 8px 0; padding: 10px 15px; background: #222; color: #f5eedc; font-family: Georgia, "Times New Roman", serif; font-size: 0.82rem; font-weight: bold; letter-spacing: 0.08em; text-transform: uppercase; border: 3px double #f5eedc; outline: 1px solid #222; border-radius: 0; cursor: pointer; }
.account-card button:hover, .account-card button:focus-visible { background: #f5eedc; color: #222; border-color: #222; }
.account-card fieldset { margin: 20px 0; padding: 15px 18px; background: rgba(245, 238, 220, 0.45); border: 3px double #4c463b; }
.account-card fieldset legend { padding: 0 8px; font-weight: bold; }
.account-card .checkbox { display: inline-flex; align-items: center; gap: 7px; margin: 8px 15px 8px 0; cursor: pointer; }
.account-card input[type="checkbox"] { appearance: none; width: 17px; height: 17px; margin: 0; background: #f5eedc; border: 1px solid #222; border-radius: 0; display: inline-grid; place-content: center; cursor: pointer; }
.account-card input[type="checkbox"]::before { content: "×"; color: #f5eedc; font-family: Georgia, serif; font-size: 17px; font-weight: bold; line-height: 1; transform: scale(0); }
.account-card input[type="checkbox"]:checked { background: #222; }
.account-card input[type="checkbox"]:checked::before { transform: scale(1); }
.account-card input[type="checkbox"]:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.account-notice, .account-error { padding: 10px; }
.account-notice { background: #e5f1df; border-left: 4px solid #376a2a; }
.account-error { background: #f8dfdc; border-left: 4px solid #9b2518; }
.account-help { margin: 16px 0; padding: 10px 12px; background: rgba(235, 224, 203, 0.65); border-left: 4px solid #222; font-size: 0.9rem; }
.time-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.recovery-schedule { margin: 18px 0; padding: 18px; background: rgba(245, 238, 220, 0.35); border-top: 3px double #4c463b; border-bottom: 1px solid #8d8372; }
.recovery-schedule h3 { margin: 0 0 10px; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.08em; }
.recovery-schedule-secondary { margin-top: 18px; background: rgba(235, 224, 203, 0.58); }
.recovery-schedule-secondary[hidden] { display: none; }
.recovery-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.split-recovery-toggle { width: fit-content; padding: 10px 12px; background: rgba(245, 238, 220, 0.7); border: 3px double #4c463b; }
.optional-label { font-size: 0.72rem; font-style: italic; font-weight: normal; }
.school-settings-accordion { width: 100%; margin: 26px 0; background: rgba(245, 238, 220, 0.35); border: 6px double #222; box-shadow: 4px 4px 0 rgba(65, 52, 34, 0.12); }
.school-settings-accordion summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 50px; padding: 17px 20px; background: rgba(245, 238, 220, 0.82); font-family: Arial, sans-serif; font-size: 0.9rem; font-weight: bold; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; list-style: none; user-select: none; }
.school-settings-accordion summary::-webkit-details-marker { display: none; }
.school-settings-accordion summary:hover, .school-settings-accordion summary:focus-visible { background: #222; color: #f5eedc; outline: none; }
.accordion-title { min-width: 0; }
.accordion-arrow { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 12px; border: 4px double currentColor; }
.accordion-arrow::before { content: "❯"; display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1; transition: transform 0.18s ease; }
.school-settings-accordion[open] .accordion-arrow::before { transform: rotate(90deg); }
.school-settings-panel { padding: 22px 24px 26px; background: rgba(255, 253, 247, 0.52); border-top: 3px double #4c463b; }
.cycle-length-control { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 8px 20px; margin: 20px 0; padding: 15px 18px; background: #fffaf0; border: 4px double #222; }
.cycle-length-control label { margin: 0; font-family: Arial, sans-serif; font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; }
.account-card .cycle-length-control select { box-sizing: border-box; width: 100%; padding: 9px 10px; background: rgba(245, 238, 220, 0.8); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.9rem; font-weight: bold; border: 4px double #4c463b; border-radius: 0; }
.account-card .cycle-length-control select:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.cycle-length-control p { grid-column: 1 / -1; margin: 0; color: #555; font-size: 0.8rem; font-style: italic; }
.cycle-length-control .cycle-save-status { color: #2f5529; font-style: normal; font-weight: bold; }
.cycle-save-status:empty { display: none; }
.schedule-day-card[hidden], .recovery-cycle-day[hidden] { display: none; }
.schedule-days-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.schedule-day-card { min-width: 0; background: rgba(255, 253, 247, 0.64); border: 4px double #222; box-shadow: 3px 3px 0 rgba(65, 52, 34, 0.1); }
.schedule-day-card > h4 { margin: 0; padding: 10px; background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.78rem; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }
.schedule-period-row { display: grid; grid-template-columns: 45px minmax(0, 1fr); border-top: 1px solid #777063; }
.schedule-period-row:first-of-type { border-top: 0; }
.schedule-period-number { display: grid; place-content: center; padding: 5px 3px; background: #e9dec6; text-align: center; border-right: 1px solid #777063; }
.schedule-period-number span { display: block; font-family: Arial, sans-serif; font-size: 0.5rem; letter-spacing: 0.05em; text-transform: uppercase; }
.schedule-period-number strong { display: block; font-size: 1.05rem; }
.schedule-period-fields { display: grid; min-width: 0; padding: 6px; gap: 5px; }
.account-card .schedule-period-fields input, .account-card .schedule-period-fields select { box-sizing: border-box; width: 100%; margin: 0 0 5px; padding: 6px; background: rgba(255, 253, 247, 0.82); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.72rem; line-height: 1.15; border: 1px solid #777063; border-radius: 0; box-shadow: none; }
.account-card .schedule-period-fields select { display: block; min-width: 0; min-height: 30px; margin: 0; padding: 6px 28px 6px 8px; appearance: none; background-color: #fffaf0; background-image: linear-gradient(45deg, transparent 50%, #222 50%), linear-gradient(135deg, #222 50%, transparent 50%), linear-gradient(to right, #9b9587, #9b9587); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%, calc(100% - 25px) 50%; background-size: 4px 4px, 4px 4px, 1px 65%; background-repeat: no-repeat; border: 3px double #4c463b; cursor: pointer; }
.account-card .schedule-period-fields select:hover, .account-card .schedule-period-fields select:focus-visible { background-color: #f5eedc; outline: 2px solid #222; outline-offset: 1px; }
.account-card .schedule-period-fields input:first-child, .account-card .schedule-period-fields select:first-child { font-weight: bold; border-top: 3px double #4c463b; }
.account-card .schedule-period-fields input:last-child, .account-card .schedule-period-fields select:last-child { margin-bottom: 0; font-style: italic; }
.account-card .schedule-period-fields input::placeholder { color: #766f62; opacity: 0.8; }
.schedule-lunch-break { padding: 10px 8px; background: #fffaf0; text-align: center; border-top: 4px double #777063; border-bottom: 4px double #777063; }
.schedule-lunch-break span { display: inline-block; padding: 2px 14px; color: #3d382f; font-family: Georgia, "Times New Roman", serif; font-size: 0.78rem; font-weight: bold; font-style: italic; letter-spacing: 0.08em; }
.period-times-box { margin-top: 24px; padding: 18px; background: #fffaf0; border: 4px double #222; }
.period-times-box > h4 { margin: 0 0 4px; font-family: Arial, sans-serif; font-size: 0.86rem; letter-spacing: 0.1em; text-transform: uppercase; }
.period-times-box > p { margin: 0 0 14px; color: #555; font-size: 0.82rem; font-style: italic; }
.period-times-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.period-times-table th, .period-times-table td { padding: 9px 10px; border: 1px solid #777063; }
.period-times-table thead th { background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; }
.period-times-table tbody th { width: 25%; background: #e9dec6; font-size: 0.82rem; }
.account-card .period-times-table input[type="time"] { min-height: 42px; margin: 0; padding: 7px 9px; background: rgba(255, 253, 247, 0.82); font-size: 0.85rem; border: 3px double #777063; }
.teacher-groups-table-wrapper { margin-top: 18px; background: #fffaf0; border: 4px double #222; }
.group-access-code-input { min-width: 170px !important; }
.group-code-remove { margin: 7px 0 0 !important; font-size: 0.7rem !important; }
.teacher-groups-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.teacher-groups-table th, .teacher-groups-table td { padding: 10px; border: 1px solid #777063; vertical-align: middle; }
.teacher-groups-table thead th { background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.72rem; letter-spacing: 0.09em; text-align: left; text-transform: uppercase; }
.teacher-groups-table th:last-child, .teacher-groups-table td:last-child { width: 110px; text-align: center; }
.account-card .teacher-groups-table input { min-width: 0; margin: 0; padding: 8px 9px; background: rgba(255, 253, 247, 0.82); font-size: 0.86rem; border: 3px double #777063; }
.account-card .teacher-groups-table .remove-group-button, .account-card .teacher-groups-table .remove-room-button { margin: 0; padding: 7px 9px; font-size: 0.66rem; }
.teacher-rooms-table th:last-child, .teacher-rooms-table td:last-child { box-sizing: border-box; width: 130px; }
.account-card .teacher-rooms-table .remove-room-button { box-sizing: border-box; width: 100%; padding-right: 4px; padding-left: 4px; }
#add-group-button, #add-room-button { margin-top: 16px; }
.recovery-program-box { margin-top: 18px; padding: 14px 16px; background: #fffaf0; border: 4px double #4c463b; }
.recovery-program-box h4 { margin: 0 0 5px; font-family: Arial, sans-serif; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.recovery-program-box p { margin: 0 0 8px; color: #555; font-size: 0.82rem; font-style: italic; }
.recovery-program-options { display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 2px; }
.recovery-program-options .school-info-small { margin: 5px 0; }
.group-evaluations-list { display: grid; gap: 16px; margin-top: 18px; }
.group-evaluation-accordion { background: rgba(255, 250, 240, 0.7); border: 4px double #222; box-shadow: 3px 3px 0 rgba(65, 52, 34, 0.1); }
.group-evaluation-accordion[hidden] { display: none; }
.school-settings-accordion .group-evaluation-accordion > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 28px; padding: 13px 16px; background: #eee4cf; color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.88rem; font-weight: bold; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; list-style: none; }
.school-settings-accordion .group-evaluation-accordion > summary::-webkit-details-marker { display: none; }
.school-settings-accordion .group-evaluation-accordion > summary:hover, .school-settings-accordion .group-evaluation-accordion > summary:focus-visible { background: #222; color: #f5eedc; outline: none; }
.group-evaluation-arrow { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 3px double currentColor; }
.group-evaluation-arrow::before { content: "❯"; font-size: 0.82rem; line-height: 1; transition: transform 0.18s ease; }
.group-evaluation-accordion[open] .group-evaluation-arrow::before { transform: rotate(90deg); }
.group-evaluation-panel { padding: 13px 18px 18px; background: rgba(255, 253, 247, 0.78); border-top: 3px double #777063; }
.group-evaluation-panel label:first-of-type { margin-top: 3px; }
.evaluation-empty-message { margin: 16px 0 0; padding: 13px 15px; background: #fffaf0; font-style: italic; border: 3px double #777063; }
.evaluation-empty-message[hidden] { display: none; }
.teacher-evaluation-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; padding: 16px 18px; background: rgba(255, 250, 240, 0.7); border: 4px double #222; box-shadow: 3px 3px 0 rgba(65, 52, 34, 0.1); }
.teacher-evaluation-row label { margin: 5px 0; }
.account-card .teacher-evaluation-row input:not([type="checkbox"]):not([type="hidden"]), .account-card .teacher-evaluation-row select { box-sizing: border-box; width: 100%; min-height: 44px; margin-top: 7px; padding: 8px 10px; background: rgba(255, 253, 247, 0.86); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.88rem; border: 3px double #777063; border-radius: 0; }
.account-card .teacher-evaluation-row select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #222 50%), linear-gradient(135deg, #222 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.account-card .teacher-evaluation-row .remove-evaluation-button { grid-column: 1 / -1; justify-self: end; margin-top: 8px; }
.evaluation-groups-box { grid-column: 1 / -1; margin: 10px 0 0; }
.evaluation-group-options { display: grid; gap: 9px; }
.evaluation-group-option { display: grid !important; grid-template-columns: 20px minmax(90px, 0.55fr) minmax(170px, 1fr); align-items: center; gap: 10px; margin: 0 !important; padding: 8px 10px; background: rgba(255, 253, 247, 0.64); border-bottom: 1px solid #aaa08f; }
.evaluation-group-option:last-child { border-bottom: 0; }
.evaluation-group-option strong { font-size: 0.9rem; }
.account-card .evaluation-group-option .evaluation-group-date { min-height: 38px !important; margin: 0 !important; padding: 6px 8px !important; }
.account-card .evaluation-group-option .evaluation-group-date:disabled { background: rgba(220, 211, 192, 0.5); cursor: not-allowed; opacity: 0.62; }
#add-evaluation-button { margin-top: 16px; }
.account-card #add-evaluation-button:disabled { cursor: not-allowed; opacity: 0.45; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 3px double #4c463b; }
.account-actions a { display: inline-block; padding: 8px 12px; background: rgba(245, 238, 220, 0.7); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.78rem; font-weight: bold; letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase; border: 3px double #4c463b; }
.account-actions a:hover, .account-actions a:focus-visible { background: #222; color: #f5eedc; }
.account-actions-top { position: absolute; top: 6px; left: 24px; z-index: 2; margin: 0; padding: 0; border: 0; gap: 7px; }
.account-actions-top a { padding: 5px 9px; font-family: Arial, sans-serif; font-size: 0.66rem; letter-spacing: 1px; border: 1px solid #222; }
.account-actions-top a.active { background: #222; color: #f5eedc; }
.notification-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; box-sizing: border-box; padding: 0 4px; background: #b42318; color: #fff; font: bold 0.62rem/1 Arial, sans-serif; letter-spacing: 0; vertical-align: middle; border: 1px solid #fff; border-radius: 999px; box-shadow: 0 0 0 1px #8d1b13; }
.admin-preview-toggle .notification-badge, .admin-preview-action .notification-badge { margin-left: 3px; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; border-bottom: 3px double #4c463b; }
.admin-section-heading h2 { margin: 0; border: 0; }
.admin-message-list { display: grid; gap: 12px; margin: 16px 0 30px; }
.admin-message-card { padding: 16px 18px; background: rgba(255, 253, 247, 0.72); border: 3px double #777063; }
.admin-message-card.is-unread { background: #fffaf0; border-color: #8d1b13; box-shadow: inset 5px 0 0 #b42318; }
.admin-message-card > header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding-bottom: 9px; border-bottom: 1px solid #aaa08f; }
.admin-message-card > header div { display: grid; gap: 2px; }
.admin-message-card > header a { color: #4b3128; font-size: 0.8rem; }
.admin-message-card > header p { margin: 0; color: #666; font-size: 0.7rem; white-space: nowrap; }
.admin-message-body { margin: 14px 0; font-size: 0.9rem; line-height: 1.55; white-space: normal; }
.admin-message-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-message-read-status { color: #666; font-family: Arial, sans-serif; font-size: 0.68rem; font-weight: bold; letter-spacing: 0.08em; text-transform: uppercase; }
.planning-table-wrapper { overflow-x: auto; margin-top: 16px; }
.planning-table { width: 100%; min-width: 680px; border-collapse: collapse; table-layout: fixed; }
.planning-table th, .planning-table td { padding: 10px; border: 1px solid #999; text-align: left; vertical-align: middle; }
.planning-table thead th { background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; }
.planning-table tbody th { width: 16%; background: #e9dec6; font-size: 0.9rem; }
.planning-table tbody td { width: 34%; background: rgba(255, 253, 247, 0.72); }
.account-card .planning-table input, .account-card .planning-table select { box-sizing: border-box; width: 100%; min-height: 40px; margin: 0 0 6px; padding: 7px 9px; background: rgba(255, 253, 247, 0.86); color: #222; font-family: Georgia, "Times New Roman", serif; font-size: 0.82rem; border: 2px solid #777063; }
.account-card .planning-table select:last-child { margin-bottom: 0; }
.weekly-planning-schedule { margin: 20px 0 24px; padding: 14px; background: rgba(255, 253, 247, 0.72); border: 3px double #777063; }
.weekly-planning-schedule h3 { margin: 0 0 12px; font-family: Arial, sans-serif; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.planning-week-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.planning-week-heading h3 { margin: 0 0 12px; }
.planning-week-nav { width: 32px; height: 32px; padding: 0; border: 2px solid #777063; background: #fffdf7; color: #222; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.planning-week-nav:hover, .planning-week-nav:focus-visible { background: #222; color: #f5eedc; }
.planning-week-table-wrapper { overflow-x: auto; }
.planning-week-table { width: 100%; min-width: 700px; border-collapse: collapse; table-layout: fixed; }
.planning-week-table th, .planning-week-table td { padding: 8px; border: 1px solid #999; text-align: center; vertical-align: middle; }
.planning-week-table thead th { background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; }
.planning-week-table thead th:first-child { width: 62px; }
.planning-week-table tbody th { background: #e9dec6; font-size: 0.78rem; }
.planning-week-table tbody td { min-height: 34px; background: rgba(255, 253, 247, 0.86); font-size: 0.76rem; }
.planning-week-table tbody td strong, .planning-week-table tbody td small { display: block; }
.planning-week-table tbody td small { margin-top: 3px; font-size: 0.72rem; font-style: italic; }
.planning-count-offset { display: grid; grid-template-columns: minmax(260px, 1fr) 150px; align-items: center; gap: 8px 14px; margin: 0 0 20px; padding: 12px 14px; background: rgba(234, 223, 201, 0.68); border-left: 5px solid #222; }
.planning-count-offset label { font-weight: bold; }
.account-card .planning-count-offset select { min-height: 38px; padding: 6px 8px; background: #fffdf7; border: 2px solid #777063; }
.planning-count-offset p { grid-column: 1 / -1; margin: 0; font-size: 0.78rem; font-style: italic; }
.planning-disruptions { margin: 0 0 20px; padding: 14px; border: 3px double #777063; background: rgba(255, 253, 247, 0.72); }
.planning-disruptions .theme-title { margin-bottom: 10px; }
.planning-disruption-row { display: grid; grid-template-columns: minmax(180px, 1fr) 125px minmax(260px, 1.35fr); gap: 8px; margin: 8px 0; }
.planning-disruption-row > input { min-width: 0; height: 42px; align-self: start; font-size: 0.86rem; box-sizing: border-box; }
.planning-disruption-row > input[type="date"] { padding-left: 5px; padding-right: 3px; font-size: 0.78rem; }
.planning-disruption-row select { min-height: 42px; }
.planning-disruption-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px; border: 1px solid #999; background: #fffdf7; }
.planning-disruption-groups label { font-family: Arial, sans-serif; font-size: 0.8rem; white-space: nowrap; }
@media (max-width: 700px) { .planning-disruption-row { grid-template-columns: 1fr; } }
.account-card .danger-button { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.account-card .danger-button:hover, .account-card .danger-button:focus-visible { background: #fff; color: #7f1d1d; outline: 1px solid #7f1d1d; }
.account-table { width: 100%; border-collapse: collapse; }
.account-table th, .account-table td { padding: 10px; border: 1px solid #999; text-align: left; }
.account-table th { background: #222; color: #f5eedc; }
.inline-form { display: inline; }
.inline-form button { margin: 2px; font-size: 0.75rem; }
.course-access-form { display: block; margin: 3px 0; }
.course-access-button.has-access { background: #294f35; color: #fffaf0; }
.course-access-button.no-access { background: #6a2f2a; color: #fffaf0; }

.access-gateway { max-width: 980px; text-align: center; }
.access-gateway-intro { margin-bottom: 26px; font-style: italic; }
.access-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.access-choice-card { display: flex; flex-direction: column; padding: 24px; text-align: left; border: 5px double #222; }
.access-choice-student { background: rgba(234, 223, 201, 0.68); }
.access-choice-teacher { background: rgba(226, 226, 222, 0.76); }
.access-choice-label { font-family: Arial, sans-serif; font-size: 0.68rem; font-weight: bold; letter-spacing: 0.14em; text-transform: uppercase; }
.access-choice-card h3 { margin: 8px 0 10px; font-size: 1.35rem; line-height: 1.25; }
.access-choice-card p { margin: 0 0 16px; font-size: 0.9rem; line-height: 1.5; }
.access-choice-card form { margin-top: auto; }
.access-teacher-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; margin-top: auto; }
.access-teacher-login { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 10px 8px; background: #222; color: #f5eedc; font-family: Arial, sans-serif; font-size: 0.7rem; font-weight: bold; line-height: 1.25; letter-spacing: 0.07em; text-align: center; text-decoration: none; text-transform: uppercase; border: 4px double #f5eedc; outline: 1px solid #222; }
.access-teacher-login:hover, .access-teacher-login:focus-visible { background: #f5eedc; color: #222; border-color: #222; outline: 1px solid #222; }

.admin-preview-control {
    position: relative;
    z-index: 5;
    width: fit-content;
    margin: 12px;
    gap: 4px;
    align-items: center;
    justify-self: start;
    align-self: end;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-family: Arial, sans-serif;
    line-height: 1.2;
}
.admin-preview-control.admin-preview-in-header { position: absolute; top: 31px; left: -38px; margin: 0; }
.admin-preview-toggle { margin: 0; padding: 3px 6px; background: rgba(245, 238, 220, 0.72); color: #333; opacity: 0.72; font: bold 0.54rem Arial, sans-serif; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid rgba(34, 34, 34, 0.65); cursor: pointer; }
.admin-preview-toggle:hover, .admin-preview-toggle:focus-visible { opacity: 1; background: rgba(255, 253, 247, 0.96); outline: 1px solid #222; outline-offset: 1px; }
.admin-preview-toggle[aria-expanded="true"] { opacity: 1; background: #222; color: #fff; }
.admin-tools-menu { position: absolute; top: calc(100% + 4px); left: 0; display: grid; grid-template-columns: 1fr; width: 180px; padding: 6px; gap: 5px; background: rgba(255, 253, 247, 0.98); border: 2px solid #222; box-shadow: 3px 3px 0 rgba(34, 34, 34, 0.22); }
.admin-tools-menu[hidden] { display: none; }
.admin-tools-menu.is-choosing-group { grid-template-columns: 1fr; }
.admin-preview-action { box-sizing: border-box; width: 100%; margin: 0; padding: 6px 8px; background: #f5eedc; color: #222; font: bold 0.6rem Arial, sans-serif; letter-spacing: 0.04em; text-align: left; text-decoration: none; text-transform: uppercase; border: 1px solid #777; cursor: pointer; }
.admin-preview-action:hover, .admin-preview-action:focus-visible { background: #222; color: #fff; outline: none; }
.admin-preview-action[aria-pressed="true"] { background: #444; color: #fff; }
.admin-cycle-day-select { box-sizing: border-box; width: 100%; min-height: 28px; margin: 0; padding: 5px 7px; background: #fffdf7; color: #222; font: bold 0.62rem Arial, sans-serif; letter-spacing: 0.03em; text-transform: uppercase; border: 1px solid #777; cursor: pointer; }
.admin-cycle-day-select:focus-visible { outline: 2px solid #222; outline-offset: 1px; }
.admin-preview-group-input { width: 125px; min-height: 23px; margin: 0; padding: 2px 5px; background: rgba(255, 253, 247, 0.94); color: #222; font: 0.66rem Georgia, serif; border: 1px solid #777; }
.admin-preview-status { grid-column: 1 / -1; max-width: 250px; color: #6a2f2a; font-size: 0.65rem; }

@media (max-width: 620px) {
    .admin-preview-control { max-width: 180px; margin: 6px; }
    .admin-preview-control.admin-preview-in-header { top: 31px; left: 0; margin: 0; }
    .admin-tools-menu { width: 165px; }
    .admin-preview-group-input { width: 100%; }
    .admin-preview-status { grid-column: 1; }
}

@media (max-width: 700px) {
    .access-choice-grid { grid-template-columns: 1fr; }
    .access-choice-card { padding: 18px; }
}

@media (max-width: 900px) { .schedule-days-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .account-card { padding: 22px 16px; } .account-table { font-size: 0.8rem; } .time-picker-grid, .recovery-details-grid, .schedule-days-grid, .cycle-length-control, .teacher-evaluation-row { grid-template-columns: 1fr; gap: 14px; } .cycle-length-control p { grid-column: 1; } .recovery-schedule { padding: 12px; } .account-actions-top { position: static; justify-content: flex-end; margin: 0 0 20px; } .school-settings-accordion summary { padding: 9px; font-size: 0.72rem; letter-spacing: 0.07em; } .school-settings-panel { padding: 12px; } .teacher-groups-table th, .teacher-groups-table td { padding: 6px; } .teacher-groups-table th:last-child, .teacher-groups-table td:last-child { width: 78px; } .account-card .teacher-groups-table .remove-group-button, .account-card .teacher-groups-table .remove-room-button { padding: 6px 4px; font-size: 0.56rem; } }
@media (max-width: 700px) { .admin-section-heading, .admin-message-card > header { align-items: stretch; flex-direction: column; } .admin-message-card > header p { white-space: normal; } }
@media (max-width: 560px) { .evaluation-group-option { grid-template-columns: 20px minmax(0, 1fr); } .evaluation-group-option .evaluation-group-date { grid-column: 1 / -1; } }

.school-recovery-location { display: inline-block; margin-top: 3px; font-size: 0.78rem; font-style: italic; }
.school-recovery-programs { display: inline-block; margin-top: 5px; padding-top: 4px; color: #4d463b; font-size: 0.7rem; font-weight: bold; letter-spacing: 0.03em; border-top: 1px solid #aaa08f; }

.level-choice-login {
    display: inline-block;
    margin-top: 24px;
    padding: 9px 15px;
    color: #222;
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid #222;
}

.level-choice-login:hover,
.level-choice-login:focus-visible {
    background: #222;
    color: #f5eedc;
    outline: none;
}
.school-schedule-program { font-style: italic; }


/* =========================================================
   SECONDAIRE 4 — JOURNAL NOIR ET BLANC DES ANNÉES 1960
   Taches d'encre et aplats, sans trame de lignes décoratives
========================================================= */

body.secondary-4-page {
    background-color: #cfcfcb;
    background-image:
        radial-gradient(ellipse 120px 70px at 5% 9%, rgba(0, 0, 0, 0.18) 0 18%, rgba(0, 0, 0, 0.07) 42%, transparent 72%),
        radial-gradient(ellipse 85px 145px at 96% 24%, rgba(0, 0, 0, 0.12) 0 20%, rgba(0, 0, 0, 0.04) 48%, transparent 74%),
        radial-gradient(circle 18px at 12% 72%, rgba(0, 0, 0, 0.14) 0 38%, transparent 72%),
        radial-gradient(circle 10px at 88% 84%, rgba(0, 0, 0, 0.2) 0 32%, transparent 70%),
        radial-gradient(circle 5px at 93% 62%, rgba(0, 0, 0, 0.22) 0 35%, transparent 72%),
        radial-gradient(circle 7px at 7% 45%, rgba(0, 0, 0, 0.16) 0 34%, transparent 72%);
    background-attachment: fixed;
    color: #0d0d0d;
}

body.secondary-4-page .newspaper-header {
    overflow: visible;
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 150px 65px at 2% 12%, rgba(0, 0, 0, 0.15) 0 18%, rgba(0, 0, 0, 0.05) 46%, transparent 72%),
        radial-gradient(ellipse 95px 40px at 91% 88%, rgba(0, 0, 0, 0.12) 0 24%, transparent 72%),
        radial-gradient(circle 7px at 78% 20%, rgba(0, 0, 0, 0.2) 0 34%, transparent 72%),
        linear-gradient(90deg, rgba(239, 239, 236, 0.25) 0%, rgba(239, 239, 236, 0.86) 8%, #e5e5e1 22%, #e5e5e1 78%, rgba(239, 239, 236, 0.86) 92%, rgba(239, 239, 236, 0.25) 100%);
}

body.secondary-4-page .top-line {
    border: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 7%, rgba(255, 255, 255, 0.72) 22%, rgba(255, 255, 255, 0.72) 78%, rgba(255, 255, 255, 0.4) 93%, transparent 100%);
}

body.secondary-4-page .newspaper-header h1 {
    color: #050505;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 rgba(0, 0, 0, 0.18);
}

body.secondary-4-page .school-level-menu {
    background: #d7d7d3;
}

body.secondary-4-page .school-level-menu a:hover,
body.secondary-4-page .school-level-menu a:focus-visible {
    background: #111;
    color: #fff;
}

body.secondary-4-page .header-account-link,
body.secondary-4-page .header-contact-link,
body.secondary-4-page .header-student-button {
    background: #efefec;
    color: #111;
    border-color: #111;
}

body.secondary-4-page .header-account-link:hover,
body.secondary-4-page .header-account-link:focus-visible,
body.secondary-4-page .header-contact-link:hover,
body.secondary-4-page .header-contact-link:focus-visible,
body.secondary-4-page .header-student-button:hover,
body.secondary-4-page .header-student-button:focus-visible {
    background: #111;
    color: #fff;
}

body.secondary-4-page .main-nav,
body.secondary-4-page .home-link,
body.secondary-4-page .nav-item > a,
body.secondary-4-page .dropdown-menu,
body.secondary-4-page .dropdown-menu a {
    background: #111;
    color: #f7f7f4;
}

body.secondary-4-page .main-nav,
body.secondary-4-page .dropdown-menu {
    border-color: #111;
}

body.secondary-4-page .home-link.active,
body.secondary-4-page .nav-item > a.active,
body.secondary-4-page .home-link:hover,
body.secondary-4-page .home-link:focus,
body.secondary-4-page .nav-item:hover > a,
body.secondary-4-page .nav-item:focus-within > a,
body.secondary-4-page .dropdown-menu a:hover,
body.secondary-4-page .dropdown-menu a:focus,
body.secondary-4-page .dropdown-menu a.active-course {
    background: linear-gradient(135deg, #eeeeeb 0%, #c7c7c3 48%, #ddddda 100%);
    color: #080808;
}

body.secondary-4-page .newspaper,
body.secondary-4-page.theme-page .newspaper {
    position: relative;
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 175px 80px at 4% 7%, rgba(0, 0, 0, 0.09) 0 16%, rgba(0, 0, 0, 0.025) 48%, transparent 73%),
        radial-gradient(ellipse 90px 160px at 98% 35%, rgba(0, 0, 0, 0.075) 0 19%, rgba(0, 0, 0, 0.02) 50%, transparent 74%),
        radial-gradient(circle 13px at 17% 42%, rgba(0, 0, 0, 0.09) 0 34%, transparent 72%),
        radial-gradient(circle 6px at 82% 11%, rgba(0, 0, 0, 0.13) 0 36%, transparent 72%),
        radial-gradient(circle 9px at 89% 76%, rgba(0, 0, 0, 0.1) 0 34%, transparent 72%),
        radial-gradient(circle 4px at 32% 91%, rgba(0, 0, 0, 0.16) 0 36%, transparent 72%),
        linear-gradient(90deg, rgba(246, 246, 243, 0.5) 0%, rgba(246, 246, 243, 0.9) 8%, #f2f2ef 20%, #f2f2ef 80%, rgba(246, 246, 243, 0.9) 92%, rgba(246, 246, 243, 0.5) 100%);
    box-shadow: -12px 0 24px rgba(0, 0, 0, 0.18), 12px 0 24px rgba(0, 0, 0, 0.18);
}

body.secondary-4-page .lesson-header,
body.secondary-4-page .period-header {
    padding: 28px 24px;
    border: 0;
    background:
        radial-gradient(ellipse 120px 48px at 8% 12%, rgba(0, 0, 0, 0.13) 0 22%, transparent 74%),
        radial-gradient(ellipse 70px 35px at 92% 86%, rgba(0, 0, 0, 0.1) 0 24%, transparent 74%),
        linear-gradient(90deg, rgba(220, 220, 216, 0.18) 0%, rgba(220, 220, 216, 0.72) 9%, rgba(232, 232, 228, 0.86) 24%, rgba(232, 232, 228, 0.86) 76%, rgba(220, 220, 216, 0.72) 91%, rgba(220, 220, 216, 0.18) 100%);
}

body.secondary-4-page .lead-story {
    column-rule: 0;
}

body.secondary-4-page .author {
    display: inline-block;
    padding: 5px 9px;
    background: #111;
    color: #fff;
    border: 0;
}

body.secondary-4-page .fact-box,
body.secondary-4-page.theme-page .fact-box,
body.secondary-4-page .question-box,
body.secondary-4-page .info-card {
    border: 0;
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 85px 42px at 4% 16%, rgba(0, 0, 0, 0.12) 0 19%, transparent 72%),
        radial-gradient(circle 8px at 92% 78%, rgba(0, 0, 0, 0.16) 0 34%, transparent 72%),
        linear-gradient(135deg, #eeeeeb 0%, #d2d2ce 52%, #e5e5e1 100%);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.13);
}

body.secondary-4-page .fact-box h3,
body.secondary-4-page.theme-page .fact-box h3 {
    border: 0;
}

body.secondary-4-page .period-overview > h3,
body.secondary-4-page .section-title,
body.secondary-4-page .theme-title,
body.secondary-4-page .course-section-title {
    border: 0;
}

body.secondary-4-page .period-overview > h3 {
    padding: 10px 14px;
    background: #111;
    color: #fff;
}

body.secondary-4-page .overview-columns > div,
body.secondary-4-page .theme-card {
    border: 0;
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 65px 30px at 96% 8%, rgba(0, 0, 0, 0.1) 0 20%, transparent 72%),
        radial-gradient(circle 5px at 7% 87%, rgba(0, 0, 0, 0.16) 0 36%, transparent 72%),
        linear-gradient(135deg, rgba(238, 238, 235, 0.9) 0%, rgba(205, 205, 201, 0.76) 52%, rgba(231, 231, 227, 0.9) 100%);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.12);
}

body.secondary-4-page .overview-columns > div {
    padding: 18px;
}

body.secondary-4-page .theme-card:hover {
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 65px 30px at 96% 8%, rgba(0, 0, 0, 0.13) 0 20%, transparent 72%),
        radial-gradient(circle 5px at 7% 87%, rgba(0, 0, 0, 0.19) 0 36%, transparent 72%),
        linear-gradient(135deg, #dededb 0%, #bebeba 52%, #d7d7d3 100%);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
}

body.secondary-4-page .section-title span,
body.secondary-4-page .theme-title span,
body.secondary-4-page .course-table th {
    background: #111;
    color: #fff;
}

body.secondary-4-page .read-more,
body.secondary-4-page .school-recovery-programs {
    border: 0;
    background: #111;
    color: #fff;
    padding: 3px 7px;
}

body.secondary-4-page .school-info-box {
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 70px 35px at 6% 8%, rgba(0, 0, 0, 0.12) 0 20%, transparent 72%),
        radial-gradient(circle 6px at 91% 89%, rgba(0, 0, 0, 0.15) 0 35%, transparent 72%),
        linear-gradient(135deg, #f2f2ef 0%, #d2d2ce 58%, #e9e9e6 100%);
    border: 0;
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.18);
}

body.secondary-4-page .school-info-divider,
body.secondary-4-page .school-info-date {
    border: 0;
    background: transparent;
}

body.secondary-4-page .visitor-choice-options,
body.secondary-4-page .visitor-choice-option,
body.secondary-4-page .visitor-selected-teacher,
body.secondary-4-page .visitor-selected-group {
    background: #ededeb;
    border-color: #111;
}

body.secondary-4-page .school-info-small,
body.secondary-4-page .course-image figcaption {
    color: #3d3d3d;
}

/* Le compte conserve le thème gris et blanc lorsqu'il est ouvert depuis le secondaire 4. */
body.account-page.secondary-4-page .account-card,
body.secondary-4-page .account-card:not(.newspaper) {
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 95px 44px at 7% 8%, rgba(0, 0, 0, 0.1) 0 18%, transparent 72%),
        linear-gradient(135deg, #f5f5f2 0%, #d5d5d1 54%, #ededeb 100%);
    border-color: #111;
    box-shadow: 8px 9px 0 rgba(0, 0, 0, 0.16);
}

body.secondary-4-page .access-choice-student,
body.secondary-4-page .access-choice-teacher {
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 80px 38px at 8% 10%, rgba(0, 0, 0, 0.09) 0 20%, transparent 72%),
        linear-gradient(135deg, rgba(239, 239, 236, 0.94) 0%, rgba(207, 207, 203, 0.88) 54%, rgba(232, 232, 229, 0.94) 100%);
    border-color: #111;
}

body.secondary-4-page .access-teacher-login,
body.secondary-4-page .access-choice-student button {
    background: #111;
    color: #fff;
    border-color: #efefec;
    outline-color: #111;
}

.license-page { min-height: 100vh; padding-bottom: 48px; }
.license-required-card { max-width: 920px; min-height: 0; margin-top: 34px; }
.license-required-message { margin: 28px 0 12px; padding: clamp(24px, 5vw, 48px); text-align: center; border: 5px double #222; background: rgba(239, 228, 205, 0.58); }
.license-required-label { display: inline-block; padding: 5px 9px; background: #222; color: #f5eedc; font: bold 0.68rem Arial, sans-serif; letter-spacing: 0.15em; }
.license-required-message h3 { margin: 20px auto 14px; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.25; }
.license-required-message p { max-width: 680px; margin: 10px auto; font-size: 1rem; line-height: 1.55; }
.license-required-actions { justify-content: center; }

body.secondary-4-page .license-required-message {
    border-color: #111;
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 90px 42px at 7% 10%, rgba(0, 0, 0, 0.1) 0 20%, transparent 72%),
        linear-gradient(135deg, rgba(239, 239, 236, 0.94), rgba(202, 202, 198, 0.88) 54%, rgba(230, 230, 227, 0.94));
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.14);
}
body.secondary-4-page .license-required-label { background: #111; color: #fff; }

body.secondary-4-page .account-card input:not([type="checkbox"]),
body.secondary-4-page .account-card select,
body.secondary-4-page .account-card fieldset,
body.secondary-4-page .account-help,
body.secondary-4-page .recovery-schedule,
body.secondary-4-page .split-recovery-toggle,
body.secondary-4-page .cycle-length-control,
body.secondary-4-page .period-times-box,
body.secondary-4-page .teacher-groups-table-wrapper,
body.secondary-4-page .recovery-program-box,
body.secondary-4-page .group-evaluation-accordion,
body.secondary-4-page .teacher-evaluation-row,
body.secondary-4-page .evaluation-empty-message {
    background-color: rgba(238, 238, 235, 0.82);
    border-color: #444;
}

body.secondary-4-page .account-card input[readonly] {
    background: rgba(207, 207, 203, 0.72);
    color: #333;
}

body.secondary-4-page .account-actions a,
body.secondary-4-page .account-card .password-toggle-button {
    background: #e1e1de;
    color: #111;
    border-color: #333;
}

body.secondary-4-page .account-actions a:hover,
body.secondary-4-page .account-actions a:focus-visible,
body.secondary-4-page .account-card .password-toggle-button:hover,
body.secondary-4-page .account-card .password-toggle-button:focus-visible {
    background: #111;
    color: #fff;
}


/* =========================================================
   SECONDAIRE 3 — TACHES SUR LE FOND EXTÉRIEUR UNIQUEMENT
========================================================= */

body.secondary-3-page {
    background-color: #e5d8bf;
    background-image:
        radial-gradient(ellipse 145px 82px at 4% 11%, rgba(78, 56, 29, 0.17) 0 17%, rgba(78, 56, 29, 0.055) 45%, transparent 73%),
        radial-gradient(ellipse 95px 155px at 97% 28%, rgba(89, 65, 34, 0.12) 0 19%, rgba(89, 65, 34, 0.035) 50%, transparent 74%),
        radial-gradient(circle 16px at 10% 73%, rgba(67, 48, 27, 0.13) 0 34%, transparent 72%),
        radial-gradient(circle 9px at 91% 84%, rgba(63, 45, 25, 0.17) 0 34%, transparent 72%),
        radial-gradient(circle 5px at 7% 45%, rgba(72, 50, 25, 0.2) 0 35%, transparent 72%),
        radial-gradient(circle 6px at 95% 59%, rgba(77, 54, 27, 0.16) 0 34%, transparent 72%);
    background-attachment: fixed;
}

/* Page du programme de quatrième secondaire : structure de l'accueil de troisième secondaire. */
body.secondary-4-page .program-periods .facts a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
    color: #111;
    text-align: center;
    text-decoration: none;
    border-right: 1px solid #888;
}

body.secondary-4-page .program-periods .facts a:last-child {
    border-right: 0;
}

body.secondary-4-page .program-periods .facts a:hover,
body.secondary-4-page .program-periods .facts a:focus-visible {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(198, 198, 195, 0.42));
}

body.secondary-4-page .program-period {
    margin-top: 54px;
}

body.secondary-4-page .program-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.secondary-4-page .program-topics li {
    padding: 15px 12px 12px;
    border-top: 3px solid #222;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(214, 214, 211, 0.3));
}

body.secondary-4-page .program-topics strong,
body.secondary-4-page .program-topics span {
    display: block;
}

body.secondary-4-page .program-topics strong {
    margin-bottom: 8px;
    font-size: 1.18rem;
}

body.secondary-4-page .program-topics span {
    line-height: 1.55;
}

@media (max-width: 700px) {
    body.secondary-4-page .program-periods .facts a {
        border-right: 0;
    }

    body.secondary-4-page .program-topics {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* =========================================================
   PAGE D'ENTRÉE — CHOIX DU NIVEAU
========================================================= */

body.level-choice-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 20px;
    background-color: #d9d3c7;
    background-image:
        radial-gradient(ellipse 180px 85px at 7% 12%, rgba(70, 51, 28, 0.14), transparent 72%),
        radial-gradient(ellipse 165px 75px at 92% 86%, rgba(0, 0, 0, 0.12), transparent 74%),
        linear-gradient(135deg, #eee3cd 0%, #f6f1e7 47%, #e1e1de 53%, #cacac7 100%);
    color: #171717;
}

.level-choice-card {
    position: relative;
    width: min(980px, 100%);
    padding: clamp(32px, 6vw, 68px);
    text-align: center;
    background: linear-gradient(105deg, rgba(255, 253, 247, 0.96), rgba(244, 241, 232, 0.96) 50%, rgba(239, 239, 236, 0.96));
    border: 5px double #222;
    box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.12);
}

.level-choice-edition {
    margin: 0 0 10px;
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.28em;
}

.level-choice-card h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5.5vw, 4.6rem);
    line-height: 0.95;
    white-space: nowrap;
}

.level-choice-rule {
    height: 5px;
    margin: 30px 0;
    border-top: 2px solid #222;
    border-bottom: 1px solid #222;
}

.level-choice-card h2 {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.7rem);
    line-height: 1.15;
}

.level-choice-introduction {
    margin: 0 0 30px;
    font-size: 1rem;
    font-style: italic;
}

.level-choice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.site-creator-credit {
    font-family: Arial, sans-serif;
    font-size: 0.64rem;
    font-weight: normal;
    letter-spacing: 0.08em;
    text-align: center;
}

.level-choice-credit {
    margin: 28px 0 -34px;
    padding-top: 13px;
    border-top: 1px solid rgba(34, 34, 34, 0.48);
}

.level-choice-card .level-choice-login {
    position: absolute;
    top: 18px;
    right: 18px;
    margin: 0;
}

.level-choice-button {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #151515;
    text-decoration: none;
    text-transform: uppercase;
    border: 4px double #222;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.level-choice-button span {
    font-family: Arial, sans-serif;
    font-size: 0.76rem;
    font-weight: bold;
    letter-spacing: 0.18em;
}

.level-choice-button strong {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.level-choice-sec3 {
    background: linear-gradient(135deg, #eadfc9, #fffaf0);
}

.level-choice-sec4 {
    background: linear-gradient(135deg, #f7f7f4, #cfcfcb);
}

.level-choice-button:hover,
.level-choice-button:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.2);
}

.level-choice-button:focus-visible {
    outline: 3px solid #222;
    outline-offset: 4px;
}

@media (max-width: 620px) {
    body.level-choice-page {
        padding: 18px 12px;
    }

    .level-choice-card {
        padding: 32px 18px;
        box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.12);
    }

    .level-choice-actions {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .level-choice-card .level-choice-login {
        position: static;
        margin-top: 22px;
    }

    .level-choice-button {
        min-height: 104px;
    }
}
