/* Blog Page Styles - Extends home.css */

.blog-hero {
    padding: 80px 0 60px;
    text-align: center;
}

.blog-hero h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.blog-hero .hero-desc {
    font-size: 21px;
    line-height: 1.5;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
}

.blog-content {
    padding: 60px 0 120px;
}

/* Featured Post */
.blog-featured {
    margin-bottom: 80px;
}

.blog-featured-link {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 40px;
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    text-decoration: none;
    color: inherit;
}

.blog-featured-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.blog-featured-image {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

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

.blog-featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

.blog-category {
    padding: 4px 12px;
    background: var(--bg-alt);
    border-radius: 6px;
    font-weight: 500;
    color: var(--ink-2);
}

.blog-reading-time {
    color: var(--muted);
}

.blog-featured-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.blog-featured-excerpt {
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink-2);
    margin-bottom: 8px;
}

.blog-read-more {
    align-self: flex-start;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 60px;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.blog-card-link:hover {
    text-decoration: none;
}

.blog-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease);
}

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

.blog-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.blog-card-title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.022em;
    color: var(--ink);
}

.blog-card-excerpt {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-2);
    flex: 1;
}

.blog-card-read-more {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand);
    transition: color 0.2s var(--ease);
}

.blog-card:hover .blog-card-read-more {
    color: var(--brand-hover);
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 60px;
}

.blog-pagination-button.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Empty State */
.blog-empty {
    text-align: center;
    padding: 80px 0;
}

.blog-empty p:first-child {
    font-size: 64px;
    margin-bottom: 24px;
}

.blog-empty h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.blog-empty p:last-child {
    font-size: 17px;
    color: var(--muted);
}

/* Tablet */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .blog-featured-link {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px;
    }
    
    .blog-featured-title {
        font-size: 28px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .blog-hero {
        padding: 60px 0 40px;
    }
    
    .blog-hero h1 {
        font-size: 40px;
    }
    
    .blog-hero .hero-desc {
        font-size: 17px;
    }
    
    .blog-content {
        padding: 40px 0 80px;
    }
    
    .blog-featured {
        margin-bottom: 60px;
    }
    
    .blog-featured-link {
        padding: 24px;
        gap: 24px;
    }
    
    .blog-featured-title {
        font-size: 24px;
    }
    
    .blog-featured-excerpt {
        font-size: 15px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .blog-card-content {
        padding: 20px;
    }
    
    .blog-card-title {
        font-size: 19px;
    }
    
    .blog-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .blog-pagination .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 32px;
    }
    
    .blog-featured-title {
        font-size: 21px;
    }
}

/* =========================================================
   Blog list refinements
   ========================================================= */
.hero.blog-hero { padding: 88px 0 56px; }
.blog-hero h1 { margin-bottom: 20px; }
.blog-hero .hero-desc { font-size: 19px; line-height: 1.6; max-width: 600px; }
.blog-content { padding: 32px 0 120px; }

