/* ideas.poorvam Article View - Śāstric–Classical Minimalism */

/* Base Article Container */
.main-content.view-article {
    display: block;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    background: none;
}

body.dark-mode .main-content.view-article {
    background: none;
}

/* Dark Mode Fallbacks */
body.dark-mode .article-content * {
    color: #F6F1E7 !important;
}

body.dark-mode .article-content img {
    filter: brightness(90%);
}

body.dark-mode .article-content table,
body.dark-mode .article-content th,
body.dark-mode .article-content td {
    border-color: #5A3A2E !important;
}

body.dark-mode .comments #disqus_thread {
    background: #1C1C1C !important;
    color: #F6F1E7 !important;
}

/* Cover Image */
.cover-image {
    position: relative;
    margin-bottom: 60px;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cover-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(90, 58, 46, 0.15);
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(28, 28, 28, 0.85), transparent);
    padding: 1.5rem;
    z-index: 1;
}

.cover-overlay h1 {
    color: #F6F1E7;
    font-size: 2.5rem;
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

body.dark-mode .cover-overlay h1 {
    color: #F6F1E7;
}

/* Category Name */
.category-name {
    text-align: center;
    margin: 1.5em 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.category-name span {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9rem;
    color: #5A3A2E;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

body.dark-mode .category-name span {
    color: #F6F1E7;
}

/* Article Content */
.article-content {
    background: rgba(255, 255, 255, 0.6);
    padding: 40px 30px;
    border: 1px solid rgba(90, 58, 46, 0.2);
    margin-bottom: 60px;
    margin-top: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 0;
}

body.dark-mode .article-content {
    background: rgba(28, 28, 28, 0.9);
    border-color: rgba(90, 58, 46, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 0;
}

.article-content h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #5A3A2E;
    margin-bottom: 1.5em;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

body.dark-mode .article-content h1 {
    color: #F6F1E7;
}

.author {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    font-style: italic;
    margin: 1.5em 0;
    color: #1C1C1C;
}

body.dark-mode .author {
    color: #F6F1E7;
}

.author-link {
    color: #2F3E5C;
    text-decoration: none;
    border-bottom: 1px solid rgba(47, 62, 92, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .author-link {
    color: #F6F1E7;
    border-bottom-color: rgba(246, 241, 231, 0.3);
}

.author-link:hover {
    color: #1C1C1C;
    border-bottom-color: #1C1C1C;
}

body.dark-mode .author-link:hover {
    color: #F6F1E7;
    border-bottom-color: #F6F1E7;
}

.abstract {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    color: #1C1C1C;
    border-left: 2px solid #5A3A2E;
    padding-left: 2em;
    margin: 2em 0;
    font-style: italic;
    line-height: 1.75;
}

body.dark-mode .abstract {
    color: #F6F1E7;
    border-left-color: #F6F1E7;
}

.meta {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    color: #6B6B6B;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5em 0;
}

body.dark-mode .meta {
    color: #F6F1E7;
}

.meta span {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.meta i {
    margin-right: 0.5rem;
    color: #5A3A2E;
    font-size: 0.85rem;
}

body.dark-mode .meta i {
    color: #F6F1E7;
}

/* Body Text */
.body {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #1C1C1C;
}

body.dark-mode .body {
    color: #F6F1E7;
}

.body p {
    margin: 1.5em 0;
}

.body h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #5A3A2E;
    margin: 2em 0 1em;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.body h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #5A3A2E;
    margin: 2em 0 1em;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

body.dark-mode .body h2,
body.dark-mode .body h3 {
    color: #F6F1E7;
}

/* Decorative Divider */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(90, 58, 46, 0.3) 20%, rgba(90, 58, 46, 0.3) 80%, transparent);
    margin: 40px 0;
    position: relative;
}

.divider::before {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #F6F1E7;
    padding: 0 12px;
    color: #5A3A2E;
    font-size: 0.7rem;
}

body.dark-mode .divider::before {
    background: #1C1C1C;
    color: #F6F1E7;
}

/* Author Box */
.author-box {
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border: 1px solid rgba(90, 58, 46, 0.2);
    margin: 40px 0;
}

body.dark-mode .author-box {
    background: rgba(28, 28, 28, 0.6);
    border-color: rgba(90, 58, 46, 0.3);
}

.author-box h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #5A3A2E;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

body.dark-mode .author-box h2 {
    color: #F6F1E7;
}

.author-box-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(90, 58, 46, 0.2);
}

.author-info {
    flex: 1;
}

.author-name a {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    color: #2F3E5C;
    text-decoration: none;
    border-bottom: 1px solid rgba(47, 62, 92, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .author-name a {
    color: #F6F1E7;
    border-bottom-color: rgba(246, 241, 231, 0.3);
}

.author-name a:hover {
    color: #1C1C1C;
    border-bottom-color: #1C1C1C;
}

body.dark-mode .author-name a:hover {
    color: #F6F1E7;
    border-bottom-color: #F6F1E7;
}

.author-bio {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9rem;
    color: #6B6B6B;
    margin: 0.5rem 0 0;
    line-height: 1.75;
}

body.dark-mode .author-bio {
    color: #F6F1E7;
}

/* Annotations and Citations */
.highlighted {
    background-color: rgba(90, 58, 46, 0.15);
    cursor: pointer;
}

body.dark-mode .highlighted {
    background-color: rgba(90, 58, 46, 0.4);
}

[data-citation] {
    cursor: pointer;
    border-bottom: 1px dotted #5A3A2E;
}

body.dark-mode [data-citation] {
    border-bottom-color: #F6F1E7;
}

.note-popup, .citation-popup {
    position: absolute;
    background: #FEFDFB;
    border: 1px solid rgba(90, 58, 46, 0.3);
    padding: 0.75rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 300px;
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    color: #1C1C1C;
    line-height: 1.75;
}

body.dark-mode .note-popup,
body.dark-mode .citation-popup {
    background: #2a2a2a;
    border-color: rgba(90, 58, 46, 0.4);
    color: #F6F1E7;
}

/* Blockquote */
blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    border-left: 2px solid #5A3A2E;
    background: rgba(255, 255, 255, 0.4);
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    color: #1C1C1C;
    line-height: 1.75;
}

body.dark-mode blockquote {
    background: rgba(28, 28, 28, 0.4);
    color: #F6F1E7;
    border-left-color: #F6F1E7;
}

/* Sections */
.references, .share-cite, .comments, .related {
    margin: 60px 0;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(90, 58, 46, 0.2);
}

body.dark-mode .references,
body.dark-mode .share-cite,
body.dark-mode .comments,
body.dark-mode .related {
    background: rgba(28, 28, 28, 0.6);
    border-color: rgba(90, 58, 46, 0.3);
}

.references h2, .share-cite h2, .comments h2, .related h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #5A3A2E;
    margin-bottom: 1.5em;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

body.dark-mode .references h2,
body.dark-mode .share-cite h2,
body.dark-mode .comments h2,
body.dark-mode .related h2 {
    color: #F6F1E7;
}

/* Share and Cite */
.share-cite {
    text-align: center;
}

.share-cite button, .share-cite a {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    margin: 0.5rem;
    border: 1px solid #2F3E5C;
    background: #2F3E5C;
    color: #F6F1E7;
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

body.dark-mode .share-cite button,
body.dark-mode .share-cite a {
    background: #F6F1E7;
    color: #1C1C1C;
    border-color: #F6F1E7;
}

.share-cite button:hover, .share-cite a:hover {
    background: #1C1C1C;
    border-color: #1C1C1C;
    color: #F6F1E7;
}

body.dark-mode .share-cite button:hover,
body.dark-mode .share-cite a:hover {
    background: #1C1C1C;
    border-color: #1C1C1C;
    color: #F6F1E7;
}

.share-cite .icon {
    margin-right: 0.5rem;
}

/* Table of Contents */
.toc {
    margin: 60px 0;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(90, 58, 46, 0.2);
}

body.dark-mode .toc {
    background: rgba(28, 28, 28, 0.6);
    border-color: rgba(90, 58, 46, 0.3);
}

.toc h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #5A3A2E;
    margin-bottom: 1.5em;
    letter-spacing: 0.5px;
}

body.dark-mode .toc h2 {
    color: #F6F1E7;
}

.toc-toggle {
    display: none;
    padding: 14px 32px;
    background: #2F3E5C;
    color: #F6F1E7;
    border: 1px solid #2F3E5C;
    cursor: pointer;
    margin-bottom: 1rem;
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

body.dark-mode .toc-toggle {
    background: #F6F1E7;
    color: #1C1C1C;
    border-color: #F6F1E7;
}

.toc-toggle:hover {
    background: #1C1C1C;
    border-color: #1C1C1C;
}

body.dark-mode .toc-toggle:hover {
    background: #1C1C1C;
    color: #F6F1E7;
}

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

.toc-list li {
    margin: 0.75rem 0;
}

.toc-list a {
    font-family: 'Libre Baskerville', serif;
    color: #2F3E5C;
    text-decoration: none;
    border-bottom: 1px solid rgba(47, 62, 92, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .toc-list a {
    color: #F6F1E7;
    border-bottom-color: rgba(246, 241, 231, 0.3);
}

.toc-list .toc-sub {
    margin-left: 1rem;
}

.toc-list a:hover {
    color: #1C1C1C;
    border-bottom-color: #1C1C1C;
}

body.dark-mode .toc-list a:hover {
    color: #F6F1E7;
    border-bottom-color: #F6F1E7;
}

/* Related Essays */
.related a {
    display: block;
    margin: 0.75rem 0;
    font-family: 'Libre Baskerville', serif;
    color: #2F3E5C;
    text-decoration: none;
    border-bottom: 1px solid rgba(47, 62, 92, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .related a {
    color: #F6F1E7;
    border-bottom-color: rgba(246, 241, 231, 0.3);
}

.related a:hover {
    color: #1C1C1C;
    border-bottom-color: #1C1C1C;
}

body.dark-mode .related a:hover {
    color: #F6F1E7;
    border-bottom-color: #F6F1E7;
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(90, 58, 46, 0.2);
    z-index: 1100;
}

body.dark-mode .reading-progress {
    background: rgba(90, 58, 46, 0.4);
}

#progress-bar {
    width: 100%;
    height: 100%;
    background: #5A3A2E;
    transition: value 0.2s;
}

body.dark-mode #progress-bar {
    background: #F6F1E7;
}

/* Back to Top */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1rem;
    background: #2F3E5C;
    color: #F6F1E7;
    border: 1px solid #2F3E5C;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
    font-family: 'Libre Baskerville', serif;
}

body.dark-mode .back-to-top {
    background: #F6F1E7;
    color: #1C1C1C;
    border-color: #F6F1E7;
}

.back-to-top.visible {
    display: block;
}

.back-to-top:hover {
    background: #1C1C1C;
    border-color: #1C1C1C;
    color: #F6F1E7;
}

body.dark-mode .back-to-top:hover {
    background: #1C1C1C;
    border-color: #1C1C1C;
    color: #F6F1E7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .toc {
        position: static;
        width: auto;
        max-height: none;
        overflow-y: visible;
        box-shadow: none;
    }
    .toc-toggle {
        display: block;
    }
    .toc-list {
        display: none;
    }
    .toc-list.active {
        display: block;
    }
}

@media (min-width: 1025px) {
    .toc {
        position: fixed;
        top: 120px;
        right: 2rem;
        width: 250px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        margin: 0;
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        z-index: 100;
        border: 1px solid rgba(90, 58, 46, 0.2);
    }
    body.dark-mode .toc {
        background: rgba(28, 28, 28, 0.9);
        border-color: rgba(90, 58, 46, 0.3);
    }
    .toc-toggle {
        display: none;
    }
    .toc-list {
        display: block !important;
    }
}

@media (max-width: 640px) {
    .main-content.view-article {
        padding: 20px 16px;
    }
    .article-content {
        padding: 20px 16px;
        max-width: 100%;
        margin-top: 20px;
    }
    .cover-image {
        margin-bottom: 40px;
    }
    .category-name span {
        font-size: 0.85rem;
    }
    .article-content h1 {
        font-size: 2rem;
    }
    .cover-overlay h1 {
        font-size: 2rem;
    }
    .abstract {
        font-size: 0.9rem;
    }
    .body {
        font-size: 1rem;
    }
    .body h2 {
        font-size: 1.5rem;
    }
    .body h3 {
        font-size: 1.2rem;
    }
    header {
        padding-top: 0;
    }
    .meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    .author-box-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-avatar {
        margin-bottom: 1rem;
    }
    .references, .share-cite, .comments, .related {
        padding: 20px 16px;
    }
}