/* ============================================================
   blog-post.css  —  Universal blog post stylesheet
   Drop <link rel="stylesheet" href="../blog-post.css"> in
   every post's <head> and remove any inline <style> blocks.
   ============================================================ */

/* ─── RESET & BASE ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --bg:              #ffffff;
    --surface:         #f5f5f7;
    --surface-2:       #e8e8ed;
    --text-primary:    #1d1d1f;
    --text-secondary:  #6e6e73;
    --text-tertiary:   #aeaeb2;
    --accent:          #0071e3;
    --accent-hover:    #0077ed;
    --border:          rgba(0,0,0,0.08);
    --radius:          12px;
    --radius-sm:       8px;
    --font-sans:       -apple-system, 'SF Pro Text', 'SF Pro Display',
                       BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-serif:      'Georgia', 'Times New Roman', serif;
    --content-width:   680px;
    --wide-width:      980px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ─── NAV ─── */
nav,
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 22px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-brand {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-back:hover { opacity: 0.75; }

.nav-back svg {
    width: 14px; height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.menu-toggle:hover { background: var(--surface); }

.menu-toggle svg {
    width: 20px; height: 20px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    display: block;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 8px 22px 16px;
    gap: 2px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
    padding: 10px 12px;
    font-size: 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.mobile-menu a:hover { background: var(--surface); }

/* ─── ARTICLE WRAPPER ─── */
.container,
article,
main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 64px 24px 100px;
}

/* ─── POST HEADER ─── */
/* Maps to: .date, <b> title, .mood-note */

.date,
p.date {
    display: block;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-family: var(--font-sans);
    font-style: normal !important;
}

/* The bold title paragraph */
p b,
p strong {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
    display: block;
    margin-bottom: 12px;
    font-family: var(--font-sans);
}

/* Mood / subtitle note */
.mood-note,
p.mood-note {
    font-size: 14px;
    font-style: italic !important;
    color: var(--accent);
    margin-bottom: 48px;
    font-family: var(--font-sans);
    opacity: 0.85;
}

/* Divider after header */
p.mood-note::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--border);
    margin-top: 24px;
}

/* ─── BODY TYPOGRAPHY ─── */
p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 28px;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}

/* Drop-cap on first content paragraph */
p.text-content:first-of-type::first-letter,
.container > p:nth-of-type(4)::first-letter {
    font-size: 3.6em;
    font-weight: 600;
    float: left;
    line-height: 0.8;
    margin: 6px 10px 0 0;
    color: var(--text-primary);
}

/* Italic / em — editorial emphasis */
em, i {
    font-style: italic;
    color: var(--text-secondary);
}

/* Bold / strong — key callout */
b, strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Standalone em that looks like a pull-quote */
p > em:only-child,
p > i:only-child {
    display: block;
    font-size: 20px;
    font-style: italic;
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
    padding: 12px 0 12px 20px;
    margin: 36px 0;
    line-height: 1.5;
    opacity: 0.9;
}

/* ─── BLOCKQUOTE ─── */
blockquote,
.quote {
    margin: 40px 0;
    padding: 20px 24px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.7;
}

/* ─── HEADINGS (in case posts use h2, h3) ─── */
h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 20px; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 48px 0 16px; }
h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; margin: 36px 0 12px; }

/* ─── LINKS ─── */
a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover { opacity: 0.75; text-decoration: underline; }

/* ─── HORIZONTAL RULE ─── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* ─── CODE ─── */
code {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

pre {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 24px;
    overflow-x: auto;
    margin: 32px 0;
    border: 1px solid var(--border);
}

pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ─── IMAGES ─── */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
    margin: 40px auto;
}

/* ─── POST FOOTER / BACK LINK ─── */
.post-footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.post-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-footer svg {
    width: 14px; height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ─── SITE FOOTER ─── */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 40px 22px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.footer-col a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p { font-size: 13px; color: var(--text-tertiary); }
.footer-bottom a { font-size: 13px; color: var(--accent); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

/* ─── PAGE LOAD ANIMATION ─── */
.container,
article,
main {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeUp 0.55s ease forwards 0.1s;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    body { font-size: 17px; }

    .container, article, main {
        padding: 48px 20px 80px;
    }

    .nav-links { display: none; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    p b, p strong { font-size: 28px; }

    p > em:only-child, p > i:only-child {
        font-size: 18px;
    }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
