/* ==========================================================================
   Blog styles — shared by blog/index.html and every blog post page.

   This file is COPIED to blog/blog.css by the build script. Edit it HERE,
   in tools/blog.css, then re-run the build. Editing blog/blog.css directly
   works until the next build overwrites it.

   Tokens, nav, buttons and footer are kept identical to the main site.
   ========================================================================== */

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

:root {
    --mauve: #6b4c5e;
    --rose: #c27a7a;
    --sage: #8a9e8a;
    --blue: #4f6a7d;          /* soft dusty blue — the blog listing accent */
    --blue-soft: #8ba3b5;     /* the same blue, lightened for borders/tints */
    --terracotta: #c4785b;
    --cream: #fdf8f4;
    --alt-cream: #f5ede5;
    --brown: #3d2c2e;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(107,76,94,0.08);
    --shadow-hover: 0 6px 24px rgba(107,76,94,0.15);
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito Sans', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--brown);
    background: var(--cream);
    line-height: 1.75;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--mauve);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rose), var(--terracotta));
    z-index: 10000;
    width: 0%;
    transition: width 0.1s ease;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; color: var(--mauve); }

/* ── Header / Nav (identical to main site) ─────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(253,248,244,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(107,76,94,0.08);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}
.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--mauve);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.nav-logo .accent { color: var(--rose); font-style: italic; }
.nav-links { display: flex; list-style: none; gap: 32px; align-items: center; }
.nav-links a {
    text-decoration: none;
    color: var(--brown);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--rose); }
.nav-links a[aria-current="page"] { color: var(--rose); }
.nav-links .btn { padding: 10px 24px; font-size: 0.85rem; }

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}
.hamburger svg { width: 24px; height: 24px; stroke: var(--mauve); }

/* ── Buttons (identical to main site) ──────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 44px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: #b56a4e; }
.btn-secondary { background: transparent; color: var(--mauve); border: 2px solid var(--mauve); }
.btn-secondary:hover { background: var(--mauve); color: var(--white); }

/* ── Page / post header ────────────────────────────────────────────────── */
.page-header, .post-header {
    background: var(--alt-cream);
    padding: 56px 0 48px;
    border-bottom: 1px solid rgba(107,76,94,0.08);
}
.post-header { padding: 48px 0 44px; }
.page-header-inner, .post-header-inner { max-width: 780px; }

.breadcrumb {
    font-size: 0.85rem;
    color: #6b5a5c;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}
.breadcrumb a { color: var(--mauve); text-decoration: none; font-weight: 600; transition: color 0.2s ease; }
.breadcrumb a:hover { color: var(--rose); }
.breadcrumb .sep { margin: 0 10px; color: #c9b5b8; }

.page-header { background: linear-gradient(180deg, #eef2f5 0%, #f4f0ea 100%); }
.page-header h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 16px; color: var(--blue); }
.page-header .lede {
    font-size: 1.15rem;
    color: #5a4042;
    line-height: 1.7;
    max-width: 680px;
}
.post-header h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); margin: 16px 0 20px; }

/* ── Category tag ──────────────────────────────────────────────────────── */
.cat-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: #8e4848;
    background: rgba(194,122,122,0.12);
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}
a.cat-tag:hover { background: rgba(194,122,122,0.22); }

