/* ---------- FONT ---------- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap');

/* ---------- DESIGN TOKENS ---------- */
:root {
    /* Core palette — from design system */
    --primary:          #1A3D24;
    --primary-dark:     #122a19;
    --on-primary:       #F5F0E4;
    --gold:             #C8A030;
    --gold-hover:       #a8871f;
    --on-gold:          #0F2010;
    --surface:          #ffffff;
    --surface-variant:  #EDE8D8;
    --background:       #F5F0E4;
    --on-surface:       #0F2010;
    --muted:            #7A6A40;
    --outline:          #C8B870;
    --outline-variant:  #D8C890;
    --positive:         #1A6A2A;
    --positive-light:   #85BB65;
    --negative:         #B83232;

    --shadow-sm: 0 1px 3px rgba(15,32,16,.08), 0 1px 2px rgba(15,32,16,.04);
    --shadow-md: 0 4px 12px rgba(15,32,16,.10), 0 2px 4px rgba(15,32,16,.06);
    --shadow-lg: 0 12px 32px rgba(15,32,16,.14), 0 4px 8px rgba(15,32,16,.07);
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --container: 1100px;
    font-synthesis: none;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Sora', sans-serif;
    color: var(--on-surface);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- CONTAINER ---------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- SITE HEADER (injected by blog-layout.js) ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    border-bottom: 1px solid rgba(245,240,228,.12);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--on-primary);
    letter-spacing: -0.01em;
}
.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
    list-style: none;
}
.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(245,240,228,.65);
    padding: 6px 10px;
    border-radius: var(--r-sm);
    transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--on-primary); background: rgba(245,240,228,.1); }
.nav-links a.nav-active { color: var(--on-primary); font-weight: 600; }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:active { transform: scale(0.97); }
.btn-ghost {
    background: transparent;
    color: rgba(245,240,228,.75);
    border-color: rgba(245,240,228,.25);
}
.btn-ghost:hover {
    background: rgba(245,240,228,.1);
    color: var(--on-primary);
    border-color: rgba(245,240,228,.4);
}
.btn-primary {
    background: var(--gold);
    color: var(--on-gold);
    border-color: var(--gold);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(200,160,48,.3);
}
.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    box-shadow: 0 4px 14px rgba(200,160,48,.4);
}
.mobile-toggle {
    display: none;
    border: 1.5px solid rgba(245,240,228,.25);
    background: transparent;
    padding: 7px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--on-primary);
    transition: background 0.15s;
}
.mobile-toggle:hover { background: rgba(245,240,228,.1); }
.mobile-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- SITE FOOTER (injected by blog-layout.js) ---------- */
.site-footer {
    margin-top: 60px;
    padding: 28px 0 36px;
    border-top: 1px solid var(--outline-variant);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-copy { font-size: 0.875rem; color: var(--muted); }
.footer-copy strong { color: var(--on-surface); font-weight: 600; }
.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a {
    font-size: 0.875rem;
    color: var(--muted);
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--on-surface); }

/* ---------- SHARED TAG PILLS ---------- */
.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.post-tag--article { background: rgba(26,61,36,.1); color: var(--primary); }
.post-tag--update  { background: rgba(200,160,48,.15); color: var(--gold-hover); }
.post-tag--on-dark {
    background: rgba(245,240,228,.14);
    color: rgba(245,240,228,.85);
    border: 1px solid rgba(245,240,228,.18);
}

/* ---------- SHARED POST META ---------- */
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}
.post-meta-dot {
    width: 3px;
    height: 3px;
    background: var(--outline-variant);
    border-radius: 50%;
}

/* ---------- BLOG LISTING PAGE ---------- */
.blog-page-header { padding: 40px 0 28px; }
.section-eyebrow {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-hover);
    margin-bottom: 8px;
}
.section-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    color: var(--on-surface);
    margin-bottom: 8px;
}
.section-sub {
    font-size: 0.98rem;
    color: var(--muted);
    line-height: 1.65;
    max-width: 520px;
}

