/* ── Blog-specific styles ─────────────────────────────── */

/* Nav links (used on blog pages) */
.nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav__link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav__link--active {
    color: var(--text-primary);
}

/* ── Blog index ───────────────────────────────────────── */
.blog-main {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 1.5rem 4rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.blog-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.blog-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 400px;
}

.substack-link {
    color: #a78bfa;
    text-decoration: none;
    transition: color 0.2s;
}

.substack-link:hover {
    color: #c4b5fd;
}

/* ── Year groups ──────────────────────────────────────── */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.year-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.year-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.no-posts {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 3rem 0;
}

/* ── Post cards ───────────────────────────────────────── */
.post-card {
    border-radius: 12px;
    transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-2px);
}

.post-card__link {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
}

.post-card__date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.post-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.post-card__desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.2rem;
}

.post-card__read {
    font-size: 0.8rem;
    color: #a78bfa;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.post-card:hover .post-card__read {
    color: #c4b5fd;
}

/* ── Individual post page ─────────────────────────────── */
.post-main {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 120px 1.5rem 5rem;
}

.post__header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post__date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.post__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.post__description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post__substack-link {
    display: inline-block;
    font-size: 0.8rem;
    color: #a78bfa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.post__substack-link:hover {
    color: #c4b5fd;
}

/* ── Post body typography ─────────────────────────────── */
.post__body {
    font-size: 1rem;
    line-height: 1.8;
    color: #c8c8d8;
}

.post__body p     { margin-bottom: 1.5em; }
.post__body h1,
.post__body h2,
.post__body h3,
.post__body h4    { color: var(--text-primary); font-weight: 700; margin: 2em 0 0.75em; line-height: 1.2; }
.post__body h1    { font-size: 1.75rem; }
.post__body h2    { font-size: 1.4rem; }
.post__body h3    { font-size: 1.15rem; }
.post__body h4    { font-size: 1rem; }

.post__body a {
    color: #a78bfa;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.post__body a:hover { color: #c4b5fd; }

.post__body strong { color: var(--text-primary); font-weight: 600; }
.post__body em     { font-style: italic; }

.post__body ul,
.post__body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5em;
}
.post__body li { margin-bottom: 0.4em; }

.post__body blockquote {
    border-left: 3px solid #6e56cf;
    margin: 1.5em 0;
    padding: 0.5em 1.25em;
    color: var(--text-muted);
    font-style: italic;
}

.post__body pre {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5em;
}

.post__body code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    color: #a78bfa;
    background: rgba(110, 86, 207, 0.12);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.post__body pre code {
    background: none;
    padding: 0;
    color: #c8c8d8;
}

.post__body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 1.5em 0;
    border: 1px solid var(--border);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
    .blog-main,
    .post-main { padding-top: 90px; }
    .post-card__link { padding: 1rem; }
}