/* ── Author block ──────────────────────────────────────────────────────── */
.author-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(107,76,94,0.12);
}
.author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.author-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--mauve);
    line-height: 1.3;
}
.author-detail { font-size: 0.85rem; color: #6b5a5c; line-height: 1.4; }

/* ── Blog index: filters ───────────────────────────────────────────────── */
.filter-bar { padding: 32px 0 8px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.filter-btn {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--blue);
    background: transparent;
    border: 2px solid rgba(79,106,125,0.25);
    border-radius: 100px;
    padding: 9px 20px;
    min-height: 40px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.filter-btn:hover { border-color: var(--blue); background: rgba(79,106,125,0.08); }
.filter-btn[aria-pressed="true"] {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

/* ── Blog index: layout ────────────────────────────────────────────────── */
.blog-main { padding: 24px 0 72px; }
.post-count { font-size: 0.85rem; color: #6b5a5c; margin-bottom: 28px; }

.featured-card {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--blue);
    padding: 44px 48px;
    margin-bottom: 40px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.featured-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.featured-tags .cat-tag { margin-bottom: 0; }
.featured-flag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8a7477;
}
.featured-card h2 {
    color: var(--blue);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    margin-bottom: 14px;
    max-width: 20ch;
}
.featured-card .excerpt {
    font-size: 1.08rem;
    color: #5a4042;
    line-height: 1.7;
    max-width: 62ch;
    margin-bottom: 22px;
}
.featured-card .card-foot {
    border-top: none;
    padding-top: 0;
    justify-content: flex-start;
    gap: 24px;
}

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 30px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-card .card-title { font-size: 1.45rem; margin-bottom: 12px; line-height: 1.3; color: var(--blue); }
.post-card .excerpt {
    font-size: 0.95rem;
    color: #6b5a5c;
    line-height: 1.65;
    flex: 1;
    margin-bottom: 20px;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(107,76,94,0.1);
    padding-top: 16px;
    margin-top: auto;
}
.post-meta { font-size: 0.8rem; color: #8a7477; letter-spacing: 0.2px; }
.read-more {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--terracotta);
    white-space: nowrap;
}
.read-more .arrow { display: inline-block; transition: transform 0.2s ease; }
.post-card:hover .read-more .arrow,
.featured-card:hover .read-more .arrow { transform: translateX(4px); }

/* Cards hidden by the filter / Load More must not hold a grid cell. */
.post-card[hidden], .featured-card[hidden] { display: none; }

/* ── Subscribe card (always last in the grid) ──────────────────────────── */
.subscribe-card {
    display: flex;
    flex-direction: column;
    background: var(--blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 30px;
    color: rgba(255,255,255,0.82);
}
.subscribe-card .subscribe-title { color: var(--white); font-size: 1.45rem; margin-bottom: 10px; }
.subscribe-card p { font-size: 0.92rem; line-height: 1.6; margin-bottom: 18px; }
.subscribe-card .cat-tag { color: #ffffff; background: rgba(255,255,255,0.15); }
.subscribe-form { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.subscribe-form input {
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.92rem;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    min-height: 44px;
    transition: border-color 0.2s ease;
}
.subscribe-form input::placeholder { color: rgba(255,255,255,0.55); }
.subscribe-form input:focus {
    border-color: var(--white);
    outline: 3px solid var(--blue-soft);
    outline-offset: 2px;
}
.subscribe-form .btn { width: 100%; text-align: center; padding: 13px 20px; }
.subscribe-form .btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.subscribe-form .form-status { font-size: 0.85rem; line-height: 1.5; min-height: 1.4em; }
.subscribe-form .form-status.success { color: #bde5c8; font-weight: 600; }
.subscribe-form .form-status.error { color: #ffc9c9; font-weight: 600; }

/* ── Load more / empty ─────────────────────────────────────────────────── */
.load-more-wrap { text-align: center; margin-top: 44px; }
.load-more-wrap .btn-secondary { color: var(--blue); border-color: var(--blue); }
.load-more-wrap .btn-secondary:hover { background: var(--blue); color: var(--white); }
.empty-state {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 32px;
    text-align: center;
    color: #6b5a5c;
}
.empty-state h2 { margin-bottom: 8px; font-size: 1.6rem; color: var(--blue); }

/* ── Post: two-column layout ───────────────────────────────────────────── */
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 60px;
    align-items: start;
    padding: 48px 0 64px;
}

.article-body { max-width: 72ch; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin-bottom: 22px; color: #4a3a3c; }
.article-body h2 {
    font-size: clamp(1.55rem, 2.6vw, 1.95rem);
    margin: 44px 0 16px;
    scroll-margin-top: 96px;
}
.article-body h3 { font-size: 1.3rem; margin: 32px 0 12px; scroll-margin-top: 96px; }
.article-body ul, .article-body ol { margin: 0 0 24px 22px; }
.article-body li { margin-bottom: 10px; color: #4a3a3c; }
.article-body a { color: var(--terracotta); font-weight: 600; }
.article-body strong { color: var(--mauve); }
.article-body img { border-radius: var(--radius); margin: 32px 0; box-shadow: var(--shadow); }

.article-body .sparkle-divider {
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 0.95rem;
    margin: 40px 0 36px;
    line-height: 1;
}

.article-body ul.sparkle-list { list-style: none; margin-left: 0; }
.article-body ul.sparkle-list li { position: relative; padding-left: 30px; }
.article-body ul.sparkle-list li::before {
    content: "\2728";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9em;
}

.article-body .signoff {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--mauve);
    margin: 40px 0 0;
}

.article-body .post-ps {
    margin-top: 36px;
    padding: 26px 30px;
    background: var(--alt-cream);
    border-radius: var(--radius);
    border-left: 4px solid var(--terracotta);
}
.article-body .post-ps p { font-size: 0.95rem; line-height: 1.7; margin-bottom: 14px; }
.article-body .post-ps p:last-child { margin-bottom: 0; }

.article-body .pullquote {
    margin: 40px 0;
    padding: 28px 32px;
    border-left: 4px solid var(--rose);
    background: var(--alt-cream);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body .pullquote p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--mauve);
    margin-bottom: 0;
}

.post-footer {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid rgba(107,76,94,0.12);
}
.tag-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: #8a7477;
    margin-bottom: 14px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.back-link {
    display: inline-block;
    margin-top: 32px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--terracotta);
    text-decoration: none;
}
.back-link:hover { color: var(--mauve); }

/* ── Post: sticky sidebar ──────────────────────────────────────────────── */
.post-sidebar { position: sticky; top: 96px; }

.toc-card, .cta-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
}
.toc-card { margin-bottom: 24px; }
.toc-card h2, .cta-card h2 {
    font-size: 0.78rem;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #8a7477;
    margin-bottom: 16px;
}
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 4px; }
.toc-list a {
    display: block;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #5a4042;
    text-decoration: none;
    padding: 7px 0 7px 14px;
    border-left: 2px solid rgba(107,76,94,0.12);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-list a:hover { color: var(--rose); border-left-color: var(--rose); }
.toc-list a.active { color: var(--mauve); font-weight: 700; border-left-color: var(--terracotta); }

.cta-card { background: var(--mauve); color: rgba(255,255,255,0.82); text-align: center; }
.cta-card h2 { color: rgba(255,255,255,0.6); }
.cta-card .cta-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 10px;
}
.cta-card p { font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; }
.cta-card .btn { width: 100%; text-align: center; padding: 13px 18px; font-size: 0.85rem; }

/* ── Footer (identical to main site) ───────────────────────────────────── */
.site-footer {
    background: var(--brown);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 32px;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}
.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}
.footer-brand .accent { color: #e8a8a8; font-style: italic; }
.footer-grid p { font-size: 0.9rem; line-height: 1.6; }
.footer-grid h4 {
    font-family: var(--font-heading);
    color: var(--white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--rose); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.8rem;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-layout { grid-template-columns: 1fr; gap: 40px; }
    .post-sidebar { position: static; }
    .toc-card { display: none; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--cream);
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid rgba(107,76,94,0.1);
        box-shadow: var(--shadow);
    }
    .hamburger { display: flex; }
    .page-header { padding: 40px 0 32px; }
    .post-header { padding: 36px 0 32px; }
    .post-layout { padding: 36px 0 48px; }
    .post-grid { grid-template-columns: 1fr; }
    .featured-card { padding: 32px 24px; }
    .article-body .pullquote { padding: 24px 20px; }
    .article-body .pullquote p { font-size: 1.15rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .post-card, .subscribe-card { padding: 26px 22px; }
    .cta-card, .toc-card { padding: 24px 22px; }
    .filter-btn { padding: 8px 16px; font-size: 0.72rem; }
}

@media (max-width: 360px) {
    h1 { font-size: 1.9rem; }
    .btn { padding: 14px 20px; font-size: 0.88rem; letter-spacing: 0.3px; }
    .nav-logo { font-size: 1.3rem; }
    .article-body .pullquote { padding: 22px 18px; }
    .article-body .pullquote p { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .post-card, .featured-card, .read-more .arrow, .toc-list a { transition: none; }
    .scroll-progress { transition: none; }
}
