/* Main Layout */
.articles-section {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
}

.articles-wrapper-left {
    flex: 1;
    min-width: 0;
    /* Prevents flexbox overflow */
}

.articles-wrapper-right {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
    /* Adjust based on navbar height */
    align-self: flex-start;
    /* Important for sticky to work correctly in a flex container */
}

.articles-intro-text {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ff8a00;
    display: inline-block;
    color: var(--text-primary-color);
}

/* Article List */
.articles-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: #1A1A1A;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.widget-header {
    color: #8D8C8C;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    padding: 12px 16px;
    margin-top: 5px;
}

.widget-content {
    padding: 10px 15px 20px;
}

/* Filters Sidebar */
.platformsort {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary-color);
    text-decoration: none;
    transition: transform 0.1s ease-in-out;
}

.platformsort:hover {
    font-weight: 600;
}

.platformsort.active {
    color: #fff;
}

.categorysort {
    display: block;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-secondary-color);
    transition: color 0.2s;
}

.categorysort:hover {
    color: var(--text-primary-color);
}

.categorysort.activecategory {
    font-weight: 700;
    color: #fff;
}


/* Pagination */
.articles-navigation {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.articles-navigation-last,
.articles-navigation-next {
    background-color: var(--button-background-light);
    color: var(--button-text);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
}

.articles-navigation-last.disabled,
.articles-navigation-next.disabled {
    background-color: #555;
    pointer-events: none;
    opacity: 0.6;
}

.articles-page-counter {
    font-size: 1.1em;
    color: var(--text-secondary-color);
}

.mobile-filter-section {
    display: none;
}

.mobile-filter-trigger {
    background-color: var(--card-bg-color);
    color: var(--text-primary-color);
    border: 1px solid var(--divider-color);
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-filter-trigger i {
    transition: transform 0.2s ease-in-out;
}

.mobile-filter-trigger.active i {
    transform: rotate(180deg);
}

.mobile-filters-content {
    margin-top: 15px;
    padding: 0;
}

/* Responsive */
@media (max-width: 992px) {

    main {
        padding: 10px;
    }
    .articles-section {
        flex-direction: column-reverse;
    }

    .articles-wrapper-right,
    .frontpage-sidebar {
        width: 100%;
        position: static;
        display: none;
        /* Hide the desktop sidebar on mobile */
    }

    .mobile-filter-section {
        display: block;
        /* Show the mobile filter section */
    }

    .mobile-filters-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .patreon-widget {
        display: none;
    }
}

@media (max-width: 600px) {
    .articles-list-wrapper {
        display: block;
        /* stack them */
    }

    .article-card-frontpage {
        /* Ensure they take full width */
        width: 100%;
        margin-bottom: 20px;
    }
}