/* --- BLOG PREMIUM DESIGN --- */

/* Force transparency on layout containers */
.blog-hero .container,
.category-bar .container,
.section-pad .container,
.header .container,
.post-hero .container,
.post-layout,
.post-body-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.blog-hero {
    position: relative;
    padding: 80px 0 60px;
    /* Reduced from 120px */
    text-align: center;
    background: var(--bg-primary);
    overflow: hidden;
    /* Add a subtle center glow to highlight text */
    background: radial-gradient(circle at center, #0f172a 0%, #050505 100%);
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    /* Reduced from 40px */
    opacity: 0.5;
    z-index: 0;
}

.blog-hero .container {
    position: relative;
    z-index: 10;
}

.blog-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    /* Reduced from 2.5rem-4rem */
    margin-bottom: 15px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text-primary) !important;
    text-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    font-weight: 900;
}

.blog-hero p {
    color: #e2e8f0 !important;
    max-width: 550px;
    /* Reduced from 650px */
    margin: 0 auto;
    font-size: 1rem;
    /* Reduced from 1.15rem */
    line-height: 1.5;
    /* Reduced from 1.6 */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Base Headings & Text visibility fix */
.blog-featured-card h3,
.blog-card h3,
.category-flex h2,
.post-title,
.toc-wrapper h4,
.blog-hero h1 {
    color: #ffffff !important;
}

.text-highlight {
    color: var(--accent) !important;
    -webkit-text-fill-color: initial !important;
    background: transparent !important;
    text-shadow: 0 0 12px rgba(225, 29, 72, 0.3);
    font-size: 0.9rem;
    /* Reduced */
}

/* Category Bar */
.category-bar {
    padding: 15px 0;
    /* Reduced from 20px */
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 35px;
    /* Reduced from 50px */
    background: transparent !important;
}

.category-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.category-flex h2 {
    font-size: 0.75rem;
    /* Reduced from 0.85rem */
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted) !important;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    padding: 6px 14px;
    /* Reduced from 8x18 */
    border-radius: 50px;
    font-size: 0.75rem;
    /* Reduced from 0.8 */
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.category-tag:hover {
    background: rgba(225, 29, 72, 0.1);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Featured Blog Card */
.blog-featured-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    /* Reduced from 40px */
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px;
    /* Reduced from 24 */
    padding: 30px;
    /* Reduced from 40 */
    margin-bottom: 40px;
    /* Reduced from 60 */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.blog-featured-card:hover {
    border-color: var(--accent) !important;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.featured-img-wrapper {
    width: 100%;
    height: 280px;
    /* Reduced from 420px (~33%) */
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.featured-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-featured-card:hover .featured-img-wrapper img {
    transform: scale(1.08);
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge-featured {
    background: rgba(225, 29, 72, 0.15);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    /* Reduced */
    font-weight: 700;
    margin-bottom: 15px;
    /* Reduced */
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(225, 29, 72, 0.2);
}

.blog-featured-card h3 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    /* Reduced from 1.8-2.5 */
    line-height: 1.2;
    margin-bottom: 12px;
    transition: 0.3s;
}

.blog-featured-card:hover h3 {
    color: var(--accent) !important;
}

.blog-featured-card p {
    color: var(--text-muted) !important;
    font-size: 0.95rem;
    /* Reduced from 1.05 */
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Reduced from 320 */
    gap: 20px;
    /* Reduced from 30 */
}

.blog-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    /* Reduced from 20 */
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.blog-card:hover {
    border-color: var(--accent) !important;
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.blog-card-img {
    height: 160px;
    /* Reduced from 230px (~30%) */
    background: #050505;
    overflow: hidden;
    /* Add a subtle center glow to highlight text */
    background: radial-gradient(circle at center, #0f172a 0%, #050505 100%);
    border-bottom: 1px solid var(--border-color);
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.15);
}

.blog-card-body {
    padding: 18px;
    /* Reduced from 28 */
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-category-label {
    font-size: 0.65rem;
    /* Reduced */
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.blog-card h3 {
    font-size: 1.15rem;
    /* Reduced from 1.4 */
    line-height: 1.3;
    margin-bottom: 10px;
    transition: 0.3s;
}

.blog-card:hover h3 {
    color: var(--accent) !important;
}

.blog-card p {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    /* Reduced from 0.95 */
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Reduced from 3 */
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* Placeholder styles */
.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-placeholder i {
    color: #1e293b;
}

/* Empty State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    /* Reduced from 100 */
}

.no-results i {
    color: var(--border-color);
    margin-bottom: 15px;
}

.no-results h3 {
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-muted);
}

/* Author Info */
.author-meta {
    margin-top: auto;
    padding-top: 15px;
    /* Reduced */
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    /* Reduced from 38 */
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

.author-avatar.accent-bg {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.author-info p {
    margin: 0;
    font-size: 0.8rem;
    /* Reduced from 0.9 */
    font-weight: 700;
    color: var(--text-primary) !important;
}

.author-info span {
    font-size: 0.65rem;
    /* Reduced from 0.75 */
    color: var(--text-muted) !important;
}

/* Responsive Listing */
@media (max-width: 1100px) {
    .blog-featured-card {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .featured-img-wrapper {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .category-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-hero {
        padding: 60px 0 40px;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Reading Progress Bar --- */
.reading-progress-container {
    position: fixed;
    top: 60px;
    /* Adjusted for tighter header */
    left: 0;
    width: 100%;
    height: 3px;
    /* Reduced from 4 */
    background: transparent;
    z-index: 1001;
}

.reading-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.5);
    transition: width 0.1s ease;
}

/* --- Post Page Styles (Enhanced - Compacted) --- */

.post-page {
    background: #050505 !important;
    min-height: 100vh;
}

.post-hero {
    padding: 110px 0 40px !important;
    /* Reduced from 160 */
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.post-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 70px;
    /* Reduced from 100 */
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
}

.post-breadcrumb {
    font-size: 0.75rem;
    /* Reduced */
    color: var(--text-muted) !important;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-breadcrumb a {
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: 700;
}

.post-breadcrumb span {
    opacity: 0.7;
}

.post-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem) !important;
    /* Reduced from 2.5-4.8 */
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 900;
    letter-spacing: -2px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

.post-meta-top {
    display: flex;
    gap: 25px;
    /* Reduced from 40 */
    font-size: 0.85rem;
    /* Reduced from 1rem */
    color: var(--text-muted) !important;
    flex-wrap: wrap;
    font-weight: 600;
}

.meta-item i {
    margin-right: 8px;
    color: var(--accent) !important;
}

.post-featured-img {
    background: var(--bg-primary) !important;
    padding: 10px 0 40px;
}

.post-featured-img img {
    width: 100%;
    max-height: 480px;
    /* Reduced from 700px (~30%) */
    object-fit: cover;
    border-radius: 25px;
    /* Reduced from 40 */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
}

/* 2-Column Layout Refinement (Compacted) */
.post-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    /* Reduced from 350px */
    gap: 50px !important;
    /* Reduced from 100px */
    align-items: start;
    max-width: 1100px !important;
    /* Reduced from 1400 */
    margin: 0 auto;
}

.post-sidebar {
    position: sticky;
    top: 100px;
    /* Adjusted */
    z-index: 10;
}

.toc-wrapper {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px;
    padding: 25px;
    /* Reduced from 40 */
    backdrop-filter: blur(30px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.toc-wrapper h4 {
    font-size: 0.65rem;
    /* Reduced */
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 800;
    color: var(--text-primary) !important;
}

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

.toc-item {
    margin-bottom: 15px;
    /* Reduced from 22 */
}

.toc-item a {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    /* Reduced */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
    display: block;
    text-decoration: none !important;
    font-weight: 500;
}

.toc-item a:hover {
    color: var(--accent) !important;
    transform: translateX(8px);
}

.toc-h3 {
    padding-left: 18px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Post Content Typography (Compacted) */
.post-body-wrapper {
    max-width: 720px;
    /* Reduced from 850 */
}

.post-entry-content {
    color: #e2e8f0 !important;
    font-size: 1.1rem !important;
    /* Reduced from 1.35rem (~20%) */
    line-height: 1.7 !important;
    /* Reduced from 2.0 */
    font-weight: 400;
}

.post-entry-content h2 {
    color: var(--text-primary) !important;
    font-size: clamp(1.5rem, 3vw, 2rem) !important;
    /* Reduced from 2-3 */
    margin-top: 50px !important;
    margin-bottom: 25px !important;
    scroll-margin-top: 100px;
    font-weight: 900;
    letter-spacing: -1px;
}

.post-entry-content h3 {
    color: var(--text-primary) !important;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem) !important;
    /* Reduced from 1.6-2.4 */
    margin-top: 40px !important;
    margin-bottom: 20px !important;
    scroll-margin-top: 100px;
    font-weight: 800;
}

.post-entry-content p {
    margin-bottom: 25px !important;
    /* Reduced */
}

.post-entry-content ul,
.post-entry-content ol {
    margin-bottom: 25px !important;
    padding-left: 25px !important;
}

.post-entry-content li {
    margin-bottom: 12px !important;
    position: relative;
}

.post-entry-content ul li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.post-entry-content blockquote {
    background: rgba(225, 29, 72, 0.05) !important;
    border-left: 4px solid var(--accent) !important;
    padding: 30px !important;
    /* Reduced from 50 */
    margin: 40px 0 !important;
    /* Reduced from 70 */
    border-radius: 0 20px 20px 0;
    font-style: italic;
    color: var(--text-primary) !important;
    font-size: 1.25rem !important;
    /* Reduced from 1.6 */
    line-height: 1.5;
    position: relative;
}

.post-entry-content blockquote::before {
    content: '"';
    position: absolute;
    top: 5px;
    left: 15px;
    font-size: 3rem;
    /* Reduced from 5 */
    color: var(--accent);
    opacity: 0.2;
    font-family: serif;
}

.post-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.post-footer {
    margin-top: 60px;
    /* Reduced from 120 */
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
    /* Reduced */
}

.post-share h5 {
    color: var(--text-primary) !important;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.share-links {
    display: flex;
    gap: 12px;
}

.share-btn {
    width: 40px;
    /* Reduced from 55 */
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted) !important;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    text-decoration: none !important;
    font-size: 1rem;
    /* Reduced */
}

.share-btn:hover {
    background: var(--accent);
    color: white !important;
    transform: translateY(-5px) rotate(5deg);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(225, 29, 72, 0.3);
}

/* Error Page Block */
.error-page-theme {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 30px;
}

.error-icon {
    font-size: 4rem;
    /* Reduced from 6 */
    color: var(--accent);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(225, 29, 72, 0.4));
}

.error-page-theme h1 {
    margin-bottom: 12px;
    font-size: 1.8rem;
}

.error-page-theme p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 450px;
    margin-bottom: 30px;
}

/* Responsive Post */
@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .post-sidebar {
        display: none;
    }

    .post-body-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .post-hero {
        padding: 100px 0 40px !important;
    }

    .post-title {
        letter-spacing: -1px;
    }

    .post-meta-top {
        gap: 15px;
        font-size: 0.8rem;
    }

    .post-entry-content {
        font-size: 1rem !important;
    }
}