/* ===========================================
   MODNIX — NEWS PAGE
   =========================================== */

/* ===========================================
   0. PAGE HEADER (with background art)
   Mirrors .page-header--community in community.css: one continuous
   background-image that starts at the top of the hero, extends extra
   space at the bottom (pure image, no text), fades that extra space to
   transparent, and pulls .news-page up over it with a negative margin so
   the page content sits on top of roughly the bottom third of the art.
   =========================================== */
.page-header--news {
    position: relative;
    overflow: hidden;
    background-color: #0f1420;
    background-size: cover;
    /* "top" keeps the crop anchored to the same part of the image no
       matter how tall this box gets — see the matching note in
       community.css for why this matters. */
    background-position: center top;
    /* base.css's generic .page-header rule (shared class on the same
       element) adds padding/margin/border. All three overridden here,
       same approach as .page-header--community. */
    padding: var(--spacing-2xl) 0 calc(var(--spacing-2xl) + 260px);
    margin-bottom: -260px;
    border-bottom: none;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 260px, #000 100%);
            mask-image: linear-gradient(to top, transparent 0, #000 260px, #000 100%);
}

.page-header--news__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 12, 20, 0.9) 0%, rgba(10, 12, 20, 0.55) 50%, rgba(10, 12, 20, 0.75) 100%);
}

.page-header--news .container {
    position: relative;
    z-index: 1;
}

/* Makes sure the actual page content (sidebar, cards, etc.) paints above
   the faded tail of the header instead of it accidentally covering them.
   Scoped so it only kicks in on pages that actually have this header. */
.page-header--news ~ .news-page {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .page-header--news {
        padding-bottom: calc(var(--spacing-2xl) + 120px);
        margin-bottom: -120px;
        -webkit-mask-image: linear-gradient(to top, transparent 0, #000 120px, #000 100%);
                mask-image: linear-gradient(to top, transparent 0, #000 120px, #000 100%);
    }
}

.news-page {
    padding: var(--spacing-xl) 0;
    background: var(--bg-main);
    min-height: 100vh;
}

.news-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: var(--spacing-lg);
    align-items: start;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.sidebar-widget__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-widget__title i {
    color: var(--primary);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-list li a:hover,
.category-list li a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.category-list li a i {
    font-size: 12px;
    width: 16px;
    color: var(--primary);
}

.category-count {
    margin-left: auto;
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-muted);
}

/* Topic List */
.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.topic-list li:last-child a {
    border-bottom: none;
}

.topic-hash {
    color: var(--primary);
    font-weight: 700;
    margin-right: 6px;
}

.topic-count {
    color: var(--text-muted);
    font-size: 12px;
}

/* Newsletter Widget */
.newsletter-widget__text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.newsletter-form__input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: var(--spacing-sm);
}

.newsletter-form__btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.newsletter-form__btn:hover {
    background: var(--primary-dark);
}

.newsletter-widget__subtext {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--spacing-sm);
}

/* Social Links */
.follow-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== MAIN CONTENT ===== */
.news-main {
    min-width: 0;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.category-tabs::-webkit-scrollbar {
    height: 5px;
}

.category-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.category-tab {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary);
}

/* Featured Card */
.featured-section {
    margin-bottom: var(--spacing-xl);
}

.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.featured-card__image {
    position: relative;
    min-height: 280px;
    background: #1a1a2e;
}

.featured-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
    opacity: 0.3;
}

.featured-card__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.featured-card__content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--spacing-sm);
}

.featured-card__category {
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.featured-card__date {
    font-size: 12px;
    color: var(--text-muted);
}

.featured-card__title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.featured-card__excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.featured-card__stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.featured-card__stats i {
    margin-right: 4px;
}

.featured-card__readmore {
    margin-left: auto;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

/* News List */
.all-news-section {
    margin-bottom: var(--spacing-xl);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.news-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.news-item__link {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--spacing-md);
    text-decoration: none;
    color: inherit;
    padding: var(--spacing-md);
}

.news-item__thumb {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-dark);
}

.news-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
    opacity: 0.3;
}

