/* Font Variables */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Nunito', sans-serif;

    /* Blue-Dominant Palette */
    --color-primary: #00A8E8;
    /* Sky Blue */
    --color-primary-dark: #007EA7;
    --color-royal: #003459;
    /* Deep Blue */
    --color-text: #4a5568;
    /* Grey */

    /* Accents */
    --color-secondary: #7209B7;
    /* Violet */
    --color-accent: #EF476F;
    /* Pink */
    --color-success: #06D6A0;
    /* Mint */

    --color-bg-light: #F0F8FF;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--color-text);
    background-color: #f8fbff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure footer sticks to bottom with no white space */
footer.bg-footer {
    margin-top: auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: var(--font-heading);
    color: var(--color-royal);
    font-weight: 700;
}

/* Utility Classes for Colors */
.text-royal {
    color: var(--color-royal) !important;
}

.bg-royal {
    background-color: var(--color-royal) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

.bg-primary {
    background-color: var(--color-primary) !important;
}

.text-secondary {
    color: var(--color-secondary) !important;
}

/* Navbar */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0;
    border-bottom: 3px solid var(--color-primary);
    z-index: 1020;
    /* Valeur standard, ne la monte pas trop haut */
    /* Ensure it stays behind modals/offcanvas */
}

.navbar-brand img {
    /* Rounded Pastille Style */
    background: var(--color-royal);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 55px;
    /* Slightly larger to fit padding */
    width: 55px;
    object-fit: contain;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-royal) !important;
}

.nav-link {
    font-weight: 600;
    color: var(--color-royal) !important;
    transition: all 0.3s;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary) !important;
    background-color: rgba(0, 168, 232, 0.05);
    /* Default nav link hover */
}

/* Carousel */
.carousel-caption {
    background: none;
    backdrop-filter: none;
    border-radius: 0;
    padding: 1.5rem 10%;
    bottom: 8%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    text-align: left;
}

.carousel-caption h1,
.carousel-caption h2 {
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 0, 0, 0.4);
    font-weight: 800;
}

