﻿/* Base container */
.article-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-sm);
    padding-bottom: var(--space-xl);
    line-height: var(--leading-relaxed);
}
.article-container li{
    margin-top:1rem;
}
.article-wrapper {
    max-width: var(--text-max-width);
    margin: auto;
}

/* Header styling */
.article-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.article-title {
    font-family: var(--font-primary);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-display);
    margin: var(--space-xl) auto var(--space-md);
    color: var(--site-red);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    font-size: var(--text-base);
    color: var(--gray);
    margin-bottom: var(--space-lg);
}

/* Summary styling */
.article-summary {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--dark);
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-md);
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Image containers with 16:9 aspect ratio */
.image-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin: var(--space-sm) 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.responsive-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-container:hover .responsive-image {
    transform: scale(1.02);
}

/* Section styling */
.content-section {
    margin-bottom: var(--space-xl);
}

.ad-course-view-component {
    border-bottom: 1px solid var(--secondary-bg);
    border-top: 1px solid var(--secondary-bg);
}

.section-main-title {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin: var(--space-xl) 0 var(--space-md);
    color: var(--primary);
    padding-bottom: var(--space-sm);
    position:relative;
    
}
    /* Section titles with top overlay */
    .section-main-title.border-overlay-bottom {
        border-bottom: 1px solid var(--secondary-bg);
        padding-top: var(--space-sm);
    }

.section-subtitle {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: var(--space-lg) 0 var(--space-md);
    color: var(--primary);
    position: relative;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, transparent 0%,var(--secondary-bg-light) 100% );
    border-radius: var(--border-radius);
    border-right: 3px solid var(--primary-light);
    box-shadow: 0 3px 4px rgba(0,0,0,0.05);
}

/* RTL version */
html[dir="rtl"] .section-subtitle {
    border-left: none;
    border-right: 3px solid var(--primary-light);
}
.section-summary {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    color: var(--dark);
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.section-content {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    color: var(--dark);
    line-height: var(--leading-relaxed);
}

    .section-content ::deep p {
        margin-bottom: var(--space-md);
    }

    .section-content ::deep ul,
    .section-content ::deep ol {
        padding-left: var(--space-lg);
        margin-bottom: var(--space-lg);
    }

    .section-content ::deep li {
        margin-bottom: var(--space-sm);
    }

    .section-content ::deep blockquote {
        border-left: 4px solid var(--secondary);
        padding: var(--space-sm) var(--space-md);
        margin: var(--space-lg) 0;
        background: var(--secondary-bg-light);
        font-style: italic;
        border-radius: var(--border-radius);
    }

    .section-content ::deep code {
        background: var(--secondary-bg);
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--border-radius);
    }

/* Base Caption Style */
.image-caption {
    display: block;
    text-align: center;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray);
    margin: var(--space-sm) auto var(--space-md);
    padding: 0 var(--space-md);
    max-width: 80%;
}

/* Featured Image Caption */
.article-featured-image .image-caption {
    font-size: var(--text-base);
    color: var(--dark);
    margin-top: var(--space-sm);
    font-weight: var(--font-medium);
}

/* Section Image Caption */
.section-image .image-caption {
    font-style: italic;
    /*border-bottom: 1px solid var(--secondary-bg);*/
    padding-bottom: var(--space-sm);
}

/* RTL Support for Persian */
html[dir="rtl"] .image-caption {
    letter-spacing: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-container {
        padding: var(--space-md) var(--space-sm);
    }

    .article-title {
        font-size: var(--text-xl);
    }

    .article-summary {
        font-size: var(--text-base);
        padding: 0;
    }

    .section-main-title {
        font-size: var(--text-lg);
    }

    .section-subtitle {
        font-size: var(--text-lg);
        margin-top:3rem;
    }

    .image-container {
        margin: var(--space-sm) 0;
    }

    .image-caption {
        font-size: var(--text-sm);
        padding: 0 var(--space-sm);
        max-width: 90%;
    }

    .article-featured-image .image-caption {
        font-size: var(--text-base);
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: var(--text-lg);
    }

    .article-meta {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }

    .section-main-title {
        font-size: var(--text-base);
    }


    .image-caption {
        font-size: var(--text-xs);
        padding: 0 var(--space-xs);
        max-width: 95%;
    }
}
/*============================*/
/*============================*/
/*============================*/
/*============================*/
/* Table of Contents Styles - RTL Persian Support */
.table-of-contents {
    background: var(--secondary-bg-light);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-right: 4px solid var(--primary);
    border-left: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    direction: rtl;
    text-align: right;
}

.toc-header {
    margin-bottom: var(--space-md);
}

.toc-title {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toc-nav {
    width: 100%;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toc-item {
    margin: 0;
    padding: 0;
}

.toc-main-item {
    /* Remove border-bottom that was separating groups */
}

.toc-sublist {
    list-style: none;
    padding: 0;
    margin: var(--space-xs) 0 0 0;
    /* Remove the border-right that was showing hierarchy */
}

.toc-subitem {
    margin: 0;
    padding: 0;
}

.toc-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    color: var(--dark);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
    border-right: 3px solid transparent;
    text-align: right;
}

.toc-main-link {
    font-weight: var(--font-semibold);
    color: var(--primary);
    font-size: var(--text-base);
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
}

.toc-sub-link {
    font-size: var(--text-sm);
    color: var(--gray-dark);
    padding: var(--space-xs) var(--space-md);
    margin-right: var(--space-md); /* Indent subtitles */
}

/* Remove all arrow icons */
.toc-link::after,
.toc-link::before {
    content: none !important;
}

.toc-link:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-4px);
    border-right-color: var(--accent-dark);
}

.toc-link.active {
    background: var(--primary);
    color: white;
    border-right-color: var(--accent-dark);
    font-weight: var(--font-semibold);
    transform: translateX(-4px);
}

/* Responsive Design for RTL */
@media (max-width: 768px) {
    .table-of-contents {
        padding: var(--space-md);
        margin-bottom: var(--space-lg);
    }

    .toc-title {
        font-size: var(--text-base);
    }

    .toc-link {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-sm);
    }

    .toc-main-link {
        font-size: var(--text-sm);
    }

    .toc-sub-link {
        font-size: var(--text-xs);
        margin-right: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .table-of-contents {
        padding: var(--space-sm);
    }

    .toc-list {
        gap: var(--space-xs);
    }

    .toc-link {
        font-size: var(--text-xs);
        padding: var(--space-xs);
    }

    .toc-sub-link {
        margin-right: var(--space-xs);
    }
}

/* Animation for smooth transitions - RTL */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px) translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

.toc-item {
    animation: fadeInUp 0.3s ease forwards;
}

    .toc-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .toc-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .toc-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    .toc-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .toc-item:nth-child(5) {
        animation-delay: 0.5s;
    }

/* Persian font specific adjustments */
.toc-link {
    line-height: var(--leading-relaxed);
    letter-spacing: 0;
}

.toc-main-link {
    line-height: var(--leading-normal);
}
.content-section, .subsection {
    scroll-margin-top: 80px; /* matches your header height */
}