/* ==========================================================================
   ARES-OS — Patch anti-overflow / anti-scrollbar
   À charger EN DERNIER dans le <head> :
   <link rel="stylesheet" href="no-overflow.css">
   ========================================================================== */

/* 1 - Empêcher tout débordement horizontal global
      (w-screen = 100vw inclut la largeur de la scrollbar, d'où un
      décalage de quelques pixels et une scrollbar fantôme horizontale) */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    scrollbar-gutter: stable;
}

/* 2 - Masquer TOUTES les barres de défilement tout en gardant
      la possibilité de scroller (molette / tactile) */

/* Firefox */
* {
    scrollbar-width: none;
}

/* Internet Explorer / ancien Edge */
* {
    -ms-overflow-style: none;
}

/* Chrome, Safari, Edge (Blink/Opera) */
*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner {
    background: transparent;
    display: none;
}

/* 3 - Sécurité sur les conteneurs scrollables de tes modules :
      ils continuent de scroller, mais n'affichent jamais de scrollbar */
.overflow-y-auto,
.custom-scrollbar {
    overflow-y: auto;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE */
}

.overflow-y-auto::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
    display: none;                   /* Chrome / Edge / Safari */
}

/* 4 - Éviter qu'un contenu trop grand ne pousse la page :
      chaque module reste confiné dans la zone disponible */
html, body, main, section {
    max-height: 100vh;
}

[id$="-module"] {
    min-height: 0;   /* permet aux enfants flex de rétrécir correctement */
    min-width: 0;
}

/* 5 - Empêcher les éléments trop larges (images, canvas, SVG) de
      générer un overflow horizontal dans les panneaux */
img, svg, canvas, video, table {
    max-width: 100%;
    box-sizing: border-box;
}
