/* ============================================================
   Blog — extends the main editorial / Swiss-minimal theme
   Loaded AFTER css/style.css. Reuses all :root tokens.
   ============================================================ */

/* ---------- Page wrapper / spacing under fixed nav ---------- */
.blog-main { padding-top: clamp(7rem, 16vh, 10rem); }

/* ---------- Breadcrumbs ---------- */
.crumbs {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.crumbs a { color: var(--ink-3); transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-current] { color: var(--ink-2); }
.crumbs .sep { opacity: 0.5; }

/* ---------- Blog header ---------- */
.blog-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.blog-head__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0.6rem 0 0.8rem;
}
.blog-head__lead {
    font-size: 1.12rem;
    color: var(--ink-2);
    max-width: 56ch;
}

/* ---------- Tag filter ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: clamp(1.8rem, 4vw, 2.4rem) 0 clamp(2rem, 4vw, 2.8rem);
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
}
.filter {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-2);
    background: var(--surface);
    cursor: pointer;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.filter:hover { color: var(--accent); border-color: var(--accent); }
.filter.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter__count { opacity: 0.55; margin-left: 0.35rem; }

/* ---------- Post grid ---------- */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
}
@media (min-width: 680px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.5rem 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.post-card.is-hidden { display: none; }

.post-card__date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.post-card__title {
    font-size: 1.22rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0.6rem 0 0.6rem;
}
.post-card__title a { transition: color 0.2s var(--ease); }
.post-card:hover .post-card__title a { color: var(--accent); }
.post-card__excerpt {
    font-size: 0.96rem;
    color: var(--ink-2);
    flex: 1 1 auto;
    margin-bottom: 1.1rem;
}
.post-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* reuse .tag from style.css for consistency */

.post-card__more {
    margin-top: 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ---------- Empty state ---------- */
.posts-empty {
    display: none;
    padding: 3rem 0;
    color: var(--ink-3);
    font-size: 1rem;
}
.posts-empty.is-shown { display: block; }

/* ============================================================
   Single article
   ============================================================ */
.article { max-width: 760px; margin-inline: auto; }

.article__header { margin-bottom: clamp(2rem, 5vw, 3rem); }
.article__meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-3);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    align-items: center;
    margin-bottom: 1rem;
}
.article__title {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 1rem;
}
.article__lead {
    font-size: 1.2rem;
    color: var(--ink-2);
    line-height: 1.6;
}
.article__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.4rem; }

/* Article body typography */
.article__body { font-size: 1.08rem; color: var(--ink); line-height: 1.75; }
.article__body > * + * { margin-top: 1.35rem; }
.article__body h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 2.6rem;
    line-height: 1.25;
}
.article__body h3 {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 600;
    margin-top: 2rem;
}
.article__body p { color: var(--ink-2); }
.article__body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s var(--ease);
}
.article__body a:hover { color: var(--accent-2); }
.article__body strong { color: var(--ink); font-weight: 600; }
.article__body ul, .article__body ol { padding-left: 1.4rem; color: var(--ink-2); }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body li + li { margin-top: 0.5rem; }
.article__body li::marker { color: var(--accent); }
.article__body blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 1rem 1.3rem;
    border-radius: 0 12px 12px 0;
    font-size: 1.12rem;
    color: var(--ink);
}
.article__body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.12em 0.4em;
}
.article__body pre {
    background: #16181d;
    color: #e8eaf0;
    border-radius: 12px;
    padding: 1.2rem 1.3rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
}
.article__body pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    color: inherit;
}
.article__body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.article__body figure figcaption {
    font-size: 0.85rem;
    color: var(--ink-3);
    text-align: center;
    margin-top: 0.6rem;
}
.article__body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Article footer / share / back */
.article__foot {
    max-width: 760px;
    margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.article__back {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s var(--ease);
}
.article__back:hover { color: var(--accent); }
.share { display: flex; gap: 0.6rem; }
.share a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink-2);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.share a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
