/* ==========================================================================
   view_article.css - LinkedIn-Style Article View & Sidebar Styling
   ========================================================================== */

:root {
    --bg-main: #f4f6f9;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-muted: #4b5563;
    --accent-blue: #0A66C2; /* LinkedIn Professional Blue Accent */
    --border-color: #e5e7eb;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    font-family: var(--font-body);
    color: var(--text-primary);
    margin: 0;
    padding-top: 90px; /* Space for fixed site-header */
    padding-bottom: 0;   /* Clean desktop bottom spacing */
}

/* Main Grid Layout */
.article-main-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.article-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* --------------------------------------------------------------------------
   LEFT COLUMN: LinkedIn-Style Article Card
   -------------------------------------------------------------------------- */
.linkedin-article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.article-top-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-category-badge {
    background: rgba(10, 102, 194, 0.08);
    color: var(--accent-blue);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-dot {
    color: var(--border-color);
}

.article-main-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    line-height: 1.3;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.article-featured-image {
    width: 100%;
    height: 380px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #e2e8f0;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.article-body-text .lead-paragraph {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.article-body-text h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-body-text p {
    margin-bottom: 1.25rem;
}

/* Author Footer inside LinkedIn Card */
.article-author-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 1.2rem;
    border: 1px solid var(--border-color);
}

.author-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem 0;
}

.author-date-info {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   RIGHT COLUMN: Recent Insights Sidebar Cards (Matching Reference Image)
   -------------------------------------------------------------------------- */
.article-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.recent-insights-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-insight-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem;
    text-decoration: none;
    transition: all 0.25s ease;
}

.sidebar-insight-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.08);
    transform: translateY(-2px);
}

.insight-card-img {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e2e8f0;
}

.insight-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.insight-card-text {
    flex-grow: 1;
    min-width: 0;
}

.insight-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.insight-card-header h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.small-arrow {
    width: 24px;
    height: 24px;
    background: #f0f4f8;
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.sidebar-insight-card:hover .small-arrow {
    background: var(--accent-blue);
    color: #ffffff;
}

.insight-card-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints & Mobile Fixes
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .article-grid-layout {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    body {
        padding-bottom: 50px; /* Perfectly aligns body edge with fixed navigation bar */
        overflow-x: hidden;  /* Prevent horizontal scrolling/whitespace */
    }

    .site-header {
        padding: 0.5rem 0.75rem; /* Prevents header elements from overflowing */
    }

    .brand-logo {
        gap: 0.4rem;
    }

    .brand-text {
        font-size: 0.95rem; /* Shrinks title slightly to fit small 320px screens */
    }

    .header-actions {
        gap: 0.4rem;
    }

    .btn-mobile-call {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        padding: 0.4rem;
    }

    .linkedin-article-card {
        padding: 1.25rem;
    }
    .article-main-title {
        font-size: 1.75rem;
    }
    .article-featured-image {
        height: 240px;
    }

    .article-main-container {
        padding: 1rem 0.75rem; /* Tighten container padding */
    }

    .sidebar-widget {
        padding: 1rem;
        border-radius: 8px;
    }

    .footer-container {
        padding: 0 1rem; /* Ensure footer contents stay nicely within bounds */
        margin-bottom: 0;
    }
}

/* ==========================================
   VIEW ARTICLE RESPONSIVE STYLES
   ========================================== */

/* Base Layout Container */
.article-main-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.article-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.article-main-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0; /* Prevents flex items from overflowing grid */
}

/* LinkedIn-Style Article Card */
.linkedin-article-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.article-top-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #666;
}

.article-category-badge {
    background: rgba(0, 86, 179, 0.1);
    color: var(--accent-blue, #0056b3);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-main-title {
    font-family: 'Cinzel', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
    margin-bottom: 20px;
}

.article-featured-image {
    width: 100%;
    max-height: 450px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
}

.article-body-text p {
    margin-bottom: 20px;
}

.article-author-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue, #0056b3);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.author-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 2px;
}

.author-date-info {
    font-size: 0.8rem;
    color: #666;
}

/* Sidebar Widgets */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.recent-insights-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-insight-card {
    display: flex;
    gap: 12px;
    text-decoration: none;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
    transition: opacity 0.2s ease;
}

.sidebar-insight-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-insight-card:hover {
    opacity: 0.8;
}

.insight-card-img {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

.insight-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.insight-card-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.insight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.insight-card-header h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.small-arrow {
    color: #888;
    font-size: 0.7rem;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.insight-card-text p {
    font-size: 0.75rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Related Articles Section */
.related-articles-section {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.related-section-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-article-card {
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.related-card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #eee;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card:hover .related-card-image img {
    transform: scale(1.05);
}

.related-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-card-meta {
    margin-bottom: 8px;
}

.rel-category {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-blue, #0056b3);
    letter-spacing: 0.5px;
}

.related-card-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 12px;
    flex-grow: 1;
}

.related-card-date {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    color: #666;
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES FOR SMALL DEVICES
   ========================================== */

/* Tablets and Below (Width <= 992px) */
@media (max-width: 992px) {
    .article-grid-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        order: 3; /* Push sidebar below related articles on smaller screens if desired, or keep structure */
    }

    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Devices and Small Screens (Width <= 768px) */
@media (max-width: 768px) {
    .article-main-container {
        padding: 0 12px;
        margin: 20px auto;
    }

    .linkedin-article-card,
    .related-articles-section,
    .sidebar-widget {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .article-main-title {
        font-size: 1.6rem;
    }

    .article-body-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .related-articles-grid {
        grid-template-columns: 1fr; /* Stack related articles vertically on phones */
    }

    .related-card-image {
        height: 160px; /* Slightly taller thumbnail when stacked single-column */
    }

    .article-top-meta {
        font-size: 0.75rem;
    }
}