/* Homepage-only banner and grid refinements. */
body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 {
    box-sizing: border-box !important;
    width: min(94vw, 1360px) !important;
    max-width: 1360px !important;
    margin: 28px auto 32px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}

body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 > .big-slider,
body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 .mainslider,
body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 .swiper-container.big-slider {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}

/* Popular Today spans the top row; Latest Update and the ranking stay side by side. */
body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) {
    display: grid !important;
    grid-template-columns: minmax(0, 3.15fr) minmax(280px, 1fr) !important;
    grid-template-areas: "main sidebar" !important;
    column-gap: clamp(20px, 2vw, 32px) !important;
    row-gap: 24px !important;
    align-items: start !important;
}

body.darkmode.home #content > .wrapper:has(> .hotslid):has(> .postbody:not(.full)):has(> #sidebar) {
    grid-template-areas: "hot hot" "main sidebar" !important;
}

body.darkmode.home #content > .wrapper:has(> .hotslid):has(> .postbody:not(.full)):has(> #sidebar) > .hotslid {
    grid-area: hot !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}

body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) > .postbody {
    grid-area: main !important;
}

body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) > #sidebar {
    grid-area: sidebar !important;
}

body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) > .postbody,
body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) > #sidebar {
    float: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* Restore the spacious three-card Latest Update look from the live homepage. */
body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    align-items: start !important;
    gap: clamp(16px, 1.8vw, 28px) !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd > .bs {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd > .bs .bsx,
body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd > .bs .limit {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Keep Popular Today compact and horizontal. */
body.darkmode.home .hothome .listupd .bs {
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    margin: 0 18px 0 0 !important;
}

@media (max-width: 1000px) and (min-width: 769px) {
    body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) {
        grid-template-columns: minmax(0, 2.2fr) minmax(250px, 1fr) !important;
    }

    body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd {
        gap: 16px !important;
    }
}

@media (max-width: 768px) {
    body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        margin: 16px auto 24px !important;
        border-radius: 16px !important;
    }

    body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 > .big-slider,
    body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 .mainslider,
    body.darkmode.home .mainholder > .slider-wrapper.wrapernum1 .swiper-container.big-slider {
        border-radius: 16px !important;
    }

    body.darkmode.home #content > .wrapper:has(> .postbody:not(.full)):has(> #sidebar) {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: "main" "sidebar" !important;
        row-gap: 24px !important;
    }

    body.darkmode.home #content > .wrapper:has(> .hotslid):has(> .postbody:not(.full)):has(> #sidebar) {
        grid-template-areas: "hot" "main" "sidebar" !important;
    }

    body.darkmode.home #content > .wrapper .postbody > .bixbox:not(.hothome) > .listupd {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    body.darkmode.home .hothome .listupd .bs {
        flex-basis: 150px !important;
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        margin-right: 12px !important;
    }
}
