/* Blog pages: theme, nav, footer and post typography */
:root {
    --bg-deep: #121212;
    --bg-surface: #1C1C1C;
    --bg-elevated: #282828;
    --bg-card: #222222;
    --border: #33312E;
    --border-subtle: #262421;
    --text: #F5F3EE;
    --text-dim: #A6A19A;
    --text-muted: #6B6661;
    --accent: #26D9B9;
    --accent-secondary: #D91AE6;
    --btn-text: var(--bg-deep);
    --font-display: 'Outfit', -apple-system, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-display);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 72px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 52px; }
@media (max-width: 1024px) { .container { padding: 0 32px; } }
@media (max-width: 768px) { .container { padding: 0 24px; } body { padding-top: 64px; } }

/* Navigation */
.unified-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.unified-nav .container {
    display: flex; justify-content: space-between; align-items: center; height: 72px;
}
@media (max-width: 768px) { .unified-nav .container { height: 64px; } }
.unified-nav-logo { display: flex; align-items: center; text-decoration: none; height: 40px; }
.unified-nav-logo img { height: 100%; width: auto; display: block; }
.unified-nav-links { display: flex; align-items: center; gap: 32px; }
@media (max-width: 768px) { .unified-nav-links { gap: 24px; font-size: 0.85rem; } }
.unified-nav-links a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.unified-nav-links a:hover { color: var(--text); }

/* Blog layout */
.blog-main { padding: 56px 0 96px; }
.blog-column { max-width: 720px; margin: 0 auto; }

.blog-back {
    display: inline-block; margin-bottom: 32px;
    color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 500;
    transition: color 0.2s;
}
.blog-back:hover { color: var(--accent); }

.blog-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 32px; }
.blog-nav .blog-back { margin-bottom: 0; }

.blog-heading { font-size: 2.5rem; font-weight: 700; line-height: 1.15; margin-bottom: 8px; }
.blog-lede { color: var(--text-dim); margin-bottom: 40px; }

/* Listing */
.post-list { list-style: none; border-top: 1px solid var(--border); }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list a { display: block; padding: 28px 0; text-decoration: none; color: inherit; }
.post-list__date { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.post-list__title { font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin-bottom: 8px; transition: color 0.2s; }
.post-list a:hover .post-list__title { color: var(--accent); }
.post-list__excerpt { color: var(--text-dim); font-size: 0.95rem; }

/* Post header */
.post-header { margin-bottom: 40px; }
.post-header__meta { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.post-header__title { font-size: 2.5rem; font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.post-header__dek { font-size: 1.15rem; color: var(--text-dim); font-weight: 300; }
@media (max-width: 640px) { .blog-heading, .post-header__title { font-size: 2rem; } }

.post-feature { margin: 0 0 40px; }
.post-feature img { display: block; width: 100%; height: auto; border-radius: 4px; }
.post-feature figcaption { margin-top: 8px; font-size: 0.78rem; text-align: center; color: var(--text-dim); }

/* Post body */
.post-body { font-size: 1.05rem; line-height: 1.75; }
.post-body > * + * { margin-top: 1.5rem; }
.post-body p { color: #DAD6CE; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body a:hover { color: var(--text); }
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.25; margin-top: 2.5rem; }
.post-body h2 { font-size: 1.6rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li + li { margin-top: 0.4rem; }
.post-body blockquote { border-left: 3px solid var(--border); padding-left: 1.25rem; color: var(--text-dim); }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.post-body code { font-size: 0.9em; background: var(--bg-card); padding: 0.1em 0.35em; border-radius: 4px; }
.post-body pre { background: var(--bg-card); padding: 1rem; border-radius: 8px; overflow-x: auto; }
.post-body pre code { background: none; padding: 0; }

.post-body img { display: block; max-width: 100%; height: auto; margin: 0 0 1.5rem; border-radius: 4px; }
.post-body p:has(> img:only-child) img { margin: 0; }

/* Opt-in image class: visually attach an illustration to its lead-in line. */
.post-body p:has(> img.lead-in-image) { margin-top: 1.25rem; }
.post-body p:has(> img.lead-in-image) + p { margin-top: 1.5rem; }

/* Italic line directly under an image acts as a caption. */
.post-body p:has(> img:only-child) + p:has(> em) {
    margin: 0.45rem 0 1.5rem; font-size: 0.78rem; line-height: 1.45; text-align: center; color: var(--text-dim);
}
.post-body p:has(> img:only-child) + p:has(> em) em { font-style: normal; }

/* Callout: a `---` followed by `## Heading` in the Markdown (see renderMarkdown in build-blog.mjs) */
.post-body .callout {
    margin-top: 3.5rem;
    padding: 1.6rem 1.5rem 1.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
}
.post-body .callout__label {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    line-height: 1.4;
    margin: 0 0 1.15rem;
}
.callout__body > * + * { margin-top: 1.25rem; }
.post-body .callout__body > :first-child { margin-top: 0; }

/* Footer */
footer { position: relative; z-index: 1; padding: 48px 0; border-top: 1px solid var(--border); }
.footer-content { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; width: 100%; }
.footer-left { display: flex; flex-direction: column; gap: 4px; }
.footer-logo { width: 13.75rem; height: auto; opacity: 0.7; }
.footer-center { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-center-tagline { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-tagline { font-size: 0.875rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 24px; justify-self: end; }
.footer-links a { font-size: 0.875rem; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr; text-align: center; gap: 32px; }
    .footer-left { align-items: center; order: 3; }
    .footer-center { order: 2; }
    .footer-links { justify-self: center; order: 1; }
    .footer-logo { width: 10rem; }
}
@media (max-width: 640px) {
    footer { padding: 32px 0; }
    .footer-content { gap: 24px; }
    .footer-logo { width: 8rem; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
}
