/**
 * SphereNexus Editorial Pro v2.4.4
 * True independent sticky sidebars for single posts and category archives.
 */

:root {
    --sn-v244-sticky-top: 110px;
    --sn-v244-sticky-gap: 18px;
    --sn-v244-scrollbar: #b8cfce;
    --sn-v244-scrollbar-track: transparent;
}

.admin-bar {
    --sn-v244-sticky-top: 142px;
}

@media (min-width: 981px) {
    /* Sticky requires every layout ancestor to allow visible overflow. */
    .single-main--v23,
    .single-article--v23,
    .sn-single-v23-shell,
    .sn-single-v23-main,
    .category-main,
    .category-main .category-layout,
    .category-main .content-column {
        overflow: visible !important;
    }

    .sn-single-v23-shell,
    .category-main .category-layout {
        align-items: start !important;
    }

    /* Single post: left article scrolls with the page, right sidebar stays visible. */
    .sn-single-v23-sidebar {
        position: sticky !important;
        top: var(--sn-v244-sticky-top) !important;
        align-self: start !important;
        max-height: calc(100vh - var(--sn-v244-sticky-top) - var(--sn-v244-sticky-gap)) !important;
        max-height: calc(100dvh - var(--sn-v244-sticky-top) - var(--sn-v244-sticky-gap)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: var(--sn-v244-scrollbar) var(--sn-v244-scrollbar-track);
        padding-right: 5px;
    }

    .sn-single-v23-sidebar > .site-sidebar,
    .sn-single-v23-sidebar > .site-sidebar--professional,
    .sn-single-v23-sidebar .site-sidebar,
    .sn-single-v23-sidebar .site-sidebar--professional {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
    }

    /* Category archive: left post stream scrolls, right sidebar stays visible. */
    .category-sticky-column {
        position: sticky !important;
        top: var(--sn-v244-sticky-top) !important;
        align-self: start !important;
        max-height: calc(100vh - var(--sn-v244-sticky-top) - var(--sn-v244-sticky-gap)) !important;
        max-height: calc(100dvh - var(--sn-v244-sticky-top) - var(--sn-v244-sticky-gap)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: var(--sn-v244-scrollbar) var(--sn-v244-scrollbar-track);
        padding-right: 5px;
    }

    .category-sticky-column > .site-sidebar,
    .category-sticky-column > .site-sidebar--professional,
    .category-sticky-column .site-sidebar,
    .category-sticky-column .site-sidebar--professional {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
    }

    .sn-single-v23-sidebar::-webkit-scrollbar,
    .category-sticky-column::-webkit-scrollbar {
        width: 5px;
    }

    .sn-single-v23-sidebar::-webkit-scrollbar-track,
    .category-sticky-column::-webkit-scrollbar-track {
        background: transparent;
    }

    .sn-single-v23-sidebar::-webkit-scrollbar-thumb,
    .category-sticky-column::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: var(--sn-v244-scrollbar);
    }

    .sn-single-v23-sidebar::-webkit-scrollbar-thumb:hover,
    .category-sticky-column::-webkit-scrollbar-thumb:hover {
        background: #8fb5b3;
    }
}

/* Tablet/mobile: normal document flow is more usable and fully responsive. */
@media (max-width: 980px) {
    .sn-single-v23-sidebar,
    .category-sticky-column {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0 !important;
        scrollbar-gutter: auto;
    }
}
