/* blog.css — Shared styles for vibeagentmaking.com/blog */

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface-hover: #181825;
    --border: #1e1e2e;
    --text: #e4e4ed;
    --text-muted: #8888a0;
    --accent: #6366f1;
    --accent-hover: #5558e6;
    --accent-glow: rgba(99, 102, 241, 0.12);
    --green: #22c55e;
    --green-muted: rgba(34, 197, 94, 0.1);
    --reading-width: 720px;
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- Skip Nav ---- */
.skip-nav {
    position: absolute; top: -100%; left: 16px; padding: 12px 24px;
    background: var(--accent); color: #fff; border-radius: 0 0 8px 8px;
    font-size: 14px; font-weight: 600; text-decoration: none; z-index: 200; transition: top 0.2s;
}
.skip-nav:focus { top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Header ---- */
header {
    padding: 20px 0; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px); z-index: 100;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 24px; }
nav a { font-size: 14px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--accent); }

/* ---- Container ---- */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ---- Footer ---- */
footer { padding: 40px 0; border-top: 1px solid var(--border); }
footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 14px; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 13px; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
    display: inline-block; padding: 14px 28px; border-radius: 8px;
    font-size: 15px; font-weight: 600; text-decoration: none;
    transition: all 0.2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ======================== */
/* BLOG LISTING PAGE        */
/* ======================== */

