/* ===== BLOG — reuses tokens from /styles.css ===== */

.blog-body { background: var(--bg-primary); }
.blog-main { padding-top: 72px; min-height: 70vh; }
.container-narrow { max-width: 760px; }
.container-wide { max-width: 1000px; }
.nav-links a.active { color: var(--text-primary); }
.nav-links a.active::after { width: 100%; }

/* --- list page --- */
.blog-hero {
    padding: 96px 0 40px;
    position: relative;
}
.blog-hero .section-title { margin-top: 12px; }
.blog-hero .section-desc { max-width: 560px; margin: 14px 0 0; text-align: left; }

.blog-list { padding: 24px 0 120px; }

.blog-empty {
    padding: 64px 24px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.post-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.post-card:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

.post-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
}
.post-card-featured .post-card-media { flex: 0 0 55%; aspect-ratio: auto; min-height: 340px; }
.post-card-featured .post-card-body { padding: 40px; justify-content: center; }
.post-card-featured h2 { font-size: 1.85rem; }

.post-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    overflow: hidden;
}
.post-card-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-card:hover .post-card-media img { transform: scale(1.03); }

.post-card-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.25), transparent 60%), var(--bg-secondary);
    font-size: 3rem;
    filter: drop-shadow(0 0 16px rgba(129,140,248,0.6));
}

.post-card-badge {
    position: absolute;
    top: 14px; left: 14px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(10,10,15,0.75);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    flex: 1;
}
.post-card-body h2 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.post-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-more {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.post-meta-sep {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--border-light);
}

/* --- single post --- */
.post { padding: 72px 0 120px; }

.post-draft-banner {
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--accent-warm);
    text-align: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    margin: -72px 0 48px;
}
.post-draft-banner a { text-decoration: underline; margin-left: 8px; }

.post-back {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    transition: color var(--transition);
}
.post-back:hover { color: var(--text-primary); }

.post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}
.post-header .post-meta { font-size: 0.875rem; }

.post-cover {
    margin: 48px auto 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.post-content {
    margin-top: 56px;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.post-content > * + * { margin-top: 1.4em; }
.post-content h2, .post-content h3, .post-content h4 {
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-top: 2.2em;
}
.post-content h2 { font-size: 1.7rem; font-weight: 700; }
.post-content h3 { font-size: 1.3rem; font-weight: 700; }
.post-content h4 { font-size: 1.05rem; font-weight: 600; }
.post-content strong { color: var(--text-primary); font-weight: 600; }
.post-content a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--text-primary); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li + li { margin-top: 0.5em; }
.post-content li::marker { color: var(--accent-light); }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    color: var(--text-primary);
    font-style: italic;
}
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: #a5d6ff;
}
.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    overflow-x: auto;
    line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; font-size: 0.85rem; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.post-content th, .post-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.post-content th { background: var(--bg-card); color: var(--text-primary); }

.post-content figure { margin: 2.2em 0; }
.post-content figure img,
.post-content figure video {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}
.post-content figure video { max-height: 80vh; }
.post-content figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}
.post-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 2.2em 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}
.post-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), background var(--transition);
}
.post-nav-link:hover { border-color: var(--border-light); background: var(--bg-card); }
.post-nav-link span { font-size: 0.75rem; color: var(--text-muted); }
.post-nav-link strong { font-size: 0.95rem; font-weight: 600; }
.post-nav-next { text-align: right; }

.post-cta {
    margin-top: 64px;
    padding: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(168,85,247,0.08));
    border: 1px solid var(--border);
    text-align: center;
}
.post-cta h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.post-cta p { color: var(--text-secondary); max-width: 480px; margin: 0 auto 24px; }

/* --- responsive --- */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-card-featured { flex-direction: column; }
    .post-card-featured .post-card-media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .post-card-featured .post-card-body { padding: 28px; }
    .post-card-featured h2 { font-size: 1.5rem; }
}
@media (max-width: 640px) {
    .blog-hero { padding-top: 64px; }
    .post-grid { grid-template-columns: 1fr; gap: 20px; }
    .post { padding-top: 48px; }
    .post-draft-banner { margin-top: -48px; }
    .post-content { font-size: 1rem; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
    .post-cta { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .post-card, .post-card-media img { transition: none; }
    .post-card:hover { transform: none; }
    .post-card:hover .post-card-media img { transform: none; }
}
