/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
}
/* ===== Reset for WordPress/Elementor Styles ===== */
/* این بخش استایل‌های المنتور و وردپرس را ریست می‌کند */
.article-content > * {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.article-content img {
    display: block !important;
    margin: 30px auto !important;
    height: auto !important;
    max-width: 100% !important;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* برای تصاویر المنتور */
.article-content .wp-block-image,
.article-content .elementor-image {
    text-align: center !important;
    margin: 30px 0 !important;
}

.article-content .wp-block-image img,
.article-content .elementor-image img {
    display: inline-block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* برای تصاویر دارای کپشن */
.article-content figure {
    margin: 30px 0 !important;
    text-align: center !important;
}

.article-content figure img {
    display: inline-block !important;
    margin: 0 auto 15px auto !important;
}

.article-content figcaption {
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
    font-style: italic;
    margin-top: 10px;
}

/* ===== Video Styling ===== */
/* استایل برای ویدیوهای المنتور */
.article-content .elementor-video,
.article-content .wp-block-video,
.article-content video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 30px 0 !important;
    display: block !important;
}

.article-content iframe,
.article-content .elementor-widget-video iframe,
.article-content .wp-block-embed iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 450px !important;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 30px 0 !important;
    display: block !important;
}

/* برای ویدیوهای responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    right: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

/* ===== Text Content Optimization ===== */
/* برای پاراگراف‌ها */
.article-content p {
    font-size: 1.1rem !important;
    line-height: 2 !important;
    margin-bottom: 25px !important;
    text-align: justify;
    color: #334155;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* برای لیست‌ها */
.article-content ul,
.article-content ol {
    margin: 20px 0 25px 30px !important;
    padding-right: 20px !important;
}

.article-content li {
    margin-bottom: 10px !important;
    line-height: 1.8 !important;
    color: #334155;
}

/* برای جداول */
.article-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 30px 0 !important;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.article-content table th {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-weight: 600;
    padding: 15px;
    text-align: right;
}

.article-content table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.article-content table tr:hover {
    background-color: #f8fafc;
}

/* برای blockquote المنتور */
.article-content .elementor-widget-text-editor blockquote,
.article-content .wp-block-quote {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
    border-right: 5px solid #3b82f6 !important;
    padding: 25px 30px !important;
    margin: 30px 0 !important;
    font-style: italic !important;
    color: #334155 !important;
    border-radius: 12px;
    position: relative;
}

.article-content blockquote p {
    margin: 0 !important;
    font-size: 1.15rem !important;
    line-height: 1.8 !important;
}

/* ===== Code Blocks ===== */
.article-content pre,
.article-content code {
    font-family: 'Monaco', 'Courier New', monospace !important;
    direction: ltr !important;
    text-align: left !important;
}

.article-content pre {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    padding: 25px !important;
    border-radius: 12px;
    overflow-x: auto;
    margin: 30px 0 !important;
    font-size: 0.95rem;
    line-height: 1.6;
}

.article-content code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ===== Gallery Images ===== */
/* برای گالری‌های المنتور */
.article-content .elementor-image-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0 !important;
}

.article-content .gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.article-content .gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.article-content .gallery-item img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    transition: transform 0.5s ease;
}

.article-content .gallery-item:hover img {
    transform: scale(1.05);
}

/* ===== Responsive Media ===== */
@media (max-width: 768px) {
    .article-content img {
        margin: 20px auto !important;
        border-radius: 8px;
    }
    
    .article-content iframe,
    .article-content .elementor-widget-video iframe {
        height: 300px !important;
    }
    
    .article-content .elementor-image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .article-content table {
        font-size: 0.85rem;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .article-content iframe,
    .article-content .elementor-widget-video iframe {
        height: 250px !important;
    }
    
    .article-content .elementor-image-gallery {
        grid-template-columns: 1fr;
    }
    
    .article-content .gallery-item img {
        height: 180px !important;
    }
}

/* ===== WordPress Specific Classes Reset ===== */
/* ریست کلاس‌های خاص وردپرس */
.article-content .alignleft {
    float: none !important;
    margin: 0 auto 20px auto !important;
    display: block !important;
    text-align: center;
}

.article-content .alignright {
    float: none !important;
    margin: 0 auto 20px auto !important;
    display: block !important;
    text-align: center;
}

.article-content .aligncenter {
    display: block !important;
    margin: 30px auto !important;
    text-align: center;
}

.article-content .size-full {
    max-width: 100% !important;
    height: auto !important;
}

.article-content .size-large {
    max-width: 100% !important;
    height: auto !important;
}

.article-content .size-medium {
    max-width: 80% !important;
    height: auto !important;
    margin: 20px auto !important;
}

/* ===== Loading Animation for Images ===== */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
    min-height: 200px;
}

@keyframes img-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Lazy Loading Styles ===== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazyloaded {
    opacity: 1;
}

/* ===== Print Styles ===== */
@media print {
    .article-content img {
        max-width: 80% !important;
        page-break-inside: avoid;
    }
    
    .article-content iframe,
    .article-content video {
        display: none !important;
    }
    
    .article-content a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .article-content a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
}
/* ===== Progress Bar ===== */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ===== Main Container ===== */
.main-container {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 30px;
}


/* ===== Sidebar Navigation (Left) ===== */
.sidebar-nav {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3b82f6;
}

.sidebar-title i {
    color: #3b82f6;
    font-size: 1.4rem;
}

#toc {
    list-style: none;
}

#toc li {
    margin-bottom: 12px;
    position: relative;
    transition: all 0.3s ease;
}

#toc li:hover {
    transform: translateX(-5px);
}

