:root {
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(59, 130, 246, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.blog-layout { display: flex; flex-direction: column; min-height: 100vh; }
.blog-content { flex: 1; }

/* ── Header ── */
.blog-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.blog-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.blog-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.blog-logo-img { height: 44px; width: auto; }

.blog-logo-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
}

.blog-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.blog-nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-radius: 7px;
    transition: color 0.2s, background 0.2s;
}

.blog-nav-link:hover { color: #fff; background: rgba(59,130,246,0.1); }

.blog-nav-btn {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    transition: background 0.2s, border-color 0.2s;
    margin-left: 0.25rem;
}

.blog-nav-btn:hover { background: rgba(59,130,246,0.28); border-color: rgba(59,130,246,0.5); }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

/* ── Footer ── */
.blog-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.blog-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.blog-footer-logo { height: 36px; width: auto; }

.blog-footer-text { flex: 1; font-size: 0.9rem; color: var(--text-muted); }

.blog-footer-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.blog-footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.blog-footer-links a:hover { color: #fff; }
.blog-footer-links span { color: #334155; }

.blog-footer-social { display: flex; gap: 0.6rem; }

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(59,130,246,0.08);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.social-icon:hover { background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.4); color: #fff; }

/* ── Post Card List ── */
.blog-index {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.blog-index-hero {
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-top: 1rem;
}

.blog-index-hero::before {
    content: "";
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: 90%;
    height: 160px;
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.18), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.blog-index-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f1f5f9;
    margin-bottom: 0.6rem;
}

.blog-index-hero p { color: var(--text-muted); font-size: 1.05rem; }

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    text-decoration: none;
    display: block;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 8px 32px rgba(59,130,246,0.12);
    transform: translateY(-2px);
}

.post-card-cover {
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: #0b1220;
    border-bottom: 1px solid var(--border);
}

.post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-cover img { transform: scale(1.03); }

.post-card-body { padding: 1.75rem 2rem; }

.post-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.post-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 5px;
    padding: 0.15rem 0.5rem;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.6rem;
    line-height: 1.35;
}

.post-card-excerpt {
    color: #94a3b8;
    font-size: 0.93rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.82rem;
    color: #64748b;
}

.post-card-meta-dot { color: #334155; }

.post-card-read-more {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
}

/* ── Post Page ── */
.blog-post-page {
    max-width: 740px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.blog-post-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.blog-post-back:hover { color: var(--text); }

.blog-post-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.blog-post-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f1f5f9;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.blog-post-cover {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 2.5rem;
    background: #0b1220;
}

.blog-post-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Prose ── */
.blog-post-body { color: #cbd5e1; font-size: 1.05rem; line-height: 1.8; }

.blog-post-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 2rem 0 0.75rem;
}

.blog-post-body p { margin-bottom: 1.25rem; }

.blog-post-body a { color: var(--accent); text-decoration: none; }
.blog-post-body a:hover { text-decoration: underline; }

.blog-post-body ul, .blog-post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.blog-post-body li { margin-bottom: 0.4rem; }

.blog-post-body code {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-size: 0.9em;
    color: #93c5fd;
}

.blog-post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-post-footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.blog-post-footer-cta:hover { background: rgba(59,130,246,0.28); }

/* ── Empty State ── */
.blog-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: rgba(30,41,59,0.4);
}

.blog-empty h2 { color: #f1f5f9; font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.blog-empty p { color: var(--text-muted); }

/* ── Not Found ── */
.blog-not-found {
    max-width: 500px;
    margin: 6rem auto;
    text-align: center;
    padding: 0 1.5rem;
}

.blog-not-found h1 { font-size: 2rem; font-weight: 800; color: #f1f5f9; margin-bottom: 1rem; }
.blog-not-found p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .blog-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .blog-index-hero h1 { font-size: 1.7rem; }
    .blog-post-title { font-size: 1.6rem; }
    .post-card-body { padding: 1.25rem; }
    .blog-post-page { padding: 2rem 1rem; }
    .blog-index { padding: 2rem 1rem; }

    .blog-footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
