/* ============================================================
   متغیرها
   ============================================================ */
:root {
    --navy-900: #0a1428;
    --navy-800: #0f1e38;
    --navy-700: #152a4a;
    --navy-600: #1c3860;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 16px 48px rgba(15, 23, 42, 0.14);
    --transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'IRANYekan', 'Vazirmatn', Tahoma, sans-serif;
    background: #f0f2f5;
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================================
   هیرو مقاله - سرمه‌ای تیره
   ============================================================ */
.article-hero {
    position: relative;
    padding: 40px 0 0;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
    overflow: hidden;
    border-bottom: 3px solid var(--navy-800);
}

.article-hero::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 80px, rgba(255, 255, 255, 0.02) 80px, rgba(255, 255, 255, 0.02) 81px),
        repeating-linear-gradient(-45deg, transparent, transparent 120px, rgba(255, 255, 255, 0.015) 120px, rgba(255, 255, 255, 0.015) 121px);
    animation: patternRotate 60s linear infinite;
    pointer-events: none;
}

@keyframes patternRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.article-hero::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.2); }
}

.article-hero .container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 30px;
}

.article-hero .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    margin-bottom: 18px;
    padding: 8px 18px;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.article-hero .back-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    transform: translateX(-4px);
    border-color: rgba(255,255,255,0.2);
}

.article-hero .category-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.article-hero .featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    color: var(--navy-800);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-right: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.article-hero h1 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.35;
    margin: 12px 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.article-hero .meta {
    display: flex;
    gap: 20px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.article-hero .meta i {
    margin-left: 4px;
    color: #ffffff;
    opacity: 0.85;
}

.article-hero .meta .dot {
    color: rgba(255,255,255,0.25);
}

/* ============================================================
   محتوای مقاله
   ============================================================ */
.article-content-wrapper {
    max-width: 900px;
    margin: -30px auto 0;
    padding: 0 16px 60px;
    position: relative;
    z-index: 2;
}

.article-content-inner {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 44px 52px;
    box-shadow: 
        0 20px 60px rgba(15, 23, 42, 0.08),
        0 8px 24px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.article-content-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        var(--navy-900) 0%, 
        var(--navy-700) 25%, 
        var(--navy-600) 50%, 
        var(--navy-700) 75%, 
        var(--navy-900) 100%
    );
    background-size: 200% 100%;
    animation: shimmerLine 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(15, 30, 56, 0.25);
    z-index: 10;
}

@keyframes shimmerLine {
    0%, 100% {
        background-position: 0% 0;
        box-shadow: 0 0 10px rgba(15, 30, 56, 0.2);
    }
    50% {
        background-position: 100% 0;
        box-shadow: 0 0 20px rgba(15, 30, 56, 0.35);
    }
}

.article-content-inner:hover {
    box-shadow: 
        0 30px 80px rgba(15, 23, 42, 0.12),
        0 12px 32px rgba(15, 23, 42, 0.06);
    transform: translateY(-3px);
}

.article-content-inner .article-image {
    margin: -44px -52px 30px -52px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.article-content-inner .article-image img {
    width: 100%;
    max-width: 100%; /* جلوگیری از سرریز شدن */
    height: auto; /* حفظ نسبت ابعاد */
    max-height: 550px;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}
.article-content-inner:hover .article-image img {
    transform: scale(1.02);
}

/* ============================================================
   بدنه مقاله
   ============================================================ */
.article-content-inner .article-body {
    font-size: 0.95rem;
    line-height: 2.1;
    color: var(--text-primary);
}

.article-content-inner .article-body h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 36px 0 18px;
    color: var(--navy-800);
    position: relative;
    padding-right: 20px;
    line-height: 1.4;
}

.article-content-inner .article-body h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 6px;
    width: 5px;
    background: linear-gradient(to bottom, var(--navy-800), var(--navy-600));
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(15, 30, 56, 0.2);
}

.article-content-inner .article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 26px 0 14px;
    color: var(--navy-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-content-inner .article-body h3::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
    box-shadow: 0 2px 6px rgba(15, 30, 56, 0.25);
}

.article-content-inner .article-body p {
    margin-bottom: 18px;
    color: #334155;
}

.article-content-inner .article-body ul,
.article-content-inner .article-body ol {
    padding-right: 26px;
    margin-bottom: 18px;
}

.article-content-inner .article-body ul li,
.article-content-inner .article-body ol li {
    margin-bottom: 8px;
    color: #334155;
    line-height: 1.9;
}

.article-content-inner .article-body ul li::marker {
    color: var(--navy-800);
    font-size: 1.1em;
}

.article-content-inner .article-body ol li::marker {
    color: var(--navy-800);
    font-weight: 700;
}

.article-content-inner .article-body ul li strong,
.article-content-inner .article-body p strong {
    color: #957716;
    font-weight: 700;
}

.article-content-inner .article-body blockquote {
    background: linear-gradient(135deg, rgba(15, 30, 56, 0.04), rgba(15, 30, 56, 0.02));
    border-right: 4px solid var(--navy-800);
    padding: 18px 26px;
    margin: 24px 0;
    border-radius: 10px;
    font-style: italic;
    color: var(--navy-800);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.article-content-inner .article-body blockquote p:last-child {
    margin-bottom: 0;
}

.article-content-inner .article-body blockquote p {
    color: var(--navy-800);
    font-weight: 500;
}

.article-content-inner .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    display: block;
}

