/**
 * mozilla.css — correctifs pour Mozilla Firefox (moteur Gecko)
 *
 * Charger après styles.css. @supports (-moz-appearance: none) limite ces règles
 * à Gecko ; Chrome / Safari / Edge ne les appliquent pas.
 */

@supports (-moz-appearance: none) {
    /* Vidéo de fond : calque de composition plus stable */
    .cover-bg-video {
        transform: translateZ(0);
    }

    /* Partenaires : titre en dégradé + filter (isolation peinture) */
    .layout-partenaire .contact-heading {
        color: transparent;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        -webkit-background-clip: text;
        isolation: isolate;
    }

    /* Contact : rendu des champs aligné sur le thème du site */
    .layout-contact .cf-input,
    .layout-contact .cf-textarea {
        appearance: none;
        -moz-appearance: none;
    }

    /* Boutons : évite la bordure interne au focus */
    .layout-contact .cf-submit::-moz-focus-inner,
    .music-toggle::-moz-focus-inner {
        border: 0;
        padding: 0;
    }

    /* ── Sidebar : correctifs Firefox ── */
    
    /* Backdrop : s'assure qu'il couvre tout l'écran */
    .mcm-sidebar__backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 998;
    }

    .mcm-sidebar__backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    /* Header mobile : z-index supérieur */
    .mcm-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(60, 70, 140, 0.12);
    }

    /* Sidebar desktop : s'assure qu'elle reste au-dessus du contenu */
    .mcm-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--mcm-sidebar-w, 16rem);
        background: #000000;
        border-left: 1px solid rgba(60, 70, 140, 0.12);
        z-index: 999;
        display: flex;
        flex-direction: column;
        transition: transform 0.25s ease, width 0.25s ease;
    }

    /* Sidebar mobile : hors écran par défaut */
    @media (max-width: 768px) {
        .mcm-sidebar {
            transform: translateX(100%);
        }

        .mcm-sidebar.is-open {
            transform: translateX(0);
        }

        .mcm-mobile-header {
            display: flex;
        }
    }

    /* Desktop : sidebar toujours visible */
    @media (min-width: 769px) {
        .mcm-mobile-header {
            display: none;
        }
    }

    /* Sidebar réduite : ajuste la largeur */
    body.mcm-sidebar-collapsed .mcm-sidebar {
        width: 4.5rem;
    }

    body.mcm-sidebar-collapsed .mcm-sidebar__brand-text,
    body.mcm-sidebar-collapsed .mcm-sidebar__label,
    body.mcm-sidebar-collapsed .mcm-sidebar__pill {
        display: none;
    }

    /* ── Navbar horizontale (Contact.html) ── */
    body[data-navbar="horizontal"] .mcm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        min-height: 3.5rem;
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 1.5rem;
        background: rgba(15, 10, 26, 0.85);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(129, 140, 248, 0.25);
        border-right: none;
        z-index: 1000;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__head {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding-right: 1.5rem;
        border-right: 1px solid rgba(129, 140, 248, 0.15);
        margin-right: 1rem;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        padding: 0;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__item {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.45rem 0.75rem;
        border-radius: var(--radius-pill);
        text-decoration: none;
        color: rgba(248, 246, 255, 0.78);
        font-size: 0.88rem;
        font-weight: 500;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__item:hover {
        background: rgba(129, 140, 248, 0.15);
        color: rgba(248, 246, 255, 0.96);
    }

    body[data-navbar="horizontal"] .mcm-sidebar__item[aria-current="page"] {
        background: rgba(129, 140, 248, 0.25);
        color: rgba(248, 246, 255, 0.96);
    }

    body[data-navbar="horizontal"] .mcm-sidebar__collapse-btn,
    body[data-navbar="horizontal"] .mcm-sidebar__iconbtn#mcm-drawer-close {
        display: none;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__divider {
        display: none;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__pill {
        margin-left: auto;
        padding: 0.45rem 0.85rem;
        background: linear-gradient(135deg, rgba(129, 140, 248, 0.25) 0%, rgba(86, 96, 208, 0.25) 100%);
        border: 1px solid rgba(129, 140, 248, 0.35);
        border-radius: var(--radius-pill);
        color: rgba(248, 246, 255, 0.96);
        font-size: 0.82rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    body[data-navbar="horizontal"] .mcm-sidebar__pill:hover {
        background: rgba(129, 140, 248, 0.35);
        border-color: rgba(129, 140, 248, 0.55);
    }

    /* Mobile pour navbar horizontale */
    @media (max-width: 768px) {
        body[data-navbar="horizontal"] .mcm-sidebar {
            flex-direction: column;
            padding: 0.75rem 1rem;
        }

        body[data-navbar="horizontal"] .mcm-sidebar__head {
            width: 100%;
            padding-right: 0;
            border-right: none;
            margin-right: 0;
            justify-content: space-between;
        }

        body[data-navbar="horizontal"] .mcm-sidebar__nav {
            display: none;
        }

        body[data-navbar="horizontal"] .mcm-sidebar.is-open .mcm-sidebar__nav {
            display: flex;
            flex-direction: column;
            width: 100%;
            margin-top: 0.75rem;
            gap: 0.25rem;
        }

        body[data-navbar="horizontal"] .mcm-sidebar__item {
            width: 100%;
            justify-content: flex-start;
        }

        body[data-navbar="horizontal"] .mcm-sidebar__pill {
            margin-left: 0;
            margin-top: 0.5rem;
            width: 100%;
            text-align: center;
        }
    }

    /* Grille contact : évite les problèmes de rendu grid */
    .layout-contact .contact-grid {
        display: -moz-grid;
    }

    /* Carte formulaire : rendu des ombres et bordures */
    .layout-contact .cf-card {
        border: 1px solid rgba(60, 70, 140, 0.11);
        box-shadow: 0 8px 32px rgba(30, 40, 100, 0.08);
    }

    /* Inputs : focus ring visible */
    .layout-contact .cf-input:focus,
    .layout-contact .cf-textarea:focus {
        outline: 2px solid rgba(90, 75, 180, 0.52);
        outline-offset: -1px;
    }

    /* Bouton envoyer : gradient préservé */
    .layout-contact .cf-submit {
        background: linear-gradient(135deg, var(--color-accent) 0%, #5660d0 100%);
        -moz-force-broken-image-icon: 0;
    }
}
