/* ============================================================
   SDEP – Layout responsive (remplace l'architecture frameset)
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #000;
    color: #fff;
}

/* Wrapper vertical pleine hauteur */
#sdep-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #000;
}

/* ---- Burger button (caché en desktop) ---- */
#sdep-burger {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1100;
    background: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
}
#sdep-burger:hover { background: #444; }

/* Bouton fermer dans l'aside (caché en desktop) */
#sdep-menu-close {
    display: none;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    float: right;
    padding: 6px 10px;
}

/* Select mobile (caché en desktop) */
#sdep-mobile-select {
    display: none;
}

/* Overlay (caché par défaut) */
#sdep-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 1050;
}
#sdep-overlay.is-open { display: block; }

/* ---- Barre top (ancien frame haut, 55 px) ---- */
#sdep-top {
    position: sticky;
    top: 0;
    z-index: 500;
    background-color: #000;
    flex-shrink: 0;
    overflow: visible;
    /* Contient le tableau haut.php */
}

#sdep-top table {
    margin: 0;
}

/* ---- Zone body : menu latéral + contenu ---- */
#sdep-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---- Menu latéral (ancien frame menu, 155 px) ---- */
#sdep-menu {
    width: 155px;
    min-width: 155px;
    background-color: #000;
    color: #eee;
    overflow-y: auto;
    flex-shrink: 0;
}

#sdep-menu a {
    color: #ccc;
}

#sdep-menu a:hover {
    color: #fff;
}

/* Containers blancs : rétablir le texte noir */
[bgcolor="#FFFFFF"], [bgcolor="#ffffff"],
[bgcolor="#CCCCCC"], [bgcolor="#cccccc"] {
    color: #000;
}

/* ---- Contenu principal (ancien frame principal) ---- */
#sdep-content {
    flex: 1;
    overflow: auto;
    /* Le fond et la couleur de texte sont définis par chaque page incluse */
}

#sdep-content article {
    min-height: 100%;
}

/* ============================================================
   Responsive – mobile / tablette
   ============================================================ */

@media (max-width: 768px) {
    /* ---- Burger visible, aside off-canvas ---- */
    #sdep-burger      { display: block; }
    #sdep-menu-close  { display: block; }
    #sdep-mobile-select {
        display: block;
        padding: 4px 8px 4px 44px; /* laisser place au burger */
    }
    #sdep-mobile-select select {
        width: 100%;
        max-width: 280px;
        font-size: 14px;
    }

    /* L'aside sort du flux et glisse depuis la gauche */
    #sdep-body {
        flex-direction: column;
    }

    aside#sdep-menu {
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        height: 100vh;
        z-index: 1100;
        overflow-y: auto;
        transition: left .25s ease;
        box-shadow: 3px 0 10px rgba(0, 0, 0, .6);
        white-space: normal;
        padding-top: 8px;
    }

    aside#sdep-menu.is-open { left: 0; }

    /* Tables layout héritées */
    #sdep-content table {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* Images trop larges */
    #sdep-content img {
        max-width: 100%;
        height: auto;
    }

    /* Header top : compacter sur petit écran */
    #sdep-top {
        min-height: 48px;
    }

    #sdep-top table {
        width: 100% !important;
    }

    /* Blocs à largeur fixe hérités */
    #sdep-content .content,
    #sdep-content .main,
    #sdep-content .blocDivBlanc,
    #sdep-content .blocDivBlancLarge {
        width: 100% !important;
        left: auto !important;
        margin-left: 0 !important;
        position: static !important;
        float: none !important;
    }
}

@media (max-width: 480px) {
    #sdep-top {
        font-size: 11px;
    }

    #sdep-content {
        font-size: 13px;
    }
}
