/* ==========================================================
   NEWS PAGE
========================================================== */

.news-page {
    padding: 80px 0;
}

/* فقط برای وسط‌چین شدن محتوای همین صفحه */
.news-page .container {
    width: min(100% - 40px, 1320px);
    margin-right: auto;
    margin-left: auto;
}

/* HEADER */
.news-header {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 50px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 50px;
    background: #e8f3ff;
    color: #0b3a5a;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 18px;
}

.news-header h1 {
    font-size: 42px;
    font-weight: 900;
    color: var(--color-primary);
    margin-bottom: 18px;
}

.news-header p {
    color: var(--color-muted);
    line-height: 2;
    font-size: 16px;
}

/* FILTER */
.news-filter {
    background: white;
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 45px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.filter-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px 120px;
    gap: 15px;
}

.search-input,
.category-select {
    height: 55px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 18px;
}

.search-input span {
    margin-left: 12px;
    font-size: 18px;
    color: #94a3b8;
}

.search-input input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: 15px;
}

.category-select select {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.news-filter .filter-btn {
    border: none;
    border-radius: 15px;
    background: #0b3a5a;
    color: white;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.news-filter .filter-btn:hover {
    background: #0f6cbd;
}

/* NEWS GRID */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.news-link {
    text-decoration: none;
    color: inherit;
}

/* کارت اخبار با فلکس‌باکس مرتب شده */
.news-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: .3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.news-image {
    height: 230px;
    overflow: hidden;
    background: #eef5ff;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #cbd5e1;
}

.news-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-body {
    flex-grow: 1;
}

/* این بخش باعث می‌شود بقیه عناصر به پایین رانده شوند */
.news-category {
    display: inline-block;
    padding: 5px 12px;
    background: #e8f3ff;
    color: #0b3a5a;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
}

.news-content h2 {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.8;
    margin-bottom: 12px;
}

.news-content p {
    color: var(--color-muted);
    line-height: 2;
    font-size: 14px;
    margin-bottom: 0;
}

/* فوتر کارت */
.news-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.news-meta {
    color: #94a3b8;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-more {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

.news-link:hover .news-more {
    gap: 10px;
}

.empty-result {
    grid-column: 1/-1;
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 20px;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .filter-wrapper {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .news-page {
        padding: 40px 0;
    }

    .news-page .container {
        width: min(100% - 30px, 1320px);
    }

    .news-header h1 {
        font-size: 28px;
        margin-bottom: 12px;
    }

    /* اصلاح ساختار فیلتر در موبایل */
    .news-filter {
        padding: 15px;
        border-radius: 20px;
    }

    .filter-wrapper {
        display: flex; /* تغییر از grid به flex برای کنترل بهتر */
        flex-direction: column;
        gap: 12px;
    }

    .search-input,
    .category-select {
        height: 50px; /* کمی کوتاه‌تر برای موبایل */
        width: 100%;
        padding: 0 15px;
    }

    /* دکمه جستجو در موبایل */
    .news-filter .filter-btn {
        height: 50px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        margin-top: 5px; /* کمی فاصله بصری */
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-image {
        height: 190px;
    }
    
    .news-content {
        padding: 20px;
    }
}

/* فیکس مخصوص موبایل‌های خیلی کوچک (زیر 360px) */
@media (max-width: 360px) {
    .news-header h1 {
        font-size: 24px;
    }
    
    .news-content h2 {
        font-size: 18px;
    }
}
