/*
 * CodeBhavya Placement sidebar/footer fix
 * Load after placement.css.
 * Desktop: the sidebar is sticky inside the Placement layout, so it stops
 * naturally when the layout ends and never covers the global footer.
 * Mobile: the existing fixed slide-out drawer remains unchanged.
 */

@media (min-width: 921px) {
    .placement-page .placement-layout {
        display: grid !important;
        grid-template-columns: 278px minmax(0, 1fr) !important;
        align-items: start !important;
        min-height: calc(100vh - 72px) !important;
        padding-left: 0 !important;
    }

    .placement-page .placement-sidebar {
        position: sticky !important;
        top: 72px !important;
        bottom: auto !important;
        left: auto !important;
        align-self: start !important;
        width: 278px !important;
        height: calc(100vh - 72px) !important;
        max-height: calc(100vh - 72px) !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
        overflow-y: auto !important;
    }

    .placement-page .placement-main {
        min-width: 0 !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    /* The footer is full-width and begins only after the grid has ended. */
    .placement-page .footer,
    .placement-page .cb-global-footer {
        padding-left: clamp(1.2rem, 4vw, 4rem) !important;
    }
}

@media (min-width: 921px) and (max-width: 1180px) {
    .placement-page .placement-layout {
        grid-template-columns: 250px minmax(0, 1fr) !important;
    }

    .placement-page .placement-sidebar {
        width: 250px !important;
    }
}

/* Placement compact desktop alignment */
@media (min-width: 921px) {
    /* Prevent duplicated header spacing on Placement pages */
    body.placement-page.cb-global-shell {
        padding-top: 0 !important;
    }

    .placement-page .top-header.cb-nav-ready {
        position: sticky !important;
        top: 0 !important;
    }

    .placement-page .placement-layout {
        padding-top: 16px !important;
        column-gap: 0 !important;
    }

    .placement-page .placement-sidebar {
        top: 88px !important; /* 72px header + 16px spacing */
        height: calc(100vh - 88px) !important;
        max-height: calc(100vh - 88px) !important;
        margin: 0 !important;
    }

    .placement-page .placement-main {
        padding: 0 18px 20px !important;
    }

    .placement-page .placement-main > section {
        width: 100% !important;
        max-width: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

