/* =========================================
   CheckPrintPro Blog Styles
   ========================================= */

/* ------ Blog Hero ------ */
.blog-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 5rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 70% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
}

.blog-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    padding: 0.35rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.blog-hero p {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ------ Blog Layout ------ */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
    padding: 3.5rem 0 5rem;
}

@media (max-width: 900px) {

    /* Blog index layout */
    .blog-layout {
        grid-template-columns: 1fr;
        padding: 2rem 1rem 3rem;
        gap: 2rem;
    }

    .blog-sidebar {
        order: 2;
        /* keep articles first, sidebar below on mobile */
        position: static;
    }

    /* Hero: reduce padding and add horizontal breathing room */
    .blog-hero {
        padding: 3.5rem 1rem 2rem;
    }

    .blog-hero h1 {
        font-size: clamp(1.7rem, 6vw, 2.5rem);
    }

    .blog-hero p {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    /* Article cards */
    .article-card-body {
        padding: 1.25rem;
    }

    .article-card h2 {
        font-size: 1.15rem;
    }
}

/* ------ Article Cards (Index) ------ */
.article-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.article-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border-color: rgba(59, 130, 246, 0.3);
}

.article-card-body {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.article-tag {
    display: inline-block;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.article-date {
    color: #64748b;
    font-size: 0.82rem;
}

.reading-time {
    color: #64748b;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reading-time::before {
    content: '·';
}

.article-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.article-card h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.article-card h2 a:hover {
    color: #60a5fa;
}

.article-excerpt {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1.25rem;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 0.2s, color 0.2s;
    margin-top: auto;
    width: fit-content;
}

.read-more-link:hover {
    gap: 0.7rem;
    color: #60a5fa;
}

.read-more-link .arrow {
    font-size: 1.1rem;
    line-height: 1;
}

/* ------ Sidebar ------ */
.blog-sidebar {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.category-list li a:hover {
    color: #60a5fa;
}

.category-count {
    background: rgba(255, 255, 255, 0.07);
    color: #64748b;
    border-radius: 100px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
}

.cta-widget {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    border: none;
    text-align: center;
}

.cta-widget h3 {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.cta-widget p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.cta-widget .btn-white {
    display: inline-block;
    background: #fff;
    color: #1d4ed8;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-widget .btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ------ Blog Post (Article Page) ------ */
.post-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 4.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.post-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 55%);
    pointer-events: none;
}

.post-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #60a5fa;
}

.breadcrumb-sep {
    color: #334155;
}

.post-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.post-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-info .article-tag {
    font-size: 0.75rem;
}

.post-author {
    color: #94a3b8;
    font-size: 0.88rem;
}

.post-date,
.post-reading-time {
    color: #64748b;
    font-size: 0.85rem;
}

/* ------ Post Content Area ------ */
.post-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 3rem;
    align-items: start;
    padding: 3rem 1.5rem 5rem;
    max-width: 1100px;
    margin: 0 auto;
    background: #0f172a;
}

/* Ensure the full article page background is dark */
body:has(.post-prose) {
    background: #0f172a;
}

@media (max-width: 900px) {

    /* Article page layout */
    .post-content-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem 1rem 3.5rem;
        gap: 2rem;
    }

    .post-toc-sidebar {
        display: none;
        /* TOC hidden on mobile to save space */
    }

    /* Article hero */
    .post-hero {
        padding: 3rem 0 2rem;
    }

    .post-hero-inner {
        padding: 0 1rem;
    }

    .post-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2.25rem);
    }

    /* Breadcrumb: allow wrapping on small screens */
    .breadcrumb {
        font-size: 0.78rem;
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }

    /* Prose body */
    .post-prose {
        font-size: 0.97rem;
        max-width: 100%;
    }

    .post-prose h2 {
        font-size: 1.25rem;
    }

    .post-prose h3 {
        font-size: 1.05rem;
    }

    /* Tables: allow horizontal scroll instead of overflowing */
    .post-prose table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tip box: tighten padding */
    .post-prose .tip-box {
        padding: 1rem;
    }

    /* CTA box at end of post */
    .post-cta-box {
        padding: 1.5rem 1rem;
    }

    .post-cta-box h3 {
        font-size: 1.1rem;
    }

    /* Prev/next post navigation */
    .nav-posts {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-post-link {
        font-size: 0.85rem;
    }
}

/* Extra-small phones (≤480px) */
@media (max-width: 480px) {
    .blog-hero {
        padding: 3rem 0.75rem 1.75rem;
    }

    .blog-layout {
        padding: 1.5rem 0.75rem 2.5rem;
    }

    .article-card-body {
        padding: 1rem;
    }

    .post-hero {
        padding: 2.5rem 0 1.5rem;
    }

    .post-hero-inner {
        padding: 0 0.75rem;
    }

    .post-content-wrapper {
        padding: 1.5rem 0.75rem 3rem;
    }

    .post-prose {
        font-size: 0.94rem;
        line-height: 1.75;
    }

    .post-prose ul,
    .post-prose ol {
        margin-left: 1.1rem;
    }

    .sidebar-widget {
        padding: 1rem;
    }
}

/* Table of Contents */
.post-toc-sidebar {
    position: sticky;
    top: 5rem;
}

.toc-widget {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.toc-widget h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.toc-list li a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s, padding-left 0.2s;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
}

.toc-list li a:hover {
    color: #60a5fa;
    padding-left: 1.1rem;
    border-left-color: #3b82f6;
}

/* Article Prose */
.post-prose {
    color: #cbd5e1;
    font-size: 1.02rem;
    line-height: 1.8;
    max-width: 720px;
}

.post-prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 2.5rem 0 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.post-prose h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.post-prose h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 1.75rem 0 0.6rem;
}

.post-prose p {
    margin: 0 0 1.25rem;
}

.post-prose ul,
.post-prose ol {
    margin: 0.5rem 0 1.25rem 1.5rem;
}

.post-prose li {
    margin-bottom: 0.5rem;
}

.post-prose strong {
    color: #e2e8f0;
    font-weight: 600;
}

.post-prose a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-prose a:hover {
    color: #93c5fd;
}

.post-prose blockquote {
    border-left: 3px solid #3b82f6;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 0 8px 8px 0;
    color: #94a3b8;
    font-style: italic;
}

.post-prose .tip-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.post-prose .tip-box strong {
    color: #34d399;
}

.post-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}

.post-prose th {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-prose td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.post-prose tr:last-child td {
    border-bottom: none;
}

/* Post footer CTA */
.post-cta-box {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    text-align: center;
}

.post-cta-box h3 {
    color: #f1f5f9;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.post-cta-box p {
    color: #94a3b8;
    margin-bottom: 1.25rem;
}

.nav-posts {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
}

.nav-post-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.2s;
}

.nav-post-link:hover {
    gap: 0.7rem;
}