/* Blog: text-first list and reading pages. Builds on site.css tokens. */

.page-blog main,
.page-post main { gap: clamp(4rem, 8vw, 6rem); }

/* ---------- Shared post meta ---------- */

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    font-size: var(--text-sm);
    color: var(--muted);
}

.post-meta > * + *::before {
    content: "·";
    margin: 0 0.5rem;
}

/* ---------- Masthead ---------- */

.blog { max-width: 56rem; }

.blog-masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(3rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    border-bottom: 1px solid var(--surface-2);
}

.blog-masthead__eyebrow {
    margin-bottom: var(--element-gap);
    font-size: var(--text-sm);
    line-height: 1;
    color: var(--accent);
}

.blog-masthead__title {
    font-size: clamp(3.5rem, 12vw, 8.5rem);
    line-height: 0.8;
}

.blog-masthead__tagline {
    max-width: 34ch;
    margin-top: var(--element-gap);
    font-size: var(--text-md);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--muted);
}

.blog-masthead__byline {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.blog-masthead__byline img,
.post-header__byline img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 35%;
}

/* ---------- Featured post ---------- */

.post-featured { padding: clamp(2rem, 5vw, 3.5rem) 0; border-bottom: 1px solid var(--surface-2); }

.post-featured__link {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.post-featured__thumb {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

.post-featured__thumb img,
.post-row__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms var(--ease-out);
}

.post-featured__eyebrow {
    margin-bottom: 1rem;
    font-size: var(--text-sm);
    line-height: 1;
}

.post-featured__title {
    font-size: clamp(var(--text-2xl), 4.2vw, var(--text-3xl));
    line-height: 0.88;
    transition: color 200ms ease-out;
}

.post-featured__subtitle {
    margin: 1rem 0 1.25rem;
    font-size: var(--text-md);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--muted);
}

.post-featured__link:hover .post-featured__title { color: var(--accent); }

/* ---------- Topic filters ---------- */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.blog-filter {
    padding: 0.5rem 1rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 200ms ease-out;
}

.blog-filter:hover { background: #ebe9e9; }
.blog-filter.is-active { background: linear-gradient(to right, var(--lime), var(--surface-2)); }

/* ---------- Post list ---------- */

.post-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-row { border-bottom: 1px solid var(--surface-2); }
.post-row[hidden] { display: none; }

.post-row__link {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
    padding: 1.75rem 0;
}

.post-row__text { flex: 1; min-width: 0; }

.post-row__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    transition: color 200ms ease-out;
}

.post-row__subtitle {
    margin: 0.4rem 0 0.75rem;
    line-height: 1.45;
    color: var(--muted);
}

.post-row__title + .post-meta { margin-top: 0.75rem; }

.post-row__thumb {
    flex: 0 0 auto;
    width: clamp(5.5rem, 16vw, 8.5rem);
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-row__link:hover .post-row__title { color: var(--accent); }
.post-row__link:hover .post-row__thumb img,
.post-featured__link:hover .post-featured__thumb img { transform: scale(1.04); }

.blog-empty { padding: 3rem 0; text-align: center; color: var(--muted); }

/* ---------- Subscribe box ---------- */

.subscribe {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: clamp(3rem, 8vw, 5rem);
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    border-radius: clamp(2rem, 4vw, 3rem);
    background: radial-gradient(ellipse 70% 90% at 50% 100%, rgba(218, 255, 53, 0.55), rgba(89, 252, 249, 0.18) 55%, var(--surface-1) 85%);
    text-align: center;
}

.subscribe__title { font-size: var(--text-2xl); line-height: 0.9; }

.subscribe__copy { max-width: 42ch; color: var(--muted); }

.subscribe__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ---------- Homepage "Latest writing" ---------- */

.latest { max-width: 56rem; }

.latest__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-2);
}

.latest__title { font-size: var(--text-2xl); line-height: 0.9; }

/* ---------- Post page ---------- */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    height: 3px;
    pointer-events: none;
}

.reading-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--lime));
    transform-origin: 0 50%;
    transform: scaleX(var(--progress, 0));
}

.post { max-width: 46rem; }

.post-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem);
}

.post-back {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--muted);
    transition: color 200ms ease-out;
}

.post-back:hover { color: var(--accent); }

.post-header__tags {
    margin-bottom: 1.25rem;
    font-size: var(--text-sm);
    line-height: 1;
    color: var(--accent);
}

.post-header__title {
    font-size: clamp(2.5rem, 7vw, var(--text-5xl));
    line-height: 0.86;
}

.post-header__subtitle {
    margin-top: 1.5rem;
    font-size: var(--text-lg);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: var(--muted);
}

.post-header__byline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--surface-2);
    border-bottom: 1px solid var(--surface-2);
}

.post-header__byline img { width: 2.5rem; height: 2.5rem; }
.post-header__author { font-weight: 500; font-size: 0.95rem; }

.post-cover {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

/* Prose */

.prose {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #2b2831;
}

.prose > * + * { margin-top: 1.4em; }

.prose h2,
.prose h3 {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ink);
}

.prose h2 { margin-top: 2.2em; font-size: var(--text-2xl); text-transform: uppercase; }
.prose h3 { margin-top: 1.8em; font-size: var(--text-lg); }

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.prose a:hover { text-decoration-thickness: 2px; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose ul,
.prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
    margin: 2em 0;
    padding: 0.25em 0 0.25em 1.25em;
    border-left: 4px solid var(--lime);
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.prose code {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: var(--surface-2);
    font-size: 0.88em;
}

.prose pre {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-xl);
    background: var(--ink);
    color: var(--ink-inverse);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
}

.prose pre code { padding: 0; background: none; font-size: inherit; }

.prose img { border-radius: var(--radius-xl); }

.prose hr {
    width: 4rem;
    height: 4px;
    margin: 3em auto;
    border: 0;
    border-radius: 2px;
    background: var(--lime);
}

/* Previous / next */

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: clamp(3rem, 8vw, 4.5rem);
    padding-top: 2rem;
    border-top: 1px solid var(--surface-2);
}

.post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-xl);
    background: var(--surface-2);
    transition: background-color 200ms ease-out;
}

.post-nav__item:last-child { text-align: right; }
.post-nav__item:hover { background: #ebe9e9; }
.post-nav__label { font-size: var(--text-sm); color: var(--muted); }
.post-nav__title { font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .post-featured__link { grid-template-columns: 1fr; }
    .post-row__link { align-items: flex-start; }
    .post-row__title { font-size: var(--text-md); }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav__item:last-child { text-align: left; }
}
