/* ─── Blog list page ───────────────────────────────────────── */

.blog-hero {
    background-color: var(--bg-alt);
    padding: clamp(4rem, 10vw, 7rem) 0 1.5rem;
}

.blog-hero__title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    text-align: center;
}

.blog-hero__sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    text-align: center;
}

/* ─── Post grid ───────────────────────────────────────────── */

.blog-body {
    background-color: var(--bg-alt);
    padding: 2rem 0 clamp(4rem, 8vw, 6rem);
    min-height: 60vh;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.blog-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.blog-card__meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.blog-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.blog-card:hover .blog-card__title {
    color: var(--accent);
}

.blog-card__excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.blog-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: auto;
}

.blog-card__cta svg {
    transition: transform 0.2s ease;
}

.blog-card:hover .blog-card__cta svg {
    transform: translateX(3px);
}

/* ─── Empty state ─────────────────────────────────────────── */

.blog-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem 0;
    font-size: 1rem;
}

/* ─── Blog detail page ────────────────────────────────────── */

.blog-detail-page {
    background: var(--bg-alt);
}

/* Article hero */
.article-hero {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: clamp(4rem, 10vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.article-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.article-hero__back:hover {
    color: var(--accent);
}

.article-hero__back svg {
    transition: transform 0.2s ease;
}

.article-hero__back:hover svg {
    transform: translateX(-3px);
}

.article-hero__title {
    font-size: clamp(1.75rem, 4.5vw, 3rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    max-width: 820px;
}

.article-hero__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.article-hero__meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

/* Article body */
.article-body {
    padding: clamp(3rem, 7vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
}

.article-inner {
    max-width: 760px;
}

/* Prose typography */
.prose {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose h2 {
    font-size: clamp(1.3rem, 3vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 2.5rem 0 1rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--accent);
    display: inline-block;
}

.prose h2:first-child {
    margin-top: 0;
}

.prose h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 2rem 0 0.75rem;
}

.prose ul,
.prose ol {
    margin: 1rem 0 1.5rem;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prose ul li,
.prose ol li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.prose ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.prose ol {
    counter-reset: prose-counter;
}

.prose ol li {
    counter-increment: prose-counter;
}

.prose ol li::before {
    content: counter(prose-counter) '.';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
}

.prose blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.75rem 0;
    padding: 1rem 1.25rem;
    background: rgba(255, 92, 91, 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.97rem;
    color: var(--text);
    line-height: 1.7;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
}

.prose table thead th {
    background: var(--text);
    color: #fff;
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.prose table thead th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.prose table thead th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.prose table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.025);
}

.prose table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}

.prose strong {
    font-weight: 700;
    color: var(--text);
}

.prose em {
    font-style: italic;
    color: var(--text-muted);
}

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

.prose a:hover {
    color: var(--accent-hover);
}

/* Tags */
.article-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.article-tags__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

.article-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.25rem 0.75rem;
}

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card {
        padding: 1.5rem;
    }

    .article-hero__title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .prose {
        font-size: 1rem;
    }

    .prose h2 {
        font-size: 1.25rem;
    }
}
