/* =========================================================
   scroll-fix.css  –  IFSAM  – Fix definitivo scroll pagina
   Caricato DOPO tutti gli altri CSS, priorità massima.
   ========================================================= */

/*
   FORZA SCROLL su html e body.
   Tutti i CSS CDN remoti applicano overflow:hidden sul body.
   Qui li sovrascriviamo con specificità ": root" + !important.
*/

:root,
html,
html body,
html body.it,
html.it,
html[lang="it"] {
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    position: static !important;
}

body,
body.it {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    position: relative !important;
}

/* Rimuovi position:fixed che blocca lo scroll */
body[style*="overflow"],
html[style*="overflow"] {
    overflow-y: scroll !important;
    overflow-x: hidden !important;
}

/* Contesto main: mai overflow:hidden */
main,
main > *,
#root,
#app,
.app-container,
.page-wrapper {
    overflow: visible !important;
    overflow-x: clip !important;
    height: auto !important;
    max-height: none !important;
}

/* Sezioni principali: mai fixed, mai height:100% rigido */
section,
.foundations-module,
.header-standard-module {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Annulla margin-bottom:120px CDN sulla hero → il gap è gestito dal padding-top della sezione successiva */
.header-standard-module {
    margin-bottom: 0 !important;
}

/* L'header sticky deve stare fermo ma NON bloccare il body */
.sticky-header,
.absolute-header,
.header-wrapper,
.js-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Hero section: altezza controllata – 750px */
.header-standard-module-wrapper {
    height: 750px !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Il contenuto della hero è visibile */
.header-standard-module-container {
    overflow: visible !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Previene il blocco del menu mobile che talvolta fissa il body */
body.js-menu-open,
body.menu-open,
body[class*="menu-open"],
body[class*="mobile-open"] {
    overflow-y: scroll !important;
    position: static !important;
}

/* Assicura che scrollbar sia sempre visibile (evita layout shift) */
html {
    scrollbar-gutter: stable !important;
}

/* Fix per eventuali sezioni con position:fixed che catturano eventi touch */
.sticky-header + * {
    margin-top: 0 !important;
}

/* ─── Hero Fondi Privati: DEVE clippare il globo ─── */
.pf-private-hero {
    overflow: hidden !important;
}
