/* Layout Fix - Comprehensive Solution for Right Column Display */

/* Reset any conflicting styles */
* {
    box-sizing: border-box;
}

/* Main container setup */
.main-content {
    width: 100%;
}

.main-content .container {
    max-width: 1600px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* Primary layout grid - news content left, widgets right */
.news-layout-grid {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 30px !important;
    width: 100% !important;
    align-items: start !important;
    margin: 0 !important;
}

/* Left column - news content */
.news-content-column {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important; /* Prevent grid blowout */
    overflow: hidden !important;
}

/* Right column - widgets */
.widgets-column {
    grid-column: 2 !important;
    width: 350px !important;
    position: sticky !important;
    top: 20px !important;
    height: fit-content !important;
}

/* Ensure all child elements respect the layout */
.news-content-column > *,
.widgets-column > * {
    max-width: 100% !important;
    width: 100% !important;
}

/* Widget sections styling */
.widget-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Remove any conflicting styles from child elements */
.featured-news,
.section-header,
.news-grid,
.grid-section,
.pagination,
.news-card,
.grid-card {
    float: none !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Responsive design - stack on mobile */
@media (max-width: 968px) {
    .news-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .news-content-column,
    .widgets-column {
        grid-column: 1 !important;
        width: 100% !important;
    }
    
    .widgets-column {
        position: relative !important;
        top: auto !important;
        margin-top: 30px !important;
    }
    
    .widget-section {
        max-width: 500px;
        margin: 0 auto 20px;
    }
}

/* Override any conflicting display properties */
.news-layout-grid {
    display: grid !important;
}

/* Ensure no other styles can override our grid */
body .main-content .container .news-layout-grid {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 30px !important;
}

body .main-content .container .news-layout-grid .news-content-column {
    grid-column: 1 !important;
    max-width: 100% !important;
}

body .main-content .container .news-layout-grid .widgets-column {
    grid-column: 2 !important;
    width: 350px !important;
    max-width: 350px !important;
    min-width: 350px !important;
}

/* Kill any flexbox that might interfere */
.news-layout-grid,
.news-content-column,
.widgets-column {
    display: block !important;
}

.news-layout-grid {
    display: grid !important; /* Re-apply after killing display: block */
}

/* Flexbox is more reliable for this layout */
.news-layout-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}
