/**
 * Forum Override Styles
 * 
 * These styles fix conflicts with BuddyBoss theme styles to ensure the forum layout
 * displays correctly with proper left sidebar and content area.
 */

/* Reset container sizing and spacing for forum pages */
body.forum-page .site-content,
body.forum-page #content,
body.forum-page .container {
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Fix primary content area */
body.forum-page #primary {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    float: none !important;
}

/* Reset entry content padding */
body.forum-page .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Properly target and override the BuddyBoss grid system */
body.forum-page .bb-grid.site-content-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    gap: 30px !important;
}

/* Fix sidebar column in the BuddyBoss grid */
body.forum-page .forum-sidebar-container,
body.forum-page .bb-grid.site-content-grid > div:first-child {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    margin-right: 30px !important;
    padding-right: 0 !important;
    float: left !important;
}

/* Fix content column in the BuddyBoss grid */
body.forum-page .forum-content-container,
body.forum-page .bb-grid.site-content-grid > div:last-child {
    flex: 1 !important;
    min-width: 0 !important;
    width: calc(100% - 310px) !important;
    max-width: calc(100% - 310px) !important;
    float: right !important;
    padding: 20px !important;
}

/* Ensure forum sidebar sticks properly */
body.forum-page .forum-sidebar {
    width: 100% !important;
    display: block !important;
    position: sticky !important;
    top: 30px !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
}

/* Legacy layout support */
.forum-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body.forum-page .bb-grid.site-content-grid,
    .forum-layout {
        flex-direction: column !important;
        display: block !important;
    }
    
    body.forum-page .forum-sidebar-container,
    body.forum-page .bb-grid.site-content-grid > div:first-child,
    body.forum-page .forum-content-container,
    body.forum-page .bb-grid.site-content-grid > div:last-child {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        float: none !important;
        margin: 0 0 20px 0 !important;
    }
    
    body.forum-page .forum-sidebar {
        position: static !important;
        max-height: none !important;
    }
}