/*-----------------------------------*\ 
  #Blogs-Details
\*-----------------------------------*/

/* --- Reset & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary: #E21B3C;
    --primary-hover: #C1122F;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --text-body: #334155;
    --bg-light: #F8FAFC;
    --border-color: #E2E8F0;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header Navigation --- */
header {
    border-bottom: 1px solid var(--border-color);
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    position: relative;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    z-index: 1001;
}

.logo span {
    color: var(--primary);
}

.logo svg {
    margin-right: 8px;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.login-btn {
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.join-btn {
    background-color: var(--primary);
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.join-btn:hover {
    background-color: var(--primary-hover);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    z-index: 1001;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

/* --- Main Layout Grid --- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    margin-bottom: 60px;
    align-items: start;
}

/* --- Left Column: Article Content --- */
.article-main {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.article-top-wrapper {
    padding: 36px 10px 10px 26px;
}

.article-body-wrapper {
    padding: 32px 48px 48px 48px;
}

.article-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #FFF1F2;
    color: var(--primary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.article-header h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.author-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748B;
    font-size: 16px;
}

.author-details strong {
    display: block;
    color: var(--text-dark);
    font-size: 15px;
    margin-bottom: 2px;
}

.author-details span {
    color: var(--text-muted);
    font-size: 14px;
}

.share-actions {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    background: var(--bg-light);
}

.share-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #FFF;
}

.article-hero-img {
    width: 100%;
    min-height: 360px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 36px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.article-hero-img img {
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- Typography & Content Formatting (Refined Reading Experience) --- */
.article-header,
.article-content,
.author-bio-box {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Neutralize global .blog-content class rules when inside article */
.article-content .blog-content {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* 1. Content Alignment */
.article-content,
.article-content .blog-content,
.article-content p,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6,
.article-content ul,
.article-content ol,
.article-content li,
.article-content blockquote,
.article-content pre,
.article-content table {
    text-align: left;
}

/* 4. Paragraph Spacing */
.article-content p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-body);
    margin-top: 0;
    margin-bottom: 10px;
}

/* 5. Heading Spacing & Vertical Rhythm */
.article-content h1 {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 16px 0;
    line-height: 1.25;
}

.article-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 16px 0;
    line-height: 1.25;
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 16px 0;
    line-height: 1.25;
}

.article-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 14px 0;
    line-height: 1.25;
}

.article-content h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 12px 0;
    line-height: 1.25;
}

.article-content h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark) !important;
    font-family: 'Inter', sans-serif !important;
    margin: 20px 0 12px 0;
    line-height: 1.25;
}

.article-content>*:first-child,
.article-content .blog-content>*:first-child {
    margin-top: 0 !important;
}

/* 6. Image Spacing */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 36px 0;
    border: 1px solid var(--border-color);
}

/* 7 & 8. Bullet and Numbered Lists */
.article-content ul,
.article-content ol {
    margin-top: 0;
    margin-bottom: 28px;
    padding-left: 28px;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 12px;
    padding-left: 6px;
}

.article-content li:last-child {
    margin-bottom: 0;
}

.article-content li::marker {
    color: var(--primary);
    font-weight: 600;
}

/* Nested Lists */
.article-content ul ul,
.article-content ul ol,
.article-content ol ul,
.article-content ol ol {
    margin-top: 12px;
    margin-bottom: 12px;
    padding-left: 24px;
}

/* 9. Blockquotes */
.article-content blockquote {
    margin: 36px 0;
    padding: 24px 32px;
    background: #F8FAFC;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 20px;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.6;
}

.article-content blockquote p {
    margin-bottom: 14px;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 10. Tables */
.article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 36px 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content th,
.article-content td {
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    line-height: 1.6;
    font-size: 16px;
    color: var(--text-body);
}

.article-content th {
    background: #F8FAFC;
    font-weight: 600;
    color: var(--text-dark);
}

/* 11. Code Blocks */
.article-content pre {
    background: #0F172A;
    color: #F8FAFC;
    padding: 20px 24px;
    border-radius: 8px;
    margin: 36px 0;
    overflow-x: auto;
    font-family: monospace;
    font-size: 15px;
    line-height: 1.6;
    max-width: 100%;
}

.article-content code {
    font-family: monospace;
    font-size: 0.9em;
    background: #F1F5F9;
    color: var(--text-dark);
    padding: 3px 6px;
    border-radius: 4px;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* Author Bio Box Bottom */
.author-bio-box {
    margin-top: 48px;
    padding: 32px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.bio-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #CBD5E1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.bio-content h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.bio-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.bio-content a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

/* --- Related Articles Section --- */
.related-section {
    margin-bottom: 80px;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.related-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 32px;
    letter-spacing: -0.3px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px;
}

.related-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08);
}

.related-card-img {
    height: 180px;
    background: linear-gradient(135deg, #1E293B 0%, #475569 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.related-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-card-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.related-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.related-card:hover .related-card-title {
    color: var(--primary);
}

.related-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-meta {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Right Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: -webkit-sticky;
    position: sticky;
    top: 96px;
    top: min(96px, calc(100vh - 100% - 24px));
    height: fit-content;
    align-self: start;
}

.sidebar-widget {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Widget */
.widget-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    background: var(--bg-light);
}

.widget-search input:focus {
    border-color: var(--primary);
    background: #FFF;
}

/* TOC Widget */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
}

.toc-list a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    display: block;
    transition: 0.2s;
}

