/* ============================================
   BLOG — index listing + post pages
   Rides entirely on the tokens in /css/shared.css. No new colors, no new
   fonts: a post page and the home page must read as one site, and the theme
   toggle has to work on both without either knowing about the other.
   ============================================ */

.blog-wrap,
.post-wrap {
    width: var(--s-container);
    margin: 0 auto;
    padding: 140px 0 var(--s-section);
}

/* ── Index header ───────────────────────────── */
.blog-head {
    max-width: 720px;
    margin-bottom: clamp(48px, 7vw, 80px);
}
.blog-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.7;
    color: var(--c-accent);
    margin-bottom: 1.2rem;
}
.blog-title {
    font-family: var(--f-serif);
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.1rem;
}
.blog-title em { font-style: italic; color: var(--c-accent); }
.blog-sub {
    font-size: clamp(1rem, 1.5vw, 1.14rem);
    color: var(--c-text-2);
    line-height: 1.7;
    font-weight: 300;
    max-width: 580px;
}

/* ── Post list ──────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: clamp(20px, 4vw, 48px);
    padding: clamp(24px, 3.5vw, 38px) 0;
    border-top: 1px solid var(--c-border);
    transition: opacity var(--duration-fast) ease;
}
.post-card:last-child { border-bottom: 1px solid var(--c-border); }

.post-card-date {
    font-size: 0.82rem;
    color: var(--c-text-3);
    letter-spacing: 0.02em;
    padding-top: 0.35rem;
}
.post-card-title {
    font-family: var(--f-serif);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.7rem;
}
.post-card-title a {
    color: var(--c-text);
    text-decoration: none;
    background-image: linear-gradient(var(--c-accent), var(--c-accent));
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--duration-fast) var(--ease-out), color var(--duration-fast) ease;
}
.post-card:hover .post-card-title a,
.post-card-title a:focus-visible {
    color: var(--c-accent);
    background-size: 100% 1px;
}
.post-card-desc {
    color: var(--c-text-2);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 300;
    max-width: 60ch;
}
.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}
.post-tag {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-accent-text);
    background: var(--c-accent-soft);
    border-radius: var(--radius-pill);
    padding: 0.28rem 0.7rem;
}

.blog-empty {
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--radius);
    padding: clamp(36px, 6vw, 64px);
    text-align: center;
    color: var(--c-text-2);
    font-weight: 300;
}

/* ── Post page ──────────────────────────────── */
.post { max-width: 68ch; margin: 0 auto; }

.post-back { margin-bottom: 2.2rem; }
.post-back a {
    font-size: 0.86rem;
    color: var(--c-text-3);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}
.post-back a:hover { color: var(--c-accent); }

.post-head { margin-bottom: clamp(32px, 5vw, 52px); }
.post-head h1 {
    font-family: var(--f-serif);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.post-meta {
    font-size: 0.86rem;
    color: var(--c-text-3);
    letter-spacing: 0.02em;
}

.post-lead {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    margin-bottom: clamp(32px, 5vw, 48px);
}

/* Body copy. Generous measure and leading — these posts are meant to be read,
   not skimmed, and the serif headings carry the rhythm. */
.post-body { font-size: 1.06rem; line-height: 1.8; color: var(--c-text-2); font-weight: 300; }
.post-body > * + * { margin-top: 1.4em; }
.post-body h2,
.post-body h3,
.post-body h4 {
    font-family: var(--f-serif);
    font-weight: 400;
    color: var(--c-text);
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-top: 2.4em;
}
.post-body h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.post-body h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.post-body h4 { font-size: 1.15rem; }
.post-body strong { color: var(--c-text); font-weight: 500; }
.post-body a {
    color: var(--c-accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--c-border-strong);
    transition: text-decoration-color var(--duration-fast) ease;
}
.post-body a:hover { text-decoration-color: var(--c-accent); }
/* shared.css resets `ul { list-style: none }` site-wide for the nav lists, so
   prose lists have to ask for their markers back explicitly. Without this the
   bullets vanish and a list reads as three orphaned indented lines. */
.post-body ul { list-style: disc; padding-left: 1.4em; }
.post-body ol { list-style: decimal; padding-left: 1.4em; }
.post-body li + li { margin-top: 0.5em; }
.post-body li::marker { color: var(--c-text-3); }
.post-body code {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    font-size: 0.88em;
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-xs);
    padding: 0.12em 0.4em;
}
.post-body pre {
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
}
.post-body pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.86rem;
    line-height: 1.65;
}
.post-body blockquote {
    border-left: 2px solid var(--c-accent);
    padding-left: 1.3rem;
    color: var(--c-text-2);
    font-style: italic;
}
.post-body blockquote p { margin: 0; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.post-foot {
    margin-top: clamp(48px, 7vw, 76px);
    padding-top: 1.8rem;
    border-top: 1px solid var(--c-border);
    font-size: 0.9rem;
    color: var(--c-text-3);
}
/* Underlined, not just tinted: these sit inside a sentence, and colour alone
   fails WCAG 1.4.1 (axe link-in-text-block) for anyone who can't distinguish it. */
.post-foot a {
    color: var(--c-accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

@media (max-width: 640px) {
    .blog-wrap,
    .post-wrap { padding-top: 110px; }
    .post-card { grid-template-columns: 1fr; gap: 0.5rem; }
    .post-card-date { padding-top: 0; }
}
