/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    direction: rtl;
    text-align: right;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-12 {
    width: 100%;
    padding: 0 0.5rem;
}

.col-6 {
    width: 50%;
    padding: 0 0.5rem;
}

.col-4 {
    width: 33.333%;
    padding: 0 0.5rem;
}

.col-3 {
    width: 25%;
    padding: 0 0.5rem;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

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

.site-header img {
    height: 60px;
    width: auto;
}

/* Main Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    font-weight: 600;
    color: #2c3e50;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-navigation a:hover {
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.static-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.static-page-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Article Styles
   ========================================================================== */

.article-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-subtitle {
    font-size: 1.25rem;
    color: #7f8c8d;
    font-weight: 400;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.author-name {
    background: #3498db;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.episode-number {
    background: #e74c3c;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Articles Cards Component
   ========================================================================== */

.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.article-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #ecf0f1;
}

.article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.article-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.article-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-item:hover .thumbnail-image {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* ==========================================================================
   Grid Layouts for Lists
   ========================================================================== */

.categories-grid,
.authors-grid,
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-item,
.author-item,
.news-item {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #ecf0f1;
    transition: all 0.3s ease;
}

.category-item:hover,
.author-item:hover,
.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.category-title,
.author-name,
.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.category-count,
.author-articles-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ==========================================================================
   News Specific Styles
   ========================================================================== */

.news-pretitle {
    color: #3498db;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.news-date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.news-lead {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.news-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.keyword-tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.keyword-tag:hover {
    background: #3498db;
    color: #fff;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links h4,
.social-media h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: scale(1.1);
}

.social-link img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

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

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3498db;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-button:hover {
    background: #2980b9;
    color: #fff;
    text-decoration: none;
    transform: translateX(5px);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .articles-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .categories-grid,
    .authors-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .col-6,
    .col-4,
    .col-3 {
        width: 100%;
    }

    .article-title {
        font-size: 1.75rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .static-page-content {
        padding: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.5rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .static-page-content {
        padding: 0.75rem;
    }

    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   SEO & Performance Optimizations
   ========================================================================== */

/* Improve loading performance */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .back-button {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    .static-page-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