.toc-list a:hover {
    color: var(--primary);
}

.toc-list a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Popular Posts Widget */
.popular-post-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    text-decoration: none;
}

.popular-post-item:last-child {
    margin-bottom: 0;
}

.popular-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    background: #E2E8F0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popular-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    transition: 0.2s;
}

.popular-post-item:hover .popular-title {
    color: var(--primary);
}

.popular-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, #0F172A 0%, #1e293b 100%);
    color: #FFFFFF;
    text-align: center;
}

.cta-widget .widget-title {
    color: #FFFFFF;
    justify-content: center;
    border-bottom: none;
    margin-bottom: 12px;
    font-size: 20px;
}

.cta-widget p {
    font-size: 14px;
    color: #94A3B8;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cta-btn {
    display: inline-block;
    background: var(--primary);
    color: #FFF;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    transition: 0.2s;
}

.cta-btn:hover {
    background: var(--primary-hover);
}

/* --- Footer --- */
footer {
    background: linear-gradient(to bottom right, #36454F, #001A40);
    color: #94A3B8;
    padding: 80px 0 40px 0;
    font-size: 15px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 60px;
    margin-bottom: 20px;
}

.footer-brand .logo {
    color: #FFFFFF;
    margin-bottom: 20px;
    display: inline-flex;
}

.footer-brand p {
    line-height: 1.6;
    color: #94A3B8;
    max-width: 300px;
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #112240;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    text-decoration: none;
    transition: 0.2s;
}

.social-link:hover {
    background-color: var(--primary);
    color: #FFFFFF;
}

.footer-col h4 {
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-col ul a {
    color: #94A3B8;
    text-decoration: none;
    transition: 0.2s;
}

.footer-col ul a:hover {
    color: #FFFFFF;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.newsletter-form input {
    flex: 1;
    background-color: #112240;
    border: 1px solid #1E293B;
    padding: 12px 16px;
    border-radius: 6px;
    color: #FFFFFF;
    outline: none;
    font-size: 14px;
}

.newsletter-form button {
    background-color: var(--primary);
    color: #FFFFFF;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.newsletter-form button:hover {
    background-color: var(--primary-hover);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #64748B;
    padding-top: 20px;
    border-top: 1px solid #1E293B;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px;
    }

    .article-hero-img {
        min-height: 280px;
        padding: 20px 24px;
    }

    .article-top-wrapper {
        padding: 32px 32px 24px 32px;
    }

    .article-body-wrapper {
        padding: 24px 32px 32px 32px;
    }

    .article-header h1 {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .nav-container { flex-wrap: wrap; height: auto; min-height: 72px; padding-top: 14px; padding-bottom: 14px; position: relative; }
    .logo { order: 1; }
    .menu-toggle { display: block; order: 2; }
    .nav-links { display: none; width: 100%; order: 3; position: static; margin-top: 16px; flex-direction: column; gap: 16px; border-top: 1px solid var(--border-color); padding: 20px 0 12px 0; box-shadow: none; }
    .nav-actions { display: none; width: 100%; order: 4; position: static; margin-top: 0; flex-direction: column; gap: 12px; padding: 0 0 16px 0; border-bottom: 1px solid var(--border-color); box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.06); }
    .nav-actions .join-btn, .nav-actions .login-btn { text-align: center; width: 100%; display: block; padding: 12px 20px; }
    .mobile-nav-active .nav-links, .mobile-nav-active .nav-actions { display: flex; }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .author-bio-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 16px;
    }

    .article-top-wrapper {
        padding: 20px 20px 16px 20px;
    }

    .article-body-wrapper {
        padding: 16px 20px 20px 20px;
    }

    .article-header h1 {
        font-size: 28px;
        margin: 32px 0 16px 0;
    }

    .article-content p,
    .article-content li {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .article-content h2 {
        font-size: 24px;
        margin: 36px 0 16px 0;
    }

    .article-content h3 {
        font-size: 20px;
        margin: 28px 0 14px 0;
    }

    .article-content ul,
    .article-content ol {
        padding-left: 22px;
        margin-bottom: 24px;
    }

    .article-content blockquote {
        padding: 18px 20px;
        margin: 28px 0;
        font-size: 18px;
    }

    .article-content img {
        margin: 24px 0;
    }

    .article-hero-img {
        min-height: 200px;
        padding: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .newsletter-form {
        flex-direction: column;
    }
}