/* SEO Enhancements (ToC & Sources) */

/* Table of Contents */
.article-toc {
    background: var(--bg-tertiary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dark-mode .article-toc {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.dark-mode .toc-header {
    border-color: rgba(255, 255, 255, 0.1);
}

.toc-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.dark-mode .toc-header h2 {
    color: #fff;
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--text-tertiary, #9ca3af);
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.2s;
    padding: 5px;
}

.toc-toggle:hover {
    color: var(--text-primary, #111827);
}

.article-toc.hidden .toc-list {
    display: none;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.toc-item a {
    color: var(--text-secondary, #4b5563);
    text-decoration: none;
    font-size: 1.15rem;
    display: block;
    transition: all 0.2s;
}

.dark-mode .toc-item a {
    color: #9ca3af;
}

.toc-item a:hover {
    color: var(--accent-color, #6366f1);
    transform: translateX(4px);
}

.rtl .toc-item a:hover {
    transform: translateX(-4px);
}

/* Indentation levels */
.toc-level-3 {
    padding-inline-start: 1rem;
    font-size: 0.9em;
}

.toc-level-4 {
    padding-inline-start: 2rem;
    font-size: 0.85em;
}

.toc-level-5 {
    padding-inline-start: 3rem;
    font-size: 0.8em;
}

/* Article Source / References */
.article-source {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--bg-tertiary, #f8f9fa);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color, #6366f1);
    font-size: 0.95rem;
}

.dark-mode .article-source {
    background: rgba(255, 255, 255, 0.03);
}

.rtl .article-source {
    border-left: none;
    border-right: 4px solid var(--accent-color, #6366f1);
}

.source-label {
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-inline-end: 0.5rem;
}

.dark-mode .source-label {
    color: #fff;
}

.source-link {
    color: var(--accent-color, #6366f1);
    text-decoration: none;
    font-weight: 500;
}

.source-link:hover {
    text-decoration: underline;
}

.source-text {
    color: var(--text-secondary, #4b5563);
}