.blog-featured { margin-bottom: 64px; }
.blog-featured-link { gap: 56px; padding: 32px; align-items: center; }
.blog-featured-image,
.blog-card-image { background: var(--bg-alt, #f5f5f7); }
.blog-featured-image img,
.blog-card-image img { object-fit: contain; }
.blog-featured-content { gap: 0; }
.blog-featured-content .blog-meta { margin-bottom: 16px; }
.blog-featured-title { font-size: 32px; line-height: 1.22; letter-spacing: -0.02em; margin: 0 0 16px; }
.blog-featured-excerpt { font-size: 17px; line-height: 1.65; color: var(--muted); margin: 0 0 28px;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.blog-card-content { padding: 24px 24px 28px; gap: 0; }
.blog-card-content .blog-meta { margin-bottom: 12px; }
.blog-card-title { font-size: 20px; line-height: 1.35; margin: 0 0 10px; }
.blog-card-excerpt { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 20px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.blog-meta { flex-wrap: wrap; font-size: 13px; line-height: 1.4; }
.blog-category { font-size: 12px; letter-spacing: .02em; padding: 4px 10px; }

/* Hide pagination when there is only one page */
.blog-pagination:has(#next-page.disabled):has(#prev-page.disabled) { display: none; }

/* =========================================================
   Blog post (article) page
   ========================================================= */
.blog-post-content { padding: 72px 0 112px; }
.blog-post-wrap { max-width: calc(720px + var(--gutter, 24px) * 2); }

.blog-post-header { margin-bottom: 40px; }
.blog-post-back {
    display: inline-block; font-size: 15px; font-weight: 500; color: var(--muted);
    margin-bottom: 28px; text-decoration: none;
}
.blog-post-back:hover { color: var(--brand); text-decoration: none; }
.blog-post-eyebrow { margin-bottom: 16px; }
.blog-post-title {
    font-size: 46px; font-weight: 700; line-height: 1.12; letter-spacing: -0.025em;
    color: var(--ink); margin: 0; text-wrap: balance;
}
.blog-post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 20px; font-size: 15px; color: var(--muted);
}
.blog-post-featured-image { margin: 0 0 48px; }
.blog-post-featured-image img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* Body typography */
.blog-post-body {
    font-size: 18px; line-height: 1.7; color: var(--ink-2, #333);
    overflow-wrap: break-word;
}
.blog-post-body > *:first-child { margin-top: 0; }
.blog-post-body p { margin: 0 0 1.4em; }
.blog-post-body h2 {
    font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em;
    color: var(--ink); margin: 2.2em 0 0.6em;
}
.blog-post-body h3 {
    font-size: 22px; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em;
    color: var(--ink); margin: 1.8em 0 0.5em;
}
.blog-post-body h4 { font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--ink); margin: 1.6em 0 0.4em; }
.blog-post-body h2 + h3 { margin-top: 1em; }
.blog-post-body strong { color: var(--ink); font-weight: 600; }
.blog-post-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.blog-post-body a:hover { color: var(--brand-hover, var(--brand)); }

.blog-post-body ul,
.blog-post-body ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.blog-post-body ul { list-style: disc; }
.blog-post-body ol { list-style: decimal; }
.blog-post-body li { margin: 0 0 0.5em; padding-left: 0.2em; }
.blog-post-body li::marker { color: var(--brand); }
.blog-post-body li > ul, .blog-post-body li > ol { margin: 0.5em 0 0; }

.blog-post-body blockquote {
    margin: 2em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--brand);
    font-size: 20px; line-height: 1.6; color: var(--ink);
}
.blog-post-body blockquote p:last-child { margin-bottom: 0; }

.blog-post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em;
    background: var(--bg-alt, #f5f5f7); padding: 0.15em 0.4em; border-radius: 6px;
}
.blog-post-body pre {
    margin: 2em 0; padding: 20px 24px; background: #1d1d1f; color: #f5f5f7;
    border-radius: 12px; overflow-x: auto; font-size: 15px; line-height: 1.6;
}
.blog-post-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.blog-post-body hr { border: 0; border-top: 1px solid var(--line-soft, #e5e5ea); margin: 3em 0; }

.blog-post-body img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.blog-post-body figure { margin: 2.2em 0; }
.blog-post-body figure img { margin: 0 auto; border: 1px solid var(--line-soft, #e5e5ea); }
.blog-post-body figcaption,
.blog-post-body .wp-element-caption {
    margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center;
}

/* Tables: scroll horizontally on small screens instead of overflowing */
.blog-post-body .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.blog-post-body table {
    width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; margin: 2em 0;
}
.blog-post-body .wp-block-table table { margin: 0; min-width: 560px; }
.blog-post-body th,
.blog-post-body td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft, #e5e5ea); }
.blog-post-body thead th { font-weight: 600; color: var(--ink); background: var(--bg-alt, #f5f5f7); border-bottom: 1px solid var(--line, #d2d2d7); }
.blog-post-body tbody tr:last-child td { border-bottom: 0; }
.blog-post-body .wp-block-table { border: 1px solid var(--line-soft, #e5e5ea); border-radius: 12px; }

.blog-post-footer { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line-soft, #e5e5ea); }

@media (max-width: 768px) {
    .hero.blog-hero { padding: 56px 0 32px; }
    .blog-hero .hero-desc { font-size: 17px; }
    .blog-content { padding: 24px 0 80px; }
    .blog-featured-link { padding: 20px; gap: 24px; }
    .blog-featured-title { font-size: 24px; margin-bottom: 12px; }
    .blog-featured-excerpt { font-size: 16px; margin-bottom: 24px; }

    .blog-post-content { padding: 40px 0 80px; }
    .blog-post-back { margin-bottom: 20px; }
    .blog-post-title { font-size: 32px; line-height: 1.18; }
    .blog-post-meta { font-size: 14px; margin-top: 16px; }
    .blog-post-header { margin-bottom: 32px; }
    .blog-post-featured-image { margin-bottom: 32px; }
    .blog-post-body { font-size: 17px; line-height: 1.7; }
    .blog-post-body h2 { font-size: 25px; margin-top: 2em; }
    .blog-post-body h3 { font-size: 20px; }
    .blog-post-body blockquote { font-size: 18px; padding-left: 18px; }
    .blog-post-body figure { margin: 1.8em 0; }
    .blog-post-body pre { margin-left: calc(var(--gutter, 20px) * -1); margin-right: calc(var(--gutter, 20px) * -1); border-radius: 0; }
}

/* The shared .hero pulls the next section up by 120px; the blog has no overlap art */
.hero.blog-hero { margin-bottom: 0; overflow: visible; }
.blog-hero h1 { margin-top: 0; }
