/* Blog Page Styles - Premium Redesign */

/* =========================================
   1. Shared & Utilities
   ========================================= */
:root {
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    /* Using Inter for body too as per modern trends, or Georgia if strictly editorial */
    --color-text-main: #1f2933;
    --color-text-muted: rgba(255, 255, 255, 0.8);
    --color-accent: #2563eb;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   2. Blog Listing (blog.php)
   ========================================= */

/* Hero Section */
.hero.hero-compact {
    min-height: 50vh;
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #cbebff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-compact .hero-title {
    font-size: 3.5rem;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-compact .hero-subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: #556;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile Adjustments for Blog Listing */
@media (max-width: 768px) {
    .hero.hero-compact {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

    .hero-compact .hero-title {
        font-size: 2.2rem;
    }

    .hero-compact .hero-subtitle {
        font-size: 1rem;
    }
}


/* =========================================
   3. Blog Post (blog-post.php) - REDESIGNED
   ========================================= */

/* Navigation Bar Polish */
.header.sticky {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Reading Progress Bar */
#reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

#reading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-accent);
    transition: width 0.1s;
}

/* Article Header / Hero */
.article-header {
    position: relative;
    padding: 12rem 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #fff;
    text-align: left;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Strong dark gradient overlay */
    background: linear-gradient(to right, rgba(15,23,42,0.92) 40%, rgba(15,23,42,0.70) 100%);
    z-index: 2;
}

.header-content-wrapper {
    position: relative;
    z-index: 3;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* Glass Container for Headline */
.glass-container {
    backdrop-filter: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    text-align: left;
    border: none;
    box-shadow: none;
}



/* Category Badge */
.category-tag {
    background: rgba(30, 64, 175, 0.9);
    /* Deep Blue */
    color: white;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    margin-bottom: 24px;
    display: inline-block;
    backdrop-filter: blur(4px);
}

/* Article Title */
.article-title {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.04em;
    color: #f8fafc !important;
    text-shadow: none;
    margin-bottom: 2rem;
    max-width: 900px;
}

/* Meta Row */
.meta-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 1.125rem;
    color: #94a3b8;
    font-weight: 400;
}

.meta-divider {
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Article Layout Container */
.article-layout-container {
    max-width: 820px;
    /* Constraint: 820px */
    margin: -100px auto 80px;
    /* Overlap hero */
    position: relative;
    z-index: 10;
    padding: 0;
}

/* Article Body Container */
.article-body {
    background: #ffffff;
    padding: 48px 56px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.75;
    color: #1f2933;
    margin-bottom: 0;
    /* Container handles it */
}

/* Typography inside Article Body */
.article-body p {
    margin-bottom: 28px;
    /* Increase vertical spacing */
}

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 24px;
    color: #111;
    position: relative;
    padding-left: 20px;
}

/* Accent Bar for H2 */
.article-body h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 24px;
    background-color: var(--color-accent);
    border-radius: 2px;
}

.article-body h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 16px;
    color: #1f2933;
}

.article-body ul,
.article-body ol {
    margin-bottom: 28px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 12px;
    padding-left: 8px;
}

.article-body blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 16px 24px;
    margin: 32px 0;
    background: #f8fafc;
    font-style: italic;
    font-size: 20px;
    color: #334155;
    border-radius: 0 12px 12px 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Article Footer / Share */
.article-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Sidebar - Hidden or Moved */
/* Note: Since user asked for "Center the container / Max width 820px",
   a sidebar usually doesn't fit well alongside 820px unless the screen is huge.
   I will adapt the PHP to possibly move related posts to the bottom.
   For now, I'll style it as a "Bottom Section" just in case. */
.blog-sidebar {
    margin-top: 60px;
}

.related-posts-section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.related-post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.related-image {
    height: 180px;
    width: 100%;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-cat {
    color: var(--color-accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.related-post-card h5 {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: var(--font-heading);
}

.related-date {
    margin-top: auto;
    font-size: 12px;
    color: #888;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .article-header {
        padding: 8rem 0 6rem;
    }

    .glass-container {
        padding: 0;
        width: 100%;
    }

    .article-title {
        font-size: clamp(2.5rem, 5vw, 3.5rem);
        /* Mobile size */
    }

    .article-layout-container {
        margin: -60px 16px 60px;
        /* Margin side 16px */
        width: auto;
    }

    .article-body {
        padding: 32px 24px;
        /* Reduced mobile padding */
        font-size: 17px;
    }

    .back-link-wrapper {
        top: 90px;
        left: 20px;
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 28px;
    }

    .meta-bottom {
        flex-direction: column;
        gap: 8px;
    }

    .meta-divider {
        display: none;
    }
}