/* BREAKPOINT TABLETTE (max 992px) */
@media (max-width: 992px) {
    .container {
        max-width: 95% !important; /* Réduit les marges sur les côtés */
        padding-left: 1em !important;
        padding-right: 1em !important;
    }
    
    .glass-panel {
        padding: 1.5em !important; /* Un peu moins de padding interne */
    }
}

/* BREAKPOINT MOBILE (max 768px) */
@media (max-width: 768px) {
    /* 1. Bouton de langue plus gros */
    .text-end .btn-sm {
        padding: 0.8em 1.2em !important;
        font-size: 1.1em !important;
        min-width: 3.5em;
    }

    /* 2. Empilement des zones (1 seule colonne) */
    .row > div {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Ajustement des badges de fonction pour mobile */
    .col-md-6.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left;
        margin-bottom: 2em;
    }
    
    .btn-ui {
        margin-right: 0 !important;
        margin-bottom: 0.8em !important;
        width: 100% !important; /* Le badge prend toute la largeur sur mobile */
    }

    /* 3. Réduction drastique des marges générales */
    .container {
        padding-top: 1em !important;
        padding-bottom: 1em !important;
    }

/* On réduit la marge du conteneur principal tout en haut */
    .container.py-5 {
        padding-top: 0.5em !important; 
    }

    /* On réduit l'espace au-dessus des boutons de langue */
    .text-end.mb-2 {
        margin-top: -0.5em !important; /* Remonte légèrement la zone */
        margin-bottom: 0.5em !important;
    }

    /* Optionnel : Si tu veux que le logo remonte aussi */
    header.text-center.mb-5 {
        margin-bottom: 2em !important;
    }

    .mt-5, .py-5 {
        margin-top: 2em !important;
        padding-top: 1em !important;
        padding-bottom: 1em !important;
    }

    header h1 {
        font-size: 2.5em !important; /* Titre un peu plus petit pour mobile */
    }

    header img {
        max-width: 80% !important;
    }

    /* Visionneuse : on laisse l'image prendre plus de place sur petit écran */
    #viewer-content {
        max-width: 95%;
        max-height: 95%;
    }
}