/* Featured post */
.blog-featured { margin-bottom: 16px; }
.blog-featured-panel {
    background: linear-gradient(140deg, var(--primary) 0%, #122a19 100%);
    border-radius: var(--r-xl);
    padding: 36px 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.blog-featured-panel::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: rgba(200,160,48,.12);
    border-radius: 50%;
    pointer-events: none;
}
.blog-featured-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--on-primary);
    margin: 10px 0 12px;
    max-width: 600px;
    position: relative;
}
.blog-featured-excerpt {
    font-size: 1rem;
    color: rgba(245,240,228,.68);
    line-height: 1.6;
    max-width: 540px;
    margin-bottom: 20px;
    position: relative;
}
.blog-featured-panel .post-meta {
    color: rgba(245,240,228,.45);
    margin-bottom: 20px;
    position: relative;
}
.blog-featured-panel .post-meta-dot { background: rgba(245,240,228,.28); }
.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    transition: color 0.15s;
    position: relative;
}
.blog-read-more:hover { color: var(--on-primary); }

/* Card grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 60px;
}
.blog-card {
    background: var(--surface);
    border: 1px solid var(--outline-variant);
    border-radius: var(--r-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--on-surface);
    line-height: 1.3;
    letter-spacing: -0.015em;
}
.blog-card-excerpt {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}
.blog-card .blog-read-more { color: var(--primary); margin-top: 4px; }
.blog-card .blog-read-more:hover { color: var(--primary-dark); }

/* ---------- INDIVIDUAL POST PAGE ---------- */
.post-page { min-height: 70vh; }
.post-hero {
    background: linear-gradient(140deg, var(--primary) 0%, #122a19 100%);
    padding: 48px 0 44px;
    position: relative;
    overflow: hidden;
}
.post-hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: rgba(200,160,48,.1);
    border-radius: 50%;
    pointer-events: none;
}
.post-hero-inner { position: relative; }
.post-breadcrumb {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(245,240,228,.5);
    margin-bottom: 16px;
    transition: color 0.15s;
}
.post-breadcrumb:hover { color: rgba(245,240,228,.85); }
.post-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--on-primary);
    margin: 12px 0 16px;
    max-width: 760px;
}
.post-hero .post-meta { color: rgba(245,240,228,.45); }
.post-hero .post-meta-dot { background: rgba(245,240,228,.28); }

/* Post body */
.post-body { padding: 48px 0 60px; }
.prose { max-width: 680px; }
.prose p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--on-surface);
    margin-bottom: 1.4rem;
}
.prose h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--on-surface);
    margin: 2.4rem 0 0.8rem;
    line-height: 1.2;
}
.prose h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--on-surface);
    margin: 1.8rem 0 0.6rem;
    line-height: 1.3;
}
.prose ul, .prose ol {
    margin: 0 0 1.4rem 1.4rem;
    color: var(--on-surface);
}
.prose li {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
}
.prose blockquote {
    border-left: 3px solid var(--gold);
    padding: 12px 20px;
    margin: 1.8rem 0;
    background: var(--surface-variant);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--on-surface);
    font-size: 1.05rem;
    line-height: 1.7;
}
.prose code {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
    font-size: 0.9em;
    background: var(--surface-variant);
    color: var(--on-surface);
    padding: 2px 6px;
    border-radius: 4px;
}
.prose a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--primary-dark); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .blog-featured-panel { padding: 28px 28px 32px; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .blog-page-header { padding: 24px 0 20px; }
    .blog-featured-panel { padding: 24px 20px; }
    .blog-grid { grid-template-columns: 1fr; }
    .post-hero { padding: 32px 0 28px; }
    .post-title { font-size: 1.8rem; }
    .prose h2 { font-size: 1.25rem; }
    .nav { display: none; }
    .mobile-toggle { display: inline-flex; }
}

/* Mobile nav overlay */
.nav.nav--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--primary);
    z-index: 99;
    padding: 20px 16px;
    gap: 0;
    border-top: 1px solid rgba(245,240,228,.12);
    overflow-y: auto;
}
.nav.nav--open .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border-bottom: 1px solid rgba(245,240,228,.12);
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.nav.nav--open .nav-links a {
    font-size: 1rem;
    padding: 11px 12px;
    display: block;
}
.nav.nav--open .nav-actions {
    flex-direction: column;
    gap: 8px;
}
.nav.nav--open .nav-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.98rem;
}

/* ---------- POST CTA ---------- */
.post-cta {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--outline-variant);
    font-size: 0.95rem;
    color: var(--on-surface);
}
.post-cta a {
    color: var(--primary);
    font-weight: 600;
}
.post-cta a:hover { text-decoration: underline; }
