
/* ==========================================================
   V27 — SCROLL + BACKGROUND RECOVERY
   ========================================================== */


/* ----------------------------------------------------------
   1. DOCUMENT MUST ALWAYS BE SCROLLABLE
   ---------------------------------------------------------- */

html{
    width:100% !important;

    height:auto !important;
    min-height:100% !important;
    max-height:none !important;

    overflow-x:hidden !important;
    overflow-y:auto !important;

    scroll-behavior:smooth !important;

    overscroll-behavior-y:auto !important;

    touch-action:
        pan-y pinch-zoom !important;
}


body{
    width:100% !important;

    height:auto !important;
    min-height:100vh !important;
    max-height:none !important;

    overflow-x:hidden !important;
    overflow-y:auto !important;

    position:relative !important;

    top:auto !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;

    overscroll-behavior-y:auto !important;

    touch-action:
        pan-y pinch-zoom !important;
}


/* Safari / Chrome mobile */

body.v26-home,
body.v26-detail{
    height:auto !important;

    min-height:100vh !important;

    max-height:none !important;

    overflow-y:auto !important;

    touch-action:
        pan-y pinch-zoom !important;
}


/* ----------------------------------------------------------
   2. REMOVE V26 NEGATIVE BACKGROUND PSEUDO LAYERS
   THEY WERE GOING BEHIND THE BODY
   ---------------------------------------------------------- */

body.v26-home::before,
body.v26-detail::before{
    display:none !important;

    content:none !important;
}


/* ----------------------------------------------------------
   3. HOME REAL MINECRAFT BACKGROUND
   ---------------------------------------------------------- */

body.v26-home{
    background-color:
        #05080d !important;

    background-image:
        linear-gradient(
            180deg,
            rgba(4,8,13,.30) 0%,
            rgba(4,8,13,.52) 42%,
            rgba(4,8,13,.82) 100%
        ),
        url('/assets/backgrounds/minecraft-world-home.webp') !important;

    background-position:
        center top !important;

    background-size:
        cover !important;

    background-repeat:
        no-repeat !important;

    background-attachment:
        fixed !important;
}


/* ----------------------------------------------------------
   4. DETAIL PAGE BACKGROUND
   JS SETS --v27-page-bg
   ---------------------------------------------------------- */

body.v26-detail{
    background-color:
        #05080d !important;

    background-image:
        linear-gradient(
            180deg,
            rgba(3,8,12,.34) 0%,
            rgba(3,8,12,.56) 46%,
            rgba(3,8,12,.82) 100%
        ),
        var(
            --v27-page-bg,
            url('/assets/backgrounds/minecraft-world.webp')
        ) !important;

    background-position:
        center top !important;

    background-size:
        cover !important;

    background-repeat:
        no-repeat !important;

    background-attachment:
        fixed !important;
}


/* ----------------------------------------------------------
   5. CONTENT WRAPPERS MUST EXPAND NATURALLY
   ---------------------------------------------------------- */

main,
.homePage,
.detailPage,
.siteMain,
.mainContent,
.pageShell{
    height:auto !important;

    min-height:0 !important;

    max-height:none !important;

    overflow-x:visible !important;

    overflow-y:visible !important;

    position:relative !important;
}


/* Important:
   do NOT apply visible overflow to horizontal sliders */

.fp-related-grid,
.categoryTabs,
.filterTabs,
.filters{
    max-height:none !important;
}


/* ----------------------------------------------------------
   6. HOME PAGE
   ---------------------------------------------------------- */

body.v26-home .hero{
    height:auto !important;

    min-height:0 !important;

    max-height:none !important;

    overflow:hidden !important;
}


body.v26-home .v26-hero-content{
    height:auto !important;

    max-height:none !important;
}


/* ----------------------------------------------------------
   7. OLD FAKE WORLD LAYERS
   MUST NOT CONTROL DOCUMENT HEIGHT
   ---------------------------------------------------------- */

