/* متغیرها برای سادگی در تغییر رنگ */
:root {
    --primary-color: #D32F2F; /* رنگ اصلی: قرمز قوی */
    --secondary-color: #3f51b5; /* رنگ دوم: آبی تیره */
    --text-color: #333;
    --light-bg: #f7f7f7;
    --white: #ffffff;
    --dark-bg: #222;
    --border-color: #eee;
    --font-vazir: 'Vazirmatn', sans-serif;
}

/* تنظیمات پایه */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-vazir);
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.7;
    text-align: right;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 10px;
}

/* هدر و ناوبری */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    border-top: 5px solid var(--primary-color); /* خط بالا برای تمایز */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--dark-bg);
    font-size: 2rem;
    font-weight: 800;
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin-right: 25px;
}

.main-nav a {
    font-weight: 600;
    padding: 5px 0;
    color: var(--text-color);
    position: relative;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* چیدمان اصلی محتوا */
.main-layout {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

.main-content {
    flex: 3; 
    min-width: 0; /* برای انعطاف‌پذیری بهتر */
}

.sidebar {
    flex: 1; 
    min-width: 250px;
}

/* --- بخش Hero (مهم‌ترین خبر) --- */
.hero-article {
    margin-bottom: 30px;
}

.featured-post {
    position: relative;
    height: 450px; 
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-post:hover .hero-image {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 40px;
    color: var(--white);
    /* گرادیانت تیره از پایین برای خوانایی متن */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
}

.hero-overlay h2 a {
    color: var(--white);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    display: block;
    margin-bottom: 15px;
}

.hero-overlay h2 a:hover {
    color: #ffcc00; /* رنگ زرد طلایی برای هاور */
}

.post-meta span {
    font-size: 0.9rem;
    margin-left: 20px;
    color: #ccc;
}

/* --- استایل تگ‌ها و دسته بندی‌ها --- */
.category-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--white);
}

.tag-urgent { background-color: var(--primary-color); }
.tag-politics { background-color: #00897B; } /* سبز مایل به آبی */
.tag-eco { background-color: #FFB300; } /* زرد مایل به نارنجی */
.tag-tech { background-color: var(--secondary-color); }

/* --- بخش لیست آخرین اخبار --- */
.latest-news h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-right: 15px;
    border-right: 4px solid var(--primary-color);
}

.news-grid {
    display: flex;
    gap: 20px;
}

.news-card {
    flex: 1;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

.news-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-body {
    padding: 15px;
}

.card-body h4 a {
    font-size: 1.15rem;
    font-weight: 700;
    display: block;
    margin: 10px 0;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.post-time {
    font-size: 0.8rem;
    color: #999;
    display: block;
}

/* --- بخش پرطرفدارترین‌ها --- */
.trending-section {
    margin-top: 40px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.trending-list {
    margin-top: 15px;
}

.trending-item {
    display: flex;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding: 10px 0;
}

.trending-item:last-child {
    border-bottom: none;
}

.trend-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-left: 15px;
}

.trending-item a {
    font-weight: 600;
    line-height: 1.4;
}

/* --- سایدبار و ویجت‌ها --- */
.widget {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.widget h4 {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.widget-category ul li {
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.widget-category ul li:last-child {
    border-bottom: none;
}

.widget-category .count {
    color: var(--primary-color);
    font-weight: 700;
}

.ad-image {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

/* فوتر */
.main-footer {
    background-color: var(--dark-bg);
    color: var(--white);
    text-align: center;
    padding: 25px 0;
    margin-top: 20px;
}

/* واکنش‌گرا (Responsive) - برای موبایل */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }

    .main-content, .sidebar {
        flex: auto;
        width: 100%;
    }
    
    .news-grid {
        flex-direction: column;
    }

    .news-card {
        margin-bottom: 15px;
    }

    .hero-overlay h2 a {
        font-size: 1.8rem;
    }
    
    .hero-overlay {
        padding: 25px;
    }
}

@media (max-width: 600px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 10px;
    }

    .main-nav li {
        margin: 5px 10px;
    }
}