#toc a {
    text-decoration: none;
    color: #475569;
    padding: 12px 20px;
    display: block;
    border-radius: 12px;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
    background: linear-gradient(to left, transparent 50%, #f1f5f9 50%);
    background-size: 200% 100%;
    background-position: right bottom;
    font-size: large;
}

#toc a:hover {
    background-position: left bottom;
    color: #1d4ed8;
    border-right: 4px solid #3b82f6;
}

#toc a.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    border-right: 4px solid #1d4ed8;
}

#toc a.h3 {
    margin-right: 35px;
    font-size: 0.95rem;
    position: relative;
}

#toc a.h3::before {
    content: "↪";
    position: absolute;
    right: -25px;
    color: #94a3b8;
}

/* ===== Main Content ===== */
.article-main {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Hero Section */
.article-hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-hero:hover img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    color: white;
    padding: 30px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

/* Article Header */
.article-header {
    padding: 40px 50px 30px;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border-bottom: 1px solid #e2e8f0;
}

.article-header h1 {
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.3;
    position: relative;
    padding-bottom: 20px;
}

.article-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 2px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.meta-item:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.meta-item i {
    color: #3b82f6;
}

.article-breadcrumb {
    margin-top: 25px;
    font-size: 0.95rem;
    color: #64748b;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.article-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-breadcrumb a:hover {
    color: #1d4ed8;
    background: #f1f5f9;
    text-decoration: none;
}

.article-breadcrumb span {
    padding: 5px 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 8px;
    font-weight: 600;
}

/* Article Content */
.article-content {
    padding: 40px 50px;
    font-size: 1.15rem;
}

.content-section {
    margin-bottom: 40px;
}

.article-content h2 {
    font-size: 2.2rem;
    color: #1e293b;
    margin: 50px 0 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e2e8f0;
    position: relative;
}

.article-content h2::before {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.article-content h3 {
    font-size: 1.6rem;
    color: #334155;
    margin: 40px 0 20px;
    padding-right: 20px;
    border-right: 4px solid #cbd5e1;
}

.article-content p {
    margin-bottom: 25px;
    text-align: justify;
    color: #475569;
    line-height: 2;
    font-size: 1.1rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.article-content img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.article-content blockquote {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-right: 6px solid #3b82f6;
    padding: 40px;
    margin: 40px 0;
    border-radius: 16px;
    font-style: italic;
    color: #475569;
    font-size: 1.2rem;
    line-height: 2;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.article-content blockquote::before {
    content: '"';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 5rem;
    color: #cbd5e1;
    font-family: serif;
    opacity: 0.5;
}

.code-container {
    margin: 40px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.code-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #e2e8f0;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
}

.code-lang {
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-actions button {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.code-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.article-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 30px;
    overflow-x: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== Article Navigation (Right Sidebar) ===== */
.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Navigation Cards */
.nav-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.nav-card:hover::before {
    opacity: 1;
}

.nav-card.prev:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}

.nav-card.next:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.2);
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.nav-header.prev .nav-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.nav-header.next .nav-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-content {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-content h3 {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.nav-card:hover .nav-content h3 {
    color: #3b82f6;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 15px;
}

.nav-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-meta-item i {
    font-size: 0.9rem;
}

/* Action Buttons */
.nav-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-btn.read {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.nav-btn.read:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

/* Social Share */
.share-section {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.share-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 20px;
}

.share-title i {
    color: #3b82f6;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.share-btn.telegram:hover {
    background: #0088cc;
    color: white;
    border-color: #0088cc;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.share-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

.share-btn.linkedin:hover {
    background: #0077B5;
    color: white;
    border-color: #0077B5;
}

/* ===== Related Articles ===== */
.related-articles {
    grid-column: 1 / -1;
    margin-top: 60px;
    padding: 50px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
}

.section-title {
    font-size: 2.2rem;
    color: #1e293b;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 2px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
}

.card-content h4 {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 15px;
    line-height: 1.4;
}

.card-excerpt {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #1d4ed8;
    gap: 12px;
}
.elementor-video{
width:-webkit-fill-available;

}
/*----بهینه سازی -----*/
/* ===== TOC Empty State ===== */
.toc-empty {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== Navigation Wrapper ===== */
.navigation-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Improved TOC Links ===== */
#toc a.h1 {
    font-weight: 600;
    font-size: 1.1rem;
    padding-right: 0;
}

#toc a.h2 {
    font-size: 1rem;
    padding-right: 20px;
}

#toc a.h3 {
    font-size: 0.9rem;
    padding-right: 40px;
    opacity: 0.8;
}

/* ===== Responsive Video Containers ===== */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    border-radius: var(--border-radius);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* ===== Accessibility Improvements ===== */
@media (prefers-contrast: high) {
    .article-content h1,
    .article-content h2,
    .article-content h3 {
        color: #000;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .nav-card,
    .article-card,
    .share-btn {
        transition: none !important;
    }
}

/* ===== Print Optimization ===== */
@media print {
    .article-content {
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }
    
    .article-content h1 {
        page-break-after: avoid;
    }
    
    .article-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/*----end----*/


/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 250px 1fr 250px;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .sidebar-nav,
    .article-sidebar {
        position: static;
    }
    
    .article-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .article-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .article-header,
    .article-content {
        padding: 25px 20px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-content h2 {
        font-size: 1.8rem;
    }
    
    .article-content h3 {
        font-size: 1.4rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .related-articles {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .article-hero {
        height: 300px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.2rem;
    }
    
    .article-content p {
        font-size: 1rem;
    }
}

/* ===== Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-card,
.article-card {
    animation: fadeInUp 0.6s ease forwards;
}

.nav-card.prev {
    animation-delay: 0.1s;
}

.nav-card.next {
    animation-delay: 0.2s;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}