body.v26-detail .v10-world,
body.v26-detail .v11-world,
body.v26-detail .v12-world,
body.v26-detail .v13-world,
body.v26-detail .v14-world,
body.v26-detail .mc-detail-world{
    position:fixed !important;

    inset:0 !important;

    width:100vw !important;
    height:100vh !important;

    min-height:0 !important;
    max-height:100vh !important;

    margin:0 !important;
    padding:0 !important;

    overflow:hidden !important;

    pointer-events:none !important;

    z-index:-1 !important;
}


.v10-world-block,
.v11-world-block,
.v12-world-block,
.v13-world-block,
.mc-detail-block{
    position:absolute !important;

    float:none !important;

    margin:0 !important;
}


/* ----------------------------------------------------------
   8. DETAIL PAGE RELATED SECTION
   ---------------------------------------------------------- */

body.v26-detail .fp-related{
    height:auto !important;

    min-height:0 !important;

    max-height:none !important;

    overflow:visible !important;

    margin-bottom:
        18px !important;

    padding-bottom:
        8px !important;
}


body.v26-detail .fp-related-grid{
    display:flex !important;

    flex-wrap:nowrap !important;

    gap:14px !important;

    overflow-x:auto !important;
    overflow-y:hidden !important;

    -webkit-overflow-scrolling:
        touch !important;

    overscroll-behavior-x:
        contain !important;

    scroll-snap-type:
        x proximity !important;

    touch-action:
        pan-x pan-y !important;
}


body.v26-detail
.fp-related-grid > *{
    flex:
        0 0 315px !important;

    min-width:
        315px !important;

    scroll-snap-align:
        start !important;
}


/* ----------------------------------------------------------
   9. OLD END-OF-PAGE JUNK
   HIDE WITHOUT LOCKING PAGE SCROLL
   ---------------------------------------------------------- */

body.v26-detail .detailFooter,
body.v26-detail .resourceFooter,
body.v26-detail .pageEnd,
body.v26-detail .page-end,
body.v26-detail .bottomScene,
body.v26-detail .bottom-scene,
body.v26-detail .worldSpacer,
body.v26-detail .world-spacer,
body.v26-detail .detailSpacer,
body.v26-detail .detail-spacer{
    display:none !important;

    height:0 !important;

    min-height:0 !important;

    margin:0 !important;

    padding:0 !important;
}


/* ----------------------------------------------------------
   10. DRAWER
   DOCUMENT SCROLL MUST NOT BE DESTROYED BY DRAWER
   ---------------------------------------------------------- */

#v26Drawer{
    overflow-x:hidden !important;

    overflow-y:auto !important;

    height:100dvh !important;

    max-height:100dvh !important;

    touch-action:
        pan-y !important;

    -webkit-overflow-scrolling:
        touch !important;

    overscroll-behavior:
        contain !important;
}


#v26DrawerBackdrop{
    touch-action:
        manipulation !important;
}


/* ----------------------------------------------------------
   11. DOWNLOAD POPUP ONLY ITSELF IS FIXED
   ---------------------------------------------------------- */

.v26-download{
    position:fixed !important;

    inset:0 !important;

    overflow:hidden !important;

    touch-action:none !important;
}


/* ----------------------------------------------------------
   12. MOBILE
   fixed backgrounds can lag on Android, use scroll attachment
   ---------------------------------------------------------- */

@media(max-width:700px){

    body.v26-home,
    body.v26-detail{
        background-attachment:
            scroll !important;

        background-size:
            auto 100vh !important;

        background-position:
            center top !important;
    }


    body.v26-detail
    .fp-related-grid > *{
        flex-basis:
            270px !important;

        width:
            270px !important;

        min-width:
            270px !important;
    }


    main,
    .homePage,
    .detailPage,
    .siteMain,
    .mainContent,
    .pageShell{
        overflow-y:
            visible !important;

        height:
            auto !important;
    }

}