.article-content-inner .article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.article-content-inner .article-body table thead th {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: #ffffff;
    padding: 14px 18px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}

.article-content-inner .article-body table tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.85rem;
    background: #ffffff;
}

.article-content-inner .article-body table tbody tr:hover td {
    background: #f8fafc;
}

.article-content-inner .article-body a {
    color: var(--navy-700);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--navy-600);
    transition: var(--transition);
}

.article-content-inner .article-body a:hover {
    color: var(--navy-900);
    border-bottom-color: var(--navy-900);
}

.article-content-inner .article-body code {
    background: rgba(15, 30, 56, 0.06);
    color: var(--navy-800);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.article-content-inner .article-body pre {
    background: var(--navy-900);
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.7;
}

/* ============================================================
   فوتر مقاله
   ============================================================ */
.article-footer-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(15, 30, 56, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.article-footer-section .author-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.article-footer-section .author-info .avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 8px 25px rgba(10, 20, 40, 0.2);
    transition: var(--transition);
}

.article-footer-section:hover .author-info .avatar {
    transform: scale(1.08) rotate(-3deg);
}

.article-footer-section .author-info .author-details .name {
    font-weight: 800;
    color: var(--navy-800);
    font-size: 0.9rem;
}

.article-footer-section .author-info .author-details .role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.article-footer-section .share-buttons {
    display: flex;
    gap: 8px;
}

.article-footer-section .share-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
    color: #ffffff;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--navy-700);
    box-shadow: 0 4px 15px rgba(10, 20, 40, 0.15);
}

.article-footer-section .share-buttons a:hover {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(10, 20, 40, 0.3);
    border-color: var(--navy-900);
}

.article-footer-section .views-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.article-footer-section .views-count i {
    color: var(--navy-800);
    font-size: 0.95rem;
}

/* ============================================================
   مقالات مرتبط
   ============================================================ */
.related-articles {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(15, 30, 56, 0.08);
}

.related-articles h4 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--navy-800);
}

.related-articles h4 i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: #ffffff;
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(10, 20, 40, 0.15);
}

.related-articles .related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.related-articles .related-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 0;
    transition: var(--transition);
    border: 1px solid rgba(15, 30, 56, 0.06);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}

.related-articles .related-item:hover {
    border-color: var(--navy-800);
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
}

.related-articles .related-item .related-image {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    position: relative;
}

.related-articles .related-item .related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.related-articles .related-item:hover .related-image img {
    transform: scale(1.08);
}

.related-articles .related-item .related-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
}

.related-articles .related-item .related-content {
    padding: 14px 16px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-articles .related-item h5 {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--navy-800);
}

.related-articles .related-item h5 a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.related-articles .related-item h5 a:hover {
    color: var(--navy-900);
}

.related-articles .related-item .date {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.related-articles .related-item .date i {
    color: var(--navy-800);
    font-size: 0.7rem;
}

/* ============================================================
   ریسپانسیو
   ============================================================ */
@media (max-width: 992px) {
    .article-hero h1 {
        font-size: 1.8rem;
    }
    .article-content-inner {
        padding: 34px 36px;
    }
    .article-content-inner .article-image {
        margin: -34px -36px 24px -36px;
    }
    .related-articles .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .article-hero {
        padding: 30px 0 0;
    }
    .article-hero h1 {
        font-size: 1.4rem;
    }
    .article-hero .meta {
        font-size: 0.72rem;
        gap: 12px;
    }
    .article-content-wrapper {
        padding: 0 12px 40px;
        margin-top: -20px;
    }
    .article-content-inner {
        padding: 24px 20px;
    }
    .article-content-inner .article-image {
        margin: -24px -20px 20px -20px;
    }
    .article-content-inner .article-body {
        font-size: 0.88rem;
        line-height: 1.95;
    }
    .article-content-inner .article-body h2 {
        font-size: 1.15rem;
    }
    .article-footer-section {
        flex-direction: column;
        align-items: flex-start;
    }
    .related-articles .related-grid {
        grid-template-columns: 1fr;
    }
    .article-footer-section .share-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .article-hero h1 {
        font-size: 1.15rem;
    }
    .article-hero .category-badge,
    .article-hero .featured-badge {
        font-size: 0.62rem;
        padding: 4px 12px;
    }
    .article-content-inner {
        padding: 18px 14px;
    }
    .article-content-inner .article-image {
        margin: -18px -14px 16px -14px;
    }
    .article-content-inner .article-body {
        font-size: 0.82rem;
        line-height: 1.9;
    }
    .article-content-inner .article-body h2 {
        font-size: 1rem;
    }
    .article-content-inner .article-body blockquote {
        padding: 14px 18px;
    }
    .article-footer-section .author-info .avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    .related-articles .related-item .related-image {
        height: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-hero::before,
    .article-hero::after,
    .article-content-inner::before {
        animation: none;
    }
}