/* ============================================
   Blog — deflation.ai
   Shared styles for blog index and articles
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-card: #111118;
    --bg-content: #fafafa;
    --text: #e8e8ed;
    --text-muted: #8a8a9a;
    --text-dark: #1a1a2e;
    --text-dark-muted: #6b7280;
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --border: #1e1e2a;
    --border-light: #e5e7eb;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --max-width: 1100px;
    --article-width: 720px;
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navigation ---- */
.nav {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

/* ---- Blog Index ---- */
.blog-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 32px 40px;
    width: 100%;
}

.blog-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.blog-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
}

.blog-filters {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(13, 148, 136, 0.08);
}

.blog-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    width: 100%;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.08);
}

.post-card-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
    display: block;
}

.post-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-card-tag {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

/* ---- Article Page ---- */
.article-hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 32px 40px;
    width: 100%;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.article-tag {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(13, 148, 136, 0.1);
    padding: 4px 12px;
    border-radius: 6px;
}

.article-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: var(--article-width);
    margin-bottom: 16px;
}

.article-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: var(--article-width);
    line-height: 1.7;
}

.article-hero-image {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px 40px;
}

.article-hero-image img {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
}

/* Article content — light background for readability */
.article-content-wrapper {
    background: var(--bg-content);
    border-top: 1px solid var(--border);
    flex: 1;
}

.article-content {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 56px 24px 80px;
    color: var(--text-dark);
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(13, 148, 136, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition);
}

.article-content a:hover {
    text-decoration-color: var(--accent);
}

.article-content img {
    width: 100%;
    border-radius: 12px;
    margin: 28px 0;
    border: 1px solid var(--border-light);
}

.article-content pre {
    background: #1a1a2e;
    color: #e8e8ed;
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid #2a2a3e;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: #f0f0f5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #d6336c;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-dark-muted);
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 16px 0 20px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 40px 0;
}

.article-content strong {
    font-weight: 600;
    color: var(--text-dark);
}

.article-content em {
    font-style: italic;
}

/* Image captions */
.article-content .img-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    margin-top: -20px;
    margin-bottom: 28px;
}

/* Article CTA */
.article-cta {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    margin: 48px 0;
    text-align: center;
}

.article-cta h3 {
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 12px;
    margin-top: 0;
}

.article-cta p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.article-cta a.cta-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background var(--transition);
}

.article-cta a.cta-btn:hover {
    background: var(--accent-light);
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 32px;
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}

.footer a:hover { color: var(--text); }

.footer-copy {
    color: #4a4a5a;
    font-size: 0.8rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .blog-header h1 { font-size: 1.8rem; }
    .blog-header { padding: 40px 20px 28px; }
    .blog-filters { padding: 0 20px 24px; }
    .blog-grid {
        grid-template-columns: 1fr;
        padding: 0 20px 60px;
    }
    .nav { padding: 20px; }

    .article-hero { padding: 40px 20px 28px; }
    .article-hero h1 { font-size: 1.8rem; }
    .article-hero-image { padding: 0 20px 28px; }
    .article-content { padding: 40px 20px 60px; }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .article-hero h1 { font-size: 1.5rem; }
    .article-content { font-size: 1rem; }
}
