/**
 * DJC Shell Contract
 * Hard layout guardrails: topbar + left sidebar + right sidebar are FIXED.
 * Only .djc-hub-layout (center content) scrolls/refreshes.
 */

/* ============================================
   HIDE THEME HEADER ON DJC PAGES
   Keep selectors SURGICAL - only hide header,
   never page content containers.
   ============================================ */

/* Generic */
body.djc-hub-page .site-header,
body.djc-hub-page header.site-header,
body.djc-hub-page .header-global,
body.djc-hub-page #masthead,
body.djc-hub-page #site-header,
body.djc-hub-page .header-area,
body.djc-profile-page .site-header,
body.djc-profile-page #masthead,
body.djc-profile-page .header-global,
body.djc-profile-page #site-header {
    display: none !important;
}

/* Astra theme header bars only */
body.djc-hub-page #ast-fixed-header,
body.djc-hub-page .ast-hfb-header,
body.djc-hub-page .main-header-bar,
body.djc-hub-page .ast-above-header-bar,
body.djc-hub-page .ast-below-header-bar,
body.djc-hub-page .astra-nav-wrap,
body.djc-profile-page #ast-fixed-header,
body.djc-profile-page .ast-hfb-header,
body.djc-profile-page .main-header-bar,
body.djc-profile-page .ast-above-header-bar,
body.djc-profile-page .ast-below-header-bar,
body.djc-profile-page .astra-nav-wrap {
    display: none !important;
}

/* Elementor header location only (NOT .e-con.e-parent which hides page content) */
body.djc-hub-page .elementor-location-header,
body.djc-profile-page .elementor-location-header {
    display: none !important;
}

/* Neutralise body top padding that themes inject */
body.djc-hub-page,
body.djc-profile-page {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ============================================
   SHELL ROOT
   ============================================ */

.djc-hub-shell {
    isolation: isolate;
    overflow-x: clip;
    background: var(--djc-bg-base, #0b0f1a);
}

/* Center content area */
.djc-hub-layout {
    position: relative;
    min-width: 0;
    overflow-x: clip;
}

/* Profile content wrappers */
.djc-profile-wrapper {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.djc-profile-main {
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

/* Z-index contract */
.djc-hub-topbar        { z-index: 1000; }
.djc-hub-sidebar       { z-index: 975; }
.djc-hub-right-sidebar { z-index: 960; }

/* ============================================
   RIGHT SIDEBAR - FIXED ON DESKTOP
   ============================================ */

@media (min-width: 1200px) {
    .djc-hub-right-sidebar {
        display: block !important;
        position: fixed;
        top: calc(var(--djc-topbar-height, 60px) + var(--djc-admin-bar-offset, 0px));
        right: 0;
        width: var(--djc-right-sidebar-width, 320px) !important;
        height: calc(100dvh - var(--djc-topbar-height, 60px) - var(--djc-admin-bar-offset, 0px));
        overflow-y: auto;
        overflow-x: hidden;
        background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
        border-left: 1px solid rgba(124, 92, 255, 0.18);
        padding: 0;
        scrollbar-width: thin;
        scrollbar-color: rgba(124, 92, 255, 0.25) transparent;
    }

    .djc-hub-right-sidebar::-webkit-scrollbar       { width: 3px; }
    .djc-hub-right-sidebar::-webkit-scrollbar-track  { background: transparent; }
    .djc-hub-right-sidebar::-webkit-scrollbar-thumb  { background: rgba(124, 92, 255, 0.3); border-radius: 2px; }
}

/* ============================================
   MOBILE / TABLET
   ============================================ */

@media (max-width: 1023px) {
    .djc-hub-layout {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
}

@media (min-width: 1024px) {
    .djc-hub-layout {
        min-height: calc(100vh - var(--djc-topbar-height) - var(--djc-admin-bar-offset, 0px));
    }
}
