/* ==========================================================================
   1. TRANSPARENCE ET IMAGE DE FOND (CONSERVÉ)
   ========================================================================== */

html, body, .site-container, .header, header, .container-nav, main, .main-content, #content, .body {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.header .card, .container-header .card, .card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

body {
    background-image: url("/images/Moderne-Photo/Image-de-fond/BackSireneCasse-001.jpg") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-color: #1a385c !important;
}

/* ==========================================================================
   2. TYPOGRAPHIE GLOBALE ET SUPPRESSION RADICALE DU TRAIT BLANC (LIGNES)
   ========================================================================== */

body, .navbar-brand, .brand, .brand-title, .header-navigation, .nav-link, .dropdown-item, .com-content {
    font-family: "Helvetica", "Arial", sans-serif !important;
}

/* Neutralise toutes les lignes séparatrices horizontales de Cassiopeia sous le logo/menu */
.header, header, .container-header, .navbar-brand, .brand, .container-nav, .navbar, hr {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   3. MISE EN PAGE DU SITE PUBLIC : LOGO, MENU À GAUCHE & LE CONTENU À DROITE
   ========================================================================== */

@media (min-width: 992px) {

    /* ---- REPOSITIONNEMENT ET ÉLARGISSEMENT DE LA PAGE DE CONTENU ---- */
    /* Modifie la structure de Cassiopeia pour pousser le bloc principal à droite */
    .site-container, .site-grid, main, .main-content, .grid-child {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important; /* Aligne tout le bloc de lecture sur le côté droit */
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Crée l'écart de 50px demandé sur le bord droit de l'écran */
    .site-container {
        padding-right: 50px !important;
    }

    /* Élargit votre bloc d'article (passé de 500px à 750px pour plus de confort visuel) */
    .site-container > *, main > *, .com-content, .item-page, .view-category {
        width: 100% !important;
        max-width: 750px !important; /* Augmentez ou réduisez cette valeur selon votre goût */
    }

    /* ---- LOGO EN HAUT À GAUCHE (FIXE - 5PX) ---- */
    .navbar-brand, .brand {
        position: fixed !important;
        top: 5px !important;          
        left: 5px !important;         
        z-index: 1050 !important;
        padding: 15px 25px !important;
        border-radius: 8px !important;
        transition: background-color 0.3s ease !important;
        background-color: rgba(128, 128, 128, 0.6) !important; 
        width: max-content !important;
    }
    .navbar-brand *, .brand * {
        color: #ffffff !important;   
    }
    .navbar-brand:hover, .brand:hover {
        background-color: rgba(0, 0, 0, 0.9) !important; 
    }

    /* ---- MENU PRINCIPAL VERTICAL À GAUCHE (FIXE - 5PX) ---- */
    /* Force le conteneur du menu à se fixer à gauche sans déborder */
    .header-navigation, .container-nav, .mod-menu, .navbar-collapse {
        position: fixed !important;
        top: 150px !important;        
        left: 5px !important;         
        right: auto !important; 
        z-index: 1040 !important;
        width: max-content !important; 
    }

    /* Force la liste des liens à s'aligner en colonne verticale propre */
    .header-navigation .navbar-nav, .mod-menu, .nav, .metismenu {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important; /* Écart vertical de 10px entre les boutons */
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .header-navigation .nav-item, .nav-item, .metismenu li {
        position: relative !important;
        width: 100% !important;
    }

    /* RECTANGLE GRIS TRANSPARENT AUTOUR DE CHAQUE LIEN DE MENU */
    .header-navigation .nav-link, .nav-link, .metismenu a {
        color: #ffffff !important; /* Lettres blanches */
        background-color: rgba(128, 128, 128, 0.6) !important; /* Même fond transparent gris que le logo */
        padding: 12px 20px !important;
        border-radius: 6px !important;
        transition: all 0.3s ease !important;
        display: block !important;
        width: 100% !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        border: none !important; /* Élimine les bordures individuelles sous les liens */
    }

    /* Effet au survol : passe au noir */
    .header-navigation .nav-link:hover, 
    .header-navigation .nav-item:hover > .nav-link,
    .nav-link:hover, .metismenu a:hover {
        background-color: rgba(0, 0, 0, 0.9) !important;
        color: #ffffff !important;
    }

    /* ---- SOUS-MENUS COLLÉS À DROITE ---- */
    .header-navigation .dropdown-menu, .dropdown-menu {
        position: absolute !important;
        top: 0 !important;
        left: 100% !important;          
        margin-left: 0 !important;      
        display: none !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        width: max-content !important; 
        flex-direction: column !important;
        gap: 10px !important;           
    }

    /* Liens du sous-menu */
    .header-navigation .dropdown-item, .dropdown-item {
        color: #ffffff !important;
        background-color: rgba(128, 128, 128, 0.6) !important;
        padding: 12px 20px !important;
        border-radius: 6px !important;
        transition: all 0.3s ease !important;
        display: block !important;
        width: 100% !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        border: none !important;
    }

    .header-navigation .dropdown-item:hover, .dropdown-item:hover {
        background-color: rgba(0, 0, 0, 0.9) !important;
        color: #ffffff !important;
    }

    .header-navigation .nav-item:hover > .dropdown-menu,
    .nav-item:hover > .dropdown-menu {
        display: flex !important;
    }
}

/* ---- 4. SÉCURISATION DES PAGES TRANSPARENTES ET DES IMAGES INTERNES ---- */
.com-content, .item-page, .view-category {
    background-color: rgba(255, 255, 255, 0.85) !important; /* Voile blanc */
    color: #000000 !important; /* Lettres noires */
    padding: 30px !important;
    border-radius: 16px !important;
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.1) !important;
    box-sizing: border-box !important;
}

.com-content h1, .com-content h2, .com-content h3, .com-content p, .com-content a {
    color: #000000 !important;
}

/* SÉCURITÉ IMAGES : Bloque la photo pour qu'elle reste dans le cadre blanc */
.com-content img, .item-page img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   5. PAGE MAINTENANCE / OFFLINE (CONSERVÉ)
   ========================================================================== */

div.outer {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

div.offline-card {
    position: absolute !important;
    top: 50px !important;        
    right: 50px !important;      
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 440px !important; 
    background-color: rgba(255, 255, 255, 0.85) !important; 
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.15) !important;
    padding: 35px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    z-index: 999 !important;
}

div.offline-card p, 
div.offline-card h1, 
div.offline-card h2, 
div.offline-card .message,
div.offline-card span {
    text-align: center !important;  
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 !important;
    padding: 0 !important;
    color: #212529 !important;      
    float: none !important;
    clear: both !important;
}

div.offline-card img {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    margin: 0 auto 20px auto !important; 
    max-width: 100% !important;
    height: auto !important;
}

div.offline-card #form-login, 
div.offline-card .card, 
div.offline-card .card-body, 
div.offline-card fieldset {
    background-color: #1a385c !important; 
    border: none !important;
    padding: 25px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    margin-top: 15px !important;
}

@media (max-width: 768px) {
    div.offline-card {
        position: relative !important;
        top: 30px !important;
        right: auto !important;
        margin: 0 auto !important; 
        width: 92% !important;
    }
}