.blog-hero {
    padding: 80px 0 40px; text-align: center;
    border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
    font-size: clamp(28px, 4vw, 44px); font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 12px;
}
.blog-hero h1 em {
    font-style: normal; background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.blog-hero p {
    font-size: 17px; color: var(--text-muted); max-width: 540px;
    margin: 0 auto; line-height: 1.6;
}

/* Search/Filter bar */
.blog-toolbar {
    padding: 24px 0; border-bottom: 1px solid var(--border);
}
.blog-toolbar .container {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.blog-search {
    flex: 1; min-width: 200px; padding: 10px 16px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s;
}
.blog-search::placeholder { color: var(--text-muted); }
.blog-search:focus { border-color: var(--accent); }

.tag-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-btn {
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s;
}
.tag-btn:hover { border-color: var(--accent); color: var(--text); }
.tag-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.rss-link {
    font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600;
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.rss-link:hover { text-decoration: underline; }

/* Post cards */
.blog-grid {
    padding: 40px 0 80px;
}
.post-list {
    display: grid; gap: 24px; list-style: none;
}
.post-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 32px 28px; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.post-card:hover {
    border-color: var(--accent); background: var(--surface-hover);
    transform: translateY(-2px);
}
.post-meta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
}
.post-date { font-weight: 500; }
.post-reading-time { opacity: 0.8; }
.post-card h2 {
    font-size: clamp(18px, 2.5vw, 22px); font-weight: 700;
    letter-spacing: -0.02em; line-height: 1.35; margin-bottom: 8px;
}
.post-card p {
    font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px;
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tag {
    font-size: 12px; padding: 3px 10px; border-radius: 12px;
    background: var(--accent-glow); color: var(--accent); font-weight: 500;
}
.post-card-arrow {
    display: inline-block; margin-top: 12px; font-size: 14px;
    font-weight: 600; color: var(--accent);
}

/* No results */
.no-results {
    text-align: center; padding: 60px 0; color: var(--text-muted); font-size: 16px;
    display: none;
}
.no-results.visible { display: block; }

/* ======================== */
/* BLOG POST PAGE           */
/* ======================== */

/* Article header */
.article-header {
    padding: 80px 0 40px; border-bottom: 1px solid var(--border);
}
.article-header .container { max-width: var(--reading-width); }
.article-header h1 {
    font-size: clamp(28px, 4.5vw, 42px); font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 16px;
}
.article-header .article-subtitle {
    font-size: 18px; color: var(--text-muted); line-height: 1.6;
    margin-bottom: 24px; font-style: italic;
}
.article-meta {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    font-size: 14px; color: var(--text-muted);
}
.article-meta .author { font-weight: 600; color: var(--text); }

/* Article layout with TOC */
.article-layout {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--reading-width)) 220px;
    gap: 0 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.article-spacer { display: block; }

/* Table of Contents sidebar */
.toc-sidebar {
    position: sticky; top: 80px; align-self: start;
    padding: 24px 0; max-height: calc(100vh - 100px); overflow-y: auto;
}
.toc-sidebar h2 {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 16px;
}
.toc-sidebar ol {
    list-style: none; padding: 0;
}
.toc-sidebar li { margin-bottom: 8px; }
.toc-sidebar a {
    font-size: 13px; color: var(--text-muted); text-decoration: none;
    line-height: 1.5; display: block; transition: color 0.2s;
    border-left: 2px solid transparent; padding-left: 12px;
}
.toc-sidebar a:hover { color: var(--text); }
.toc-sidebar a.active {
    color: var(--accent); border-left-color: var(--accent);
}

/* Article body */
.article-body {
    padding: 48px 0 80px;
}

.article-body h2 {
    font-size: clamp(22px, 3vw, 28px); font-weight: 700;
    letter-spacing: -0.02em; margin-top: 56px; margin-bottom: 20px;
    padding-top: 32px; border-top: 1px solid var(--border);
    scroll-margin-top: 80px;
}
.article-body h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.article-body h3 {
    font-size: 18px; font-weight: 700; margin-top: 36px; margin-bottom: 12px;
    scroll-margin-top: 80px;
}

.article-body p {
    font-size: 17px; line-height: 1.8; margin-bottom: 20px;
    color: var(--text); font-family: Georgia, 'Times New Roman', serif;
}

.article-body strong { color: #fff; font-weight: 700; }
.article-body em { font-style: italic; }

.article-body a {
    color: var(--accent); text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.4);
    transition: text-decoration-color 0.2s;
}
.article-body a:hover { text-decoration-color: var(--accent); }

.article-body blockquote {
    border-left: 3px solid var(--accent); margin: 28px 0;
    padding: 16px 24px; background: var(--surface); border-radius: 0 8px 8px 0;
}
.article-body blockquote p {
    font-size: 16px; color: var(--text-muted); margin-bottom: 0;
}

.article-body ul, .article-body ol {
    margin: 16px 0 20px 24px; font-family: Georgia, 'Times New Roman', serif;
}
.article-body li {
    font-size: 17px; line-height: 1.8; margin-bottom: 8px; color: var(--text);
}

.article-body code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em; background: var(--surface); border: 1px solid var(--border);
    padding: 2px 7px; border-radius: 4px; color: #c4b5fd;
}

.article-body pre {
    margin: 24px 0; padding: 20px 24px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; overflow-x: auto;
}
.article-body pre code {
    background: none; border: none; padding: 0; font-size: 14px;
    line-height: 1.7; color: var(--text);
}

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

/* Pull quote */
.pull-quote {
    font-size: 22px; font-weight: 600; line-height: 1.5;
    color: var(--accent); text-align: center;
    margin: 48px 0; padding: 32px 24px;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Article footer / CTA */
.article-footer {
    max-width: var(--reading-width); margin: 0 auto; padding: 0 24px 80px;
}
.article-tags {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px;
}
.article-tag {
    font-size: 13px; padding: 5px 14px; border-radius: 20px;
    background: var(--accent-glow); color: var(--accent); font-weight: 500;
    text-decoration: none; transition: background 0.2s;
}
.article-tag:hover { background: rgba(99, 102, 241, 0.2); }

.article-cta {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 40px 32px; text-align: center; margin-bottom: 40px;
}
.article-cta h3 {
    font-size: 20px; font-weight: 700; margin-bottom: 8px;
}
.article-cta p {
    font-size: 15px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6;
}
.article-cta .btn { margin: 0 8px; }

.related-posts { margin-top: 40px; }
.related-posts h3 {
    font-size: 16px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 20px;
}
.related-list {
    display: grid; gap: 16px; list-style: none;
}
.related-item {
    display: block; text-decoration: none; color: inherit;
    padding: 20px 24px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; transition: border-color 0.2s;
}
.related-item:hover { border-color: var(--accent); }
.related-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.related-item p { font-size: 13px; color: var(--text-muted); }

/* ======================== */
/* RESPONSIVE               */
/* ======================== */

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        max-width: var(--reading-width);
    }
    .toc-sidebar { display: none; }
    .article-spacer { display: none; }
}

@media (max-width: 768px) {
    nav a.nav-hide { display: none; }
    .blog-hero { padding: 60px 0 30px; }
    .blog-grid { padding: 24px 0 60px; }
    .article-header { padding: 60px 0 30px; }
    .article-body h2 { margin-top: 40px; }
    footer .container { flex-direction: column; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
    .blog-toolbar .container { flex-direction: column; align-items: stretch; }
    .blog-search { min-width: unset; }
}

@media (max-width: 480px) {
    .article-body p, .article-body li { font-size: 16px; }
    .article-header h1 { font-size: 26px; }
    .post-card { padding: 24px 20px; }
    .article-cta { padding: 28px 20px; }
}
