/* ============================================= */
/* == ARTICLE DETAIL PAGE (FINAL, RESPONSIVE) == */
/* ============================================= */
.dark-mode { background-color: #0F172B; color: #cbd5e1; }
.dark-mode .header { background-color: #0F172B; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.dark-mode .header .logo-text, .dark-mode .header .nav-link, .dark-mode .header .bar { color: var(--color-light); }
.dark-mode .header.scrolled { background-color: #1e293b; }

/* --- 1. Main Layout & Breadcrumb --- */
.article-page-container { padding: 2.5rem 0; margin-top: var(--header-height); }
.breadcrumb-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.9rem; color: #94a3b8; }
.breadcrumb-nav a:hover { color: var(--color-light); }
.breadcrumb-nav .separator { color: #475569; }
.breadcrumb-nav .current-page { color: var(--color-light); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.article-layout-grid { display: grid; grid-template-columns: 300px 1fr; gap: 4rem; margin-top: 2rem; align-items: flex-start; }

/* --- 2. Sticky Sidebar / Table of Contents --- */
.sidebar-sticky { position: sticky; top: 110px; }
.toc-widget { background-color: #1e293b; border-radius: 0.5rem; padding: 1.5rem; }
.toc-title { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; color: var(--color-light); margin-bottom: 1rem; }
.toc-list { list-style: none; padding: 0; border-left: 2px solid #334155; }
.toc-list-item a { display: block; padding: 0.5rem 1.25rem; color: #cbd5e1; border-left: 2px solid transparent; margin-left: -2px; transition: all 0.2s ease; font-size: 0.95rem; }
.toc-list-item.level-3 a { padding-left: 2.25rem; }
.toc-list-item a:hover { color: var(--color-light); border-left-color: #475569; }
.toc-list-item.active a { color: var(--color-primary); border-left-color: var(--color-primary); font-weight: 600; background-color: rgba(16, 185, 129, 0.1); }

/* --- 3. Main Article Content --- */
.article-header { padding-bottom: 2rem; border-bottom: 1px solid #334155; }
.article-category-tag { display: inline-block; background-color: rgba(16, 185, 129, 0.1); color: var(--color-primary); border: 1px solid rgba(16, 185, 129, 0.3); padding: 5px 12px; border-radius: 50px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1rem; }
.article-header h1 { font-family: 'Lora', serif; font-size: 2.8rem; font-weight: 700; color: var(--color-light); line-height: 1.2; margin-bottom: 1rem; }
.article-header .excerpt { font-size: 1.2rem; color: #94a3b8; line-height: 1.6; margin-bottom: 1.5rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; color: #94a3b8; font-size: 0.9rem; }
.article-meta i { margin-right: 6px; }
.action-buttons { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.action-buttons button { background: transparent; border: 1px solid #475569; color: #cbd5e1; padding: 0.5rem 0.75rem; border-radius: 0.375rem; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; transition: background-color 0.2s; }
.action-buttons button:hover { background-color: #334155; }
.article-main-image { margin: 2rem 0; }
.article-main-image img { width: 100%; max-height: 500px; object-fit: cover; border-radius: 0.5rem; }
.tags-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.tag-item { border: 1px solid #475569; color: #94a3b8; padding: 4px 10px; border-radius: 50px; font-size: 0.8rem; }
.article-body { font-size: 1.1rem; line-height: 1.8; color: #cbd5e1; }
.article-body h2 { font-family: 'Lora', serif; font-size: 2rem; font-weight: 700; color: var(--color-light); margin: 2.5rem 0 1.5rem 0; padding-bottom: 0.5rem; border-bottom: 1px solid #334155; }
.article-body h3 { font-family: 'Lora', serif; font-size: 1.5rem; font-weight: 700; color: var(--color-light); margin: 2rem 0 1rem 0; }
.article-body p { margin-bottom: 1.5rem; }
.article-body a { color: var(--color-primary); font-weight: 600; text-decoration: underline; }
/* css/article-detail.css -- ADD THIS NEW SECTION */

/* --- STYLES FOR IMAGES EMBEDDED WITHIN THE ARTICLE CONTENT --- */
.article-image-container {
    margin: 2.5rem 0; /* Adds vertical space around the image */
    padding: 0;
}

.article-image-container img {
    max-width: 100%; /* Makes the image responsive */
    height: auto;    /* Maintains the aspect ratio */
    border-radius: 0.5rem; /* Matches your site's border-radius style */
    display: block;  /* Removes any extra space below the image */
    margin: 0 auto;  /* Centers the image if it's smaller than the container */
}

.article-image-container figcaption {
    font-size: 0.9rem;
    color: #94a3b8; /* A lighter color for the caption text */
    text-align: center;
    padding: 0.75rem 0.5rem 0 0.5rem; /* Space above the caption text */
    line-height: 1.5;
}

/* --- 4. Other Modules --- */
.author-bio-card { margin-top: 4rem; padding: 1.5rem; border: 1px solid #334155; background-color: #1e293b; border-radius: 0.5rem; display: flex; gap: 1.5rem; align-items: center; }
.author-bio-image { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-bio-content h4 { color: var(--color-primary); font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
.author-bio-content h3 { margin: 0 0 0.5rem 0; font-size: 1.25rem; color: var(--color-light); }
.author-bio-content p { margin: 0; font-size: 1rem; line-height: 1.6; color: #94a3b8; }

.stay-connected-cta { margin-top: 4rem; padding: 3rem; text-align: center; border-radius: 1rem; background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(0, 86, 179, 0.1)); border: 1px solid #334155; }
.cta-icon-wrapper { width: 60px; height: 60px; margin: 0 auto 1.5rem auto; background-color: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--color-primary); }
.stay-connected-cta h3 { font-size: 2rem; color: var(--color-light); margin-bottom: 1rem; }
.stay-connected-cta p { color: #94a3b8; max-width: 500px; margin: 0 auto 2rem auto; }
.stay-connected-cta .btn { display: inline-flex; align-items: center; gap: 0.5rem; }

.related-articles-section { margin-top: 4rem; padding-top: 4rem; border-top: 1px solid #334155; }
.related-articles-section h2 { font-size: 2rem; font-family: 'Lora', serif; color: var(--color-light); margin-bottom: 2rem; }
.related-articles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.related-article-card { display: block; background-color: #1e293b; border-radius: 0.5rem; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.related-article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.related-image-wrapper { position: relative; }
.related-image-wrapper img { width: 100%; height: 200px; object-fit: cover; }
.related-category-tag { position: absolute; top: 1rem; left: 1rem; background-color: rgba(15, 23, 43, 0.8); backdrop-filter: blur(4px); color: var(--color-light); padding: 5px 12px; border-radius: 50px; font-size: 0.8rem; font-weight: 600; }
.related-content { padding: 1.5rem; }
.related-content h3 { font-size: 1.1rem; line-height: 1.4; color: var(--color-light); margin-bottom: 0.75rem; height: 45px; overflow: hidden; }
.related-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #94a3b8; padding-top: 1rem; border-top: 1px solid #334155; }
.read-more-simple { font-weight: 600; color: var(--color-primary); }

/* --- On-Scroll Animation --- */
.fade-in-up { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.fade-in-up.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================= */
/* ========= 5. RESPONSIVE (CORRECTED) ========= */
/* ============================================= */

@media (max-width: 1024px) {
    /* --- Tablet and smaller --- */
    .article-layout-grid {
        grid-template-columns: 1fr; /* Stack sidebar and content */
    }
    .sidebar-sticky {
        position: static; /* Un-stick the sidebar */
        margin-bottom: 3rem;
        order: -1; /* Move sidebar to appear BEFORE the article body */
    }
    .article-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    /* --- Mobile --- */
    .dark-mode .header {
        /* On mobile, give the scrolled header a slightly more solid background */
        background-color: #1e293b;
    }
   .article-page-container {
        /* Adjust padding for mobile screens */
        padding: 1.5rem 15px; 
    }
    .breadcrumb-nav .current-page {
        /* Allow the current page title in breadcrumb to wrap if needed */
        white-space: normal;
        max-width: 100%;
    }
    .article-layout-grid {
        gap: 2rem; /* Reduce the gap between elements */
    }
    .article-header h1 {
        font-size: 1.8rem; /* Further reduce title size */
    }
    .article-header .excerpt {
        font-size: 1.1rem; /* Reduce excerpt size */
    }
    .article-meta {
        gap: 1rem; /* Reduce gap in meta info */
    }
    .article-body {
        font-size: 1.05rem; /* Slightly smaller body font for better readability */
        line-height: 1.8;
    }
    .article-body h2 {
        font-size: 1.5rem;
    }
    .article-body h3 {
        font-size: 1.3rem;
    }
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}