.carousel-caption p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Animations */
.slide-in-bottom {
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 {
    animation-delay: 0.2s;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
.bg-light-fun {
    background-color: var(--color-bg-light);
}

/* Fix Scroll Offset for Anchor Links */
section {
    scroll-margin-top: 100px;
}

.bg-royal-light {
    background-color: #E0F2FE;
    color: var(--color-royal);
}

.sep-line {
    height: 4px;
    width: 60px;
    background-color: var(--color-primary);
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

/* Cards */
.card-team {
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-team:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 52, 89, 0.1);
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    padding: 3px;
    background: white;
}

/* Agenda */
.date-box {
    font-family: var(--font-heading);
    border-radius: 12px;
}
 
.date-box.primary {
    background-color: var(--color-primary);
    color: white;
}

.date-box.secondary {
    background-color: var(--color-secondary);
    color: white;
}

.date-box.accent {
    background-color: var(--color-accent);
    color: white;
}

.date-box.success {
    background-color: var(--color-success);
    color: white;
}

.bg-menu {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

/* Tabs */
.nav-pills .nav-link {
    border-radius: 50rem;
    padding: 0.5rem 1.5rem;
    color: var(--color-royal);
    background: white;
    border: 1px solid var(--color-primary);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.nav-pills .nav-link:hover {
    background-color: var(--color-primary);
    /* Blue background on hover */
    color: white !important;
    /* White text on hover */
}

.nav-pills .nav-link.active {
    background-color: var(--color-primary);
    color: white !important;
    /* White text for active state */
}

/* Footer */
.bg-footer {
    background-color: var(--color-royal);
    color: white;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--color-primary);
}

.grayscale-logo {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    border: none;
}

.btn-royal {
    background-color: var(--color-royal);
    color: white;
}

.btn-royal:hover {
    background-color: #002038;
    color: white !important;
}

.btn-action {
    background-color: var(--color-accent);
    color: white;
}

.btn-action:hover {
    background-color: #d13056;
    color: white !important;
}

/* --- Visual Polish Additions --- */

/* Dots Pattern */
.bg-dots {
    background-color: #ffffff;
    background-image: radial-gradient(#4a90e2 1px, transparent 1px);
    background-size: 20px 20px;
}





/* Loading Spinner */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #322BC0;
    /* Royal Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Explicit Z-Index Hierarchy - User Request */
/* On force l'offcanvas à être au-dessus de TOUT, y compris la navbar sticky */
.offcanvas {
    z-index: 1055 !important;
    /* Bootstrap Navbar est à 1020, Backdrop à 1040 */
}

/* Le fond grisé doit être juste en dessous de l'offcanvas */
.offcanvas-backdrop {
    z-index: 1050 !important;
}

/* Modal au-dessus de l'offcanvas si besoin, ou même niveau */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1058 !important;
    /* Just below modal */
}

.modal-dialog {
    z-index: 1061;
}

/* ===============================================
   PRÉSENTATION — Nouveau design
   =============================================== */

.school-identity-card {
    background: linear-gradient(135deg, var(--color-royal) 0%, #00618a 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.school-identity-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, .05);
    border-radius: 50%;
}

.school-identity-card .badge-esv {
    background: rgba(255, 255, 255, .15);
    color: white;
    font-size: .78rem;
    padding: .3rem .8rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: .75rem;
}

.school-identity-card h3 {
    color: white;
    font-size: 1.35rem;
    margin-bottom: .4rem;
}

.school-identity-card p {
    color: rgba(255, 255, 255, .8);
    font-size: .92rem;
    margin-bottom: 0;
}

.info-pill {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    padding: .45rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-royal);
    white-space: nowrap;
}

.info-pill i {
    color: var(--color-primary);
    font-size: 1rem;
}

.text-truncated-content {
    overflow: hidden;
    transition: max-height .4s ease;
}

.text-truncated-content.collapsed {
    max-height: 340px;
}

.text-truncated-content.expanded {
    max-height: 1000px;
}

.read-more-fade {
    position: relative;
    margin-top: -3rem;
    padding-top: 3rem;
    background: linear-gradient(to bottom, transparent, var(--color-bg-light));
    text-align: center;
}

.read-more-fade.hidden {
    display: none;
}

.director-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.2rem;
    background: white;
    border-radius: 14px;
    border: 1px solid #e8f4ff;
    box-shadow: 0 2px 8px rgba(0, 52, 89, .06);
}

.director-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-royal), var(--color-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 1.2rem;
}

/* ===============================================
   PROJET ÉDUCATIF — Accordéon
   =============================================== */

.projet-hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f4ff 100%);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.projet-hero .citation {
    font-size: .95rem;
    color: #64748b;
    font-style: italic;
    max-width: 480px;
    margin: .5rem auto 0;
}

.edu-accordion .accordion-item {
    border: none;
    border-radius: 14px !important;
    margin-bottom: .75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 52, 89, .06);
}

.edu-accordion .accordion-button {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-royal);
    background: white;
    border-radius: 14px !important;
    padding: 1.1rem 1.5rem;
    gap: 1rem;
}

.edu-accordion .accordion-button:not(.collapsed) {
    background: #f0f8ff;
    color: var(--color-royal);
    box-shadow: none;
}

