/* --- Reset & Fonts --- */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary-navy: #0e1b4d;
    /* سرمه‌ای تیره */
    --accent-red: #d32f2f;
    /* قرمز */
    --bg-gray: #f4f6f8;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-red);
}

/* --- Layout Container --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header --- */
header {
    background-color: var(--white);
    border-bottom: 3px solid var(--accent-red);
    padding: 0.8rem 0;
    /* Slightly reduced padding */
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Text Title Area (Right) */
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-title h1 {
    color: var(--primary-navy);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.2;
}

.site-title span {
    color: var(--accent-red);
}

.site-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Image Logo Area (Left) */
.left-logo {
    background: linear-gradient(to bottom right, var(--primary-navy), #1a2a6c);
    /* سرمه ای هویت بصری */
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.left-logo img {
    height: 60px;
    /* Adjust height as needed */
    width: auto;
    display: block;
    transition: transform 0.3s;
    filter: brightness(0) invert(1);
    /* سفید کردن لوگو روی پس زمینه تیره */
}

.left-logo img:hover {
    transform: scale(1.05);
}

/* --- Intro Section (About Us) --- */
.intro-section {
    background: linear-gradient(to bottom right, var(--primary-navy), #1a2a6c);
    /* سرمه ای هویت بصری */
    color: var(--white);
    padding: 2rem;
    margin: 20px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.intro-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-right: 4px solid var(--accent-red);
    /* بازگشت به رنگ قرمز */
    padding-right: 15px;
}

.intro-text {
    font-size: 0.95rem;
    text-align: justify;
    opacity: 0.95;
}

/* --- Main Content Grid --- */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    /* Right (Categories), Left (Sidebar) */
    gap: 25px;
    margin-bottom: 50px;
}

/* --- Sidebar (Latest News) --- */
.sidebar {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    height: fit-content;
    border-top: 4px solid var(--accent-red);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-header i {
    color: var(--accent-red);
    font-size: 1.2rem;
}

.section-header h2 {
    font-size: 1.1rem;
    color: var(--primary-navy);
}

.news-list {
    list-style: none;
    max-height: 800px;
    overflow-y: auto;
}

.news-list::-webkit-scrollbar {
    width: 5px;
}

.news-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
}

.news-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item h3 {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 5px;
}

.news-meta {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- Categories Grid (Right Side) --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.category-box {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}

.category-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.cat-header {
    background-color: var(--primary-navy);
    color: var(--white);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-title {
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Archive Button Style */
.cat-link {
    font-size: 0.8rem;
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cat-link:hover {
    background-color: var(--white);
    color: var(--primary-navy);
    transform: translateX(-3px);
}

.cat-content {
    padding: 15px;
    min-height: 200px;
}

.cat-news-list {
    list-style: none;
}

.cat-news-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}

.cat-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cat-news-item i {
    color: var(--accent-red);
    font-size: 0.7rem;
    margin-top: 6px;
}

.cat-news-item h4 {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.9rem;
}

.error-msg {
    color: var(--accent-red);
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-navy);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 30px;
}

.footer-text {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }

    .sidebar {
        order: -1;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column-reverse;
        /* Stack logo on top of title in mobile */
        gap: 10px;
    }

    .site-title h1 {
        font-size: 1.2rem;
        text-align: center;
    }

    .site-subtitle {
        text-align: center;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .left-logo img {
        height: 60px;
    }
}
/* --- Mobile Footer --- */
.mobile-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 0;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
}

.mobile-footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.8rem;
    transition: color 0.3s;
}

.mobile-footer-item i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--secondary-gray);
}

.mobile-footer-item.active,
.mobile-footer-item:hover {
    color: var(--accent-red);
}

.mobile-footer-item:hover i,
.mobile-footer-item.active i {
    color: var(--accent-red);
}

@media (max-width: 768px) {
    .mobile-footer {
        display: flex;
    }
    
    /* Add padding to body so content isn't hidden behind footer */
    body {
        padding-bottom: 70px;
    }
}