.news-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.news-item__badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
}

.news-item__time {
    font-size: 12px;
    color: var(--text-muted);
}

.news-item__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.news-item__excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.news-item__stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.news-item__stats i {
    margin-right: 3px;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--spacing-lg);
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Trending List */
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item__rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.trending-item__link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.trending-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-item__views {
    font-size: 11px;
    color: var(--text-muted);
}

/* Latest List */
.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.latest-item:last-child {
    border-bottom: none;
}

.latest-item__link {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.latest-item__thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-dark);
    flex-shrink: 0;
}

.latest-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-item__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    opacity: 0.3;
}

.latest-item__content {
    flex: 1;
    min-width: 0;
}

.latest-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-item__time {
    font-size: 11px;
    color: var(--text-muted);
}

/* No Results */
.no-results {
    color: var(--text-muted);
    text-align: center;
    padding: var(--spacing-xl);
}

/* ===== NEWS DETAIL PAGE ===== */
.news-detail-page {
    padding: var(--spacing-xl) 0;
    background: var(--bg-main);
    min-height: 100vh;
}

.news-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-lg);
    align-items: start;
}

.news-detail-main {
    min-width: 0;
}

.news-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.news-detail__header {
    margin-bottom: 32px;
}

.news-detail__title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 16px 0;
    line-height: 1.3;
}

.news-detail__meta {
    display: flex;
    gap: 24px;
    color: var(--text-muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.news-detail__meta i {
    color: var(--primary);
    margin-right: 6px;
}

.news-detail__image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.news-detail__content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.news-detail__content h1,
.news-detail__content h2,
.news-detail__content h3 {
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 14px;
}

.news-detail__content p {
    margin-bottom: 16px;
}

.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.news-detail__content a {
    color: var(--primary);
    text-decoration: underline;
}

.news-detail__tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.news-detail__tags h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.news-detail__tags h3 i {
    color: var(--primary);
    margin-right: 6px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.news-detail__share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.news-detail__share h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Related Mods Section */
.related-mods-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.mods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mod-card-mini {
    display: flex;
    gap: 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.mod-card-mini:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.mod-card-mini__icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background-color: var(--primary);
    background-size: cover;
    background-position: center;
}

.mod-card-mini__content {
    flex: 1;
    min-width: 0;
}

.mod-card-mini__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mod-card-mini__excerpt {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mod-card-mini__stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.mod-card-mini__stats i {
    margin-right: 4px;
}

/* Sidebar Widgets for Detail Page */
.news-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: sticky;
    top: 80px;
}

/* Custom Ad Widget */
.custom-ad-widget {
    padding: 0;
    overflow: hidden;
    border-color: rgba(16, 185, 129, 0.3);
}

.custom-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.custom-ad-link:hover {
    transform: scale(1.02);
}

.custom-ad__image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.custom-ad__content {
    padding: var(--spacing-md);
}

.custom-ad__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.custom-ad__desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.custom-ad__cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge--info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .news-layout {
        grid-template-columns: 240px 1fr;
    }
    .sidebar--right {
        display: none;
    }
    .news-detail-layout {
        grid-template-columns: 1fr;
    }
    .news-detail-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .news-layout {
        grid-template-columns: 1fr;
    }
    .sidebar--left {
        display: none;
    }
    .featured-card {
        grid-template-columns: 1fr;
    }
    .news-item__link {
        grid-template-columns: 80px 1fr;
    }
    .news-item__thumb {
        width: 80px;
        height: 80px;
    }
    .news-detail__title {
        font-size: 26px;
    }
    .news-detail__meta {
        flex-direction: column;
        gap: 8px;
    }
    .mods-grid {
        grid-template-columns: 1fr;
    }
}