:root {
    --bg-dark: #0f0b2e;
    --purple-primary: #a78bfa;
    --purple-accent: #c084fc;
    --purple-dark: #9333ea;
    --text-light: #ffffff;
    --text-muted: #e0c3ff;
    --border-purple: rgba(167, 139, 250, 0.25);
    --gradient-main: linear-gradient(135deg, #a78bfa, #9333ea, #c084fc);
}

body {
    margin: 0;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
}

.articles-page {
    padding: 100px 20px 140px;
    max-width: 100%;
}

/* محدود کردن عرض مرکزی محتوا برای ثبات در همه دسکتاپ‌ها */
.articles-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-title {
    text-align: center;
    font-size: clamp(36px, 5vw, 52px); /* اندازه فونت انعطاف‌پذیر اما کنترل‌شده */
    font-weight: 800;
    margin-bottom: 80px;
    color: #f0e6ff;
    position: relative;
}

.page-title::after {
    content: '';
    display: block;
    width: 160px;
    height: 6px;
    background: var(--gradient-main);
    margin: 24px auto 0;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); /* حداقل 360px برای خوانایی بهتر */
    gap: 40px;
}

/* کارت مقاله — زیبا و ثابت */
.article-card {
    background: rgba(25, 18, 55, 0.55);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.45s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* همه کارت‌ها هم‌ارتفاع باشن */
}

.article-card:hover {
    transform: translateY(-14px);
    border-color: var(--purple-primary);
    box-shadow: 0 25px 60px rgba(167, 139, 250, 0.15);
}

.article-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.article-card:hover .article-image {
    transform: scale(1.1);
}

.article-image-placeholder {
    height: 260px;
    background: linear-gradient(135deg, #a78bfa, #c084fc, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(42px, 8vw, 64px);
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.article-content {
    padding: 34px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.article-title {
    font-size: clamp(22px, 2.8vw, 26px);
    font-weight: 800;
    margin-bottom: 16px;
    color: #f8f0ff;
    line-height: 1.5;
}

.article-description {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 28px;
    opacity: 0.94;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid rgba(167, 139, 250, 0.25);
    margin-bottom: 28px;
}

.article-category {
    padding: 10px 24px;
    background: rgba(167, 139, 250, 0.25);
    color: #e9d5ff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    backdrop-filter: blur(6px);
}

.article-date {
    color: #d8b4fe;
    font-size: 15.5px;
    font-weight: 600;
}

/* دکمه‌های زیبا و ثابت */
.read-more {
    display: block;
    text-align: center;
    padding: 18px;
    font-weight: 700;
    font-size: 17px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--purple-primary);
    color: var(--purple-primary);
    margin-top: auto; /* دکمه همیشه پایین کارت باشه */
}

.read-more::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
}

.read-more:hover::before {
    opacity: 1;
}

.read-more:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(167, 139, 250, 0.3);
}

.read-more span {
    position: relative;
    z-index: 1;
}

/* حالت‌های مختلف دکمه */
.read-more.write { border-color: #9333ea; color: #9333ea; }
.read-more.write:hover { color: white; }

.read-more.soon {
    border: 2px dashed rgba(167, 139, 250, 0.4);
    color: #b08cff;
    cursor: not-allowed;
    background: rgba(167, 139, 250, 0.05);
}

.read-more.soon:hover {
    transform: none;
    box-shadow: none;
}

.read-more.soon::before { display: none; }

.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 140px 20px;
    color: var(--text-muted);
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 500;
}

.no-articles p {
    margin: 20px 0;
    font-size: 24px;
    opacity: 0.9;
}

/* ریسپانسیو — فقط برای تبلت و موبایل تغییر می‌کنه، دسکتاپ ثابت می‌مونه */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 35px;
    }
}

@media (max-width: 768px) {
    .articles-page {
        padding: 80px 15px 120px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .article-image,
    .article-image-placeholder {
        height: 220px;
    }

    .article-content {
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .page-title {
        margin-bottom: 60px;
    }

    .article-content {
        padding: 24px;
    }

    .read-more {
        padding: 16px;
        font-size: 16px;
    }
}