/* ==========================================================================
   blog.css — page-specific styles for zh-Hans/blog/index.html
   Scope: blog list page only. Do NOT redefine global chrome (footer, nav-bar, etc.).
   ========================================================================== */

/* ==========================================================================
   1. Design tokens & reset (mirrors index.css tokens for file:// standalone use)
   ========================================================================== */
:root {
    --brand:           #FF7E5F;
    --brand-alt:       #FEB47B;
    --brand-gradient:  linear-gradient(135deg, #FF7E5F 0%, #FEB47B 100%);
    --accent:          #5E5CE6;
    --accent-light:    #EBEBFF;
    --success:         #00D084;
    --text-main:       #1A1A1B;
    --text-muted:      #6E6E73;
    --text-light:      #8E8E93;
    --bg-main:         #FBFBFD;
    --bg-card:         #FFFFFF;
    --bg-alt:          #F5F5F7;
    --border-line:     #EDEDF0;
    --shadow-soft:     0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-card:     0 8px 32px rgba(0, 0, 0, 0.07);
    --font-sans:       "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", sans-serif;
    --r-sm: 12px; --r-md: 18px; --r-lg: 24px; --r-xl: 32px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.55;
}

/* Ambient background (same as index.css) */
.ambient-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(circle at 8% 16%,  rgba(255,126,95,0.09) 0%, transparent 40%),
        radial-gradient(circle at 92% 78%,  rgba(94,92,230,0.07) 0%, transparent 38%),
        var(--bg-main);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* ==========================================================================
   2. Nav (header.js injects .nav-bar; only tokens needed here)
   ========================================================================== */
.nav-bar {
    height: 72px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1000;
    background: rgba(251,251,253,0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0 40px;
}
.logo-wrap { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; color: var(--text-main); text-decoration: none; }
.logo-icon { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.logo-icon img { width: 32px; height: 32px; object-fit: contain; display: block; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { background: #fff; border: 1px solid var(--border-line); padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--text-main); white-space: nowrap; }

/* ==========================================================================
   3. Shared utilities
   ========================================================================== */
.section-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--brand); margin-bottom: 14px; display: block;
}
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 100px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all .25s var(--ease-out);
    text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 24px rgba(255,126,95,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255,126,95,.36); }
.btn-secondary { background: #fff; color: var(--text-main); border: 1.5px solid var(--border-line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ==========================================================================
   4. Blog hero / page header
   ========================================================================== */
.blog-hero {
    padding: 80px 0 64px;
    text-align: center;
}
.blog-hero-eyebrow {
    display: inline-block;
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--brand);
    background: rgba(255,126,95,.08);
    padding: 5px 14px; border-radius: 100px;
    margin-bottom: 24px;
}
.blog-hero h1 {
    font-size: 52px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.08;
    margin-bottom: 20px;
}
.blog-hero h1 .g {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.blog-hero-desc {
    font-size: 18px; color: var(--text-muted); line-height: 1.65;
    max-width: 540px; margin: 0 auto 36px;
}

/* ==========================================================================
   5. Stats bar
   ========================================================================== */
.blog-stats {
    display: flex; align-items: center; justify-content: center; gap: 32px;
    padding: 20px 0 0;
    flex-wrap: wrap;
}
.blog-stat {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-muted);
}
.blog-stat-num {
    font-size: 22px; font-weight: 800; letter-spacing: -0.04em; color: var(--text-main);
}
.blog-stat-dot {
    width: 4px; height: 4px; border-radius: 50%; background: var(--border-line);
}

/* ==========================================================================
   6. Category filter bar
   ========================================================================== */
.blog-filter {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    padding: 48px 0 36px;
}
.filter-btn {
    padding: 8px 18px; border-radius: 100px; font-size: 13px; font-weight: 600;
    border: 1.5px solid var(--border-line); background: #fff;
    color: var(--text-muted); cursor: pointer;
    transition: all .2s var(--ease-out);
    font-family: inherit;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active {
    background: var(--brand-gradient); color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px rgba(255,126,95,.28);
}

/* ==========================================================================
   7. Featured (latest) article card
   ========================================================================== */
.blog-featured {
    margin-bottom: 48px;
}
.featured-label {
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-light); margin-bottom: 14px;
}
.featured-card {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: var(--bg-card);
    border-radius: var(--r-xl);
    border: 1px solid var(--border-line);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
    text-decoration: none; color: inherit;
}
.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 56px rgba(0,0,0,.10);
}
.featured-card-visual {
    background: linear-gradient(135deg, #FF7E5F22 0%, #5E5CE622 100%);
    display: flex; align-items: center; justify-content: center;
    min-height: 260px;
    position: relative;
    overflow: hidden;
}
.featured-card-visual::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,126,95,.15) 0%, rgba(94,92,230,.10) 100%);
}
.featured-card-icon {
    font-size: 72px; position: relative; z-index: 1;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.12));
}
.featured-card-body {
    padding: 40px;
    display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.featured-card-meta {
    display: flex; align-items: center; gap: 12px;
}
.category-tag {
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 6px;
    background: rgba(255,126,95,.10); color: var(--brand);
}
.featured-date {
    font-size: 13px; color: var(--text-light);
}
.featured-title {
    font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25;
    color: var(--text-main);
}
.featured-desc {
    font-size: 15px; color: var(--text-muted); line-height: 1.65;
}
.featured-read-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 700; color: var(--brand);
    text-decoration: none; margin-top: 4px;
    transition: gap .2s;
}
.featured-read-link:hover { gap: 10px; }

/* ==========================================================================
   8. Article list grid
   ========================================================================== */
.blog-list-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 24px;
}
.blog-list-head h2 {
    font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
}
.blog-count-badge {
    font-size: 13px; font-weight: 600; color: var(--text-light);
    background: var(--bg-alt); padding: 4px 12px; border-radius: 100px;
}

.article-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.article-card {
    background: var(--bg-card);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-line);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    display: flex; flex-direction: column; gap: 14px;
    text-decoration: none; color: inherit;
    transition: box-shadow .22s, transform .22s, border-color .22s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    border-color: rgba(255,126,95,.22);
}
.article-card-meta {
    display: flex; align-items: center; gap: 10px;
}
.article-date {
    font-size: 12px; color: var(--text-light);
}
.article-title {
    font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35;
    color: var(--text-main);
}
.article-desc {
    font-size: 14px; color: var(--text-muted); line-height: 1.6; flex: 1;

    /* truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-read-more {
    font-size: 13px; font-weight: 700; color: var(--brand);
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: auto;
}

/* Empty state when filter yields no results */
.blog-empty {
    text-align: center; padding: 72px 24px;
    color: var(--text-muted); font-size: 15px;
    display: none;
}
.blog-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ==========================================================================
   9. CTA strip
   ========================================================================== */
.blog-cta {
    margin: 72px 0;
    background: var(--brand-gradient);
    border-radius: var(--r-xl);
    padding: 52px 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    color: #fff;
    box-shadow: 0 16px 48px rgba(255,126,95,.28);
}
.blog-cta-text h2 {
    font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px;
}
.blog-cta-text p {
    font-size: 15px; opacity: .85; line-height: 1.6; max-width: 400px;
}
.blog-cta-btns { display: flex; gap: 12px; flex-shrink: 0; }
.btn-white {
    background: #fff; color: var(--brand); font-weight: 700;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.btn-outline-white {
    background: rgba(255,255,255,.15); color: #fff; border: 1.5px solid rgba(255,255,255,.35);
}
.btn-outline-white:hover { background: rgba(255,255,255,.22); }

/* ==========================================================================
   10. Footer
   ========================================================================== */
footer {
    border-top: 1px solid var(--border-line);
    padding: 32px 0;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: var(--text-light);
    flex-wrap: wrap; gap: 12px;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-light); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--brand); }

/* ==========================================================================
   11. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .blog-hero h1 { font-size: 38px; }
    .featured-card { grid-template-columns: 1fr; }
    .featured-card-visual { min-height: 180px; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-cta { flex-direction: column; text-align: center; padding: 40px 32px; }
    .blog-cta-text p { max-width: none; }
    .blog-cta-btns { justify-content: center; }
}
@media (max-width: 640px) {
    /* nav collapses to hamburger on mobile */
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column; align-items: flex-start;
        position: absolute; top: 72px; left: 0; right: 0;
        background: rgba(251,251,253,.97); backdrop-filter: blur(16px);
        padding: 12px 24px 20px; gap: 4px;
        border-bottom: 1px solid rgba(0,0,0,.06); z-index: 999;
    }
    .container { padding: 0 20px; }
    .blog-hero { padding: 56px 0 40px; }
    .blog-hero h1 { font-size: 30px; }
    .blog-hero-desc { font-size: 15px; }
    .article-grid { grid-template-columns: 1fr; }
    .featured-card-body { padding: 24px; }
    .featured-title { font-size: 20px; }
    .blog-stats { gap: 20px; }
    .blog-filter { gap: 8px; }
    footer { flex-direction: column; gap: 14px; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 14px; }
}

/* ==========================================================================
   12. Fade-in animation
   ========================================================================== */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.fade-in.visible { opacity: 1; transform: none; }