.edu-accordion .accordion-button .acc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.acc-icon.blue {
    background: linear-gradient(135deg, #003459, #00A8E8);
}

.acc-icon.green {
    background: linear-gradient(135deg, #064e3b, #06D6A0);
}

.acc-icon.violet {
    background: linear-gradient(135deg, #4c1d95, #7209B7);
}

.acc-icon.pink {
    background: linear-gradient(135deg, #9f1239, #EF476F);
}

.acc-icon.sky {
    background: linear-gradient(135deg, #0369a1, #38bdf8);
}

.acc-icon.teal {
    background: linear-gradient(135deg, #115e59, #0d9488);
}

.edu-accordion .accordion-body {
    background: white;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid #f0f8ff;
}

.edu-accordion .accordion-body p {
    font-size: .95rem;
    color: var(--color-text);
}

.edu-accordion .accordion-body .quote {
    font-style: italic;
    color: #64748b;
    font-size: .9rem;
    border-left: 3px solid var(--color-primary);
    padding-left: .75rem;
    margin-bottom: 1rem;
}

.suivi-card {
    background: linear-gradient(135deg, #f0f8ff, #e8f4ff);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
}

.suivi-card li {
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
}

/* ===============================================
   NEWSLETTER — Bandeau + Modal
   =============================================== */

.newsletter-strip {
    background: linear-gradient(135deg, #003459 0%, #00618a 100%);
    padding: 1.25rem 0;
}

.newsletter-strip h5 {
    color: white;
    font-size: 1rem;
    margin-bottom: .15rem;
}

.newsletter-strip p {
    color: rgba(255, 255, 255, .7);
    font-size: .82rem;
    margin: 0;
}

.newsletter-modal-header {
    background: linear-gradient(135deg, var(--color-royal) 0%, #00618a 100%);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.newsletter-modal-header h5 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: .3rem;
}

.newsletter-modal-header p {
    color: rgba(255, 255, 255, .8);
    font-size: .88rem;
    margin: 0;
}

.newsletter-benefit {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    font-size: .88rem;
}

.newsletter-benefit i {
    color: var(--color-primary);
    font-size: 1rem;
}

.form-control-newsletter {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .95rem;
    transition: border-color .2s;
}

.form-control-newsletter:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, .1);
    outline: none;
}

.btn-newsletter-submit {
    background: linear-gradient(135deg, var(--color-royal), var(--color-primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: .75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    transition: opacity .2s;
}

.btn-newsletter-submit:hover {
    opacity: .9;
}

/* ===============================================
   STATS LINE — Carte bleue identité
   =============================================== */

.stats-line {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
    flex-wrap: wrap;
}

.stats-sep {
    color: rgba(255, 255, 255, .35);
}

/* ===============================================
   MAP INFO BAR — Adresse sous la carte
   =============================================== */

.map-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
    padding: .6rem 1rem;
    background: rgba(0, 52, 89, .04);
    border-radius: 12px;
    font-size: .84rem;
    color: var(--color-text);
}

/* ===============================================
   HORAIRES & CONTACT — Card unifiée avec tabs
   =============================================== */

.horaires-contact-card {
    border: 1px solid #e8f4ff !important;
}

/* Override des pills globaux pour les tabs horaires plus compacts */
.horaires-tabs.nav-pills .nav-link {
    font-size: .75rem;
    padding: .3rem .8rem;
    border-radius: 20px;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: var(--color-text);
    transition: all .2s ease;
}

.horaires-tabs.nav-pills .nav-link:hover {
    background: var(--color-primary);
    color: white !important;
    border-color: var(--color-primary);
}

.horaires-tabs.nav-pills .nav-link.active {
    background: var(--color-primary);
    color: white !important;
    border-color: var(--color-primary);
}

.horaires-block {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    border-left: 4px solid;
}

.horaires-block.blue {
    background: #e0f2fe;
    border-left-color: var(--color-primary);
}

.horaires-block.purple {
    background: #ede9fe;
    border-left-color: var(--color-secondary);
}

.horaires-block.teal {
    background: #f0fdfa;
    border-left-color: #0d9488;
}

.horaires-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 0;
    font-size: .9rem;
}

.horaires-row span {
    color: var(--color-text);
}

.horaires-row strong {
    color: var(--color-royal);
}

.horaires-note {
    font-size: .78rem;
    color: #94a3b8;
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px dashed rgba(0, 0, 0, .08);
}

/* Tooltip périscolaire */
.peri-tooltip {
    color: #94a3b8;
    cursor: help;
    font-size: .85rem;
    transition: color .2s;
}

.peri-tooltip:hover,
.peri-tooltip:focus {
    color: var(--color-primary);
}

/* ========================================= */
/* CAROUSEL REFINEMENTS (Global)           */
/* ========================================= */
/* Light mode carousel background */
[data-theme="light"] #homeCarousel .carousel-inner {
    background-color: #ffffff;
}

.carousel-caption {
    bottom: 8% !important;
    padding-bottom: 0 !important;
}

.carousel-caption h1,
.carousel-caption h2 {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

.carousel-caption p {
    font-size: 1rem !important;
    margin-bottom: 0 !important;
}

/* Subtle bottom vignette for text readability */
.carousel-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
    pointer-events: none;
}

/* ========================================= */
/* MOBILE RESPONSIVENESS & MEDIA QUERIES   */
/* ========================================= */

@media (max-width: 576px) {

    /* 1. Typography */
    body {
        font-size: 1rem;
    }

    .display-3 {
        font-size: 2.2rem;
    }

    .display-5 {
        font-size: 1.8rem;
    }

    /* Navbar Title - show title with truncation */
    .navbar-brand-text {
        font-size: 1.1rem;
        font-weight: bold;
        display: inline-block;
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-left: 0.5rem;
    }

    /* 2. Carousel */
    #homeCarousel .carousel-item img {
        height: 50vh !important;
    }

    .carousel-caption {
        bottom: 2% !important;
        display: block !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .carousel-caption h1,
    .carousel-caption h2 {
        font-size: 1.2rem !important;
        /* Shrunk for mobile */
    }

    .carousel-caption p {
        font-size: 0.85rem !important;
    }

    /* 3. L'École Tabs - Horizontal scroll */
    #pills-tab {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: center !important;
        padding-bottom: 5px;
        scrollbar-width: none;
        /* Firefox */
    }

    #pills-tab::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari/Edge */
    }

    .nav-pills .nav-link {
        white-space: nowrap;
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }

    /* 4. Map Height */
    .map-container {
        height: 200px !important;
    }

    .map-info-bar {
        font-size: 0.9rem;
    }

    /* 5. Section Padding */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* 6. Newsletter Modal Keyboard fix */
    #newsletterModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    #newsletterModal .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
}

@media (min-width: 577px) {
    .navbar-brand-text {
        font-size: 1.25rem;
        font-weight: bold;
        margin-left: 0.5rem;
    }

    .map-container {
        height: 280px;
    }
}

/* ========================================= */
/* DARK THEME SUPPORT                      */
/* ========================================= */

[data-theme="dark"] {
    --color-text: #f8fafc;
    --color-bg-dark: #000000;
    --color-bg-card: #282828;
}

/* --- Base --- */
[data-theme="dark"] body {
    background-color: var(--color-bg-dark);
    color: var(--color-text);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .text-royal,
[data-theme="dark"] .text-dark,
[data-theme="dark"] .display-3,
[data-theme="dark"] .display-5 {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .director-card .text-muted,
[data-theme="dark"] .event-card .text-muted {
    color: #94a3b8 !important;
}

/* --- Section backgrounds (full-width = black) --- */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-footer,
[data-theme="dark"] section.bg-light-fun {
    background-color: var(--color-bg-dark) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

[data-theme="dark"] footer.bg-footer {
    border-top: 1px solid #333;
}

/* --- Cards, Panels & Elevated surfaces --- */
[data-theme="dark"] .card,
[data-theme="dark"] .card.border-0,
[data-theme="dark"] .bg-light-fun,
[data-theme="dark"] .director-card,
[data-theme="dark"] .event-card,
[data-theme="dark"] .suivi-card,
[data-theme="dark"] .bg-menu,
[data-theme="dark"] .card.bg-menu,
[data-theme="dark"] .projet-hero {
    background-color: var(--color-bg-card) !important;
    background-image: none !important;
    border: 1px solid #3f3f3f !important;
    color: var(--color-text) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .hover-lift:hover,
[data-theme="dark"] .director-card:hover,
[data-theme="dark"] .event-card:hover,
[data-theme="dark"] .suivi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.6) !important;
    border-color: #575757 !important;
}

[data-theme="dark"] .bg-light-fun {
    border-radius: 1rem !important;
}

/* --- Navbar --- */
[data-theme="dark"] .navbar-custom {
    background-color: #000000;
    border-bottom-color: var(--color-primary);
}

[data-theme="dark"] .navbar-brand-text {
    color: #f8fafc !important;
}

[data-theme="dark"] .navbar-nav .nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .navbar-nav .nav-link.active,
[data-theme="dark"] .navbar-nav .nav-link:hover {
    color: #38bdf8 !important;
}

[data-theme="dark"] .navbar-nav .btn-action {
    background-color: var(--color-accent) !important;
    color: white !important;
    border: none;
}

/* --- Shared invert filter (close buttons, togglers, accordion arrows) --- */
[data-theme="dark"] .navbar-toggler-icon,
[data-theme="dark"] .offcanvas-header .btn-close,
[data-theme="dark"] .modal-header .btn-close,
[data-theme="dark"] .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- Carousel --- */
[data-theme="dark"] #homeCarousel .carousel-inner {
    background-color: var(--color-bg-dark);
}

/* --- Tabs & Pills --- */
[data-theme="dark"] .nav-pills .nav-link:not(.active) {
    color: var(--color-text);
}

[data-theme="dark"] .horaires-tabs.nav-pills .nav-link {
    background-color: var(--color-bg-dark);
    border: 2px solid #3f3f3f;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .horaires-tabs.nav-pills .nav-link.active,
[data-theme="dark"] .horaires-tabs.nav-pills .nav-link:hover {
    background-color: rgba(56, 189, 248, 0.1) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* --- Offcanvas --- */
[data-theme="dark"] .offcanvas {
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

[data-theme="dark"] .offcanvas-header {
    background-color: rgba(30, 30, 30, 0.98) !important;
    border-bottom: 1px solid #333;
}

[data-theme="dark"] .offcanvas-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .offcanvas-body {
    background-color: var(--color-bg-dark);
    color: var(--color-text);
}

/* --- Modals --- */
[data-theme="dark"] .modal-content {
    background-color: var(--color-bg-card);
    color: var(--color-text);
    border-color: #333;
}

[data-theme="dark"] .alert-light {
    background-color: var(--color-bg-card) !important;
    border-color: #333 !important;
    color: var(--color-text) !important;
}

[data-theme="dark"] .newsletter-modal-header {
    background: var(--color-bg-card);
    border-bottom: 1px solid #333;
}

[data-theme="dark"] .newsletter-modal-header h5,
[data-theme="dark"] .newsletter-modal-header p {
    color: #f8fafc;
}

/* --- Forms --- */
[data-theme="dark"] .form-control {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .form-control:focus {
    background-color: #2d3748;
    color: #fff;
}

[data-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* --- Buttons --- */
[data-theme="dark"] .btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 168, 232, 0.3);
}

[data-theme="dark"] .btn-action {
    background-color: var(--color-accent);
    color: #fff !important;
    border-color: var(--color-accent);
}

[data-theme="dark"] .btn-action:hover {
    background-color: #be123c !important;
    border-color: #be123c !important;
}

[data-theme="dark"] .newsletter-strip .btn-light {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
    font-weight: bold;
}

/* --- Horaires blocks --- */
[data-theme="dark"] .horaires-block.blue {
    background: rgba(0, 168, 232, 0.15);
}

[data-theme="dark"] .horaires-block.purple {
    background: rgba(114, 9, 183, 0.15);
}

[data-theme="dark"] .horaires-block.teal {
    background: rgba(13, 148, 136, 0.15);
}

[data-theme="dark"] .horaires-block span {
    color: #e0f2fe !important;
}

[data-theme="dark"] .horaires-block strong {
    color: #ffffff !important;
}

/* --- Accordions --- */
[data-theme="dark"] .accordion-item,
[data-theme="dark"] .edu-accordion .accordion-item {
    background-color: var(--color-bg-card);
    border-color: #333;
}

[data-theme="dark"] .accordion-button,
[data-theme="dark"] .edu-accordion .accordion-button {
    background-color: var(--color-bg-card) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .accordion-button:not(.collapsed),
[data-theme="dark"] .edu-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(0, 168, 232, 0.1) !important;
    color: var(--color-primary) !important;
}

[data-theme="dark"] .accordion-body,
[data-theme="dark"] .edu-accordion .accordion-body {
    background-color: var(--color-bg-card) !important;
    color: var(--color-text) !important;
}

[data-theme="dark"] .accordion-body p,
[data-theme="dark"] .accordion-body strong,
[data-theme="dark"] .accordion-body li,
[data-theme="dark"] .accordion-body h6 {
    color: #f8fafc !important;
}

/* --- Projet Éducatif --- */
[data-theme="dark"] .projet-hero {
    background: var(--color-bg-card);
    border: 1px solid #333;
}

[data-theme="dark"] .projet-hero .citation,
[data-theme="dark"] .edu-accordion .accordion-body .quote {
    color: #94a3b8;
}

/* --- List groups --- */
[data-theme="dark"] .list-group-item {
    background-color: var(--color-bg-card);
    border-color: #3f3f3f;
    color: var(--color-text);
}

/* Fix background on the inner cantine widget to match agenda gray instead of black */
[data-theme="dark"] #cantine-home-widget {
    background-color: var(--color-bg-card) !important;
}

/* --- Read-more fade effects --- */
[data-theme="dark"] .card .read-more-fade {
    background: linear-gradient(to bottom, rgba(40, 40, 40, 0), rgba(40, 40, 40, 1));
}

[data-theme="dark"] .read-more-fade {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
}