/* ─── Blog (listing + post) ─── */

/* Cards (listing + "Keep reading") */
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.bp-card {
    --cat: var(--vp-primary);
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border); border-radius: 18px;
    overflow: hidden; text-decoration: none; color: inherit;
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.bp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--cat); }
.bp-card-art { aspect-ratio: 16 / 7; background: #0a1512; overflow: hidden; }
.bp-card-art svg { display: block; width: 100%; height: 100%; transition: transform 600ms ease; }
.bp-card:hover .bp-card-art svg { transform: scale(1.04); }
.bp-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex-grow: 1; }
.bp-card-cat {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px;
}
.bp-card-cat svg { color: var(--cat); font-size: 16px; }
.bp-card h3 { font-size: 1.15rem; line-height: 1.38; color: var(--text); margin: 0 0 10px; font-weight: 700; }
.bp-card p { color: var(--text-muted); font-size: 0.93rem; line-height: 1.6; margin: 0 0 16px; flex-grow: 1; }
.bp-card-meta { font-size: 13px; color: var(--text-muted); margin-top: auto; }

/* Featured (first card on the unfiltered listing) */
@media (min-width: 900px) {
    .bp-card.is-featured { grid-column: span 2; }
    .bp-card.is-featured .bp-card-art { aspect-ratio: 16 / 6; }
    .bp-card.is-featured .bp-card-body { padding: 26px 30px 28px; }
    .bp-card.is-featured h3 { font-size: 1.55rem; }
}

/* Listing filters */
.bp-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 40px; }
.bp-filter {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: var(--radius-full);
    border: 1px solid var(--border-strong); color: var(--text); background: var(--card);
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.bp-filter svg { color: var(--cat, var(--vp-primary)); font-size: 16px; }
.bp-filter:hover { border-color: var(--cat, var(--vp-primary)); }
.bp-filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.bp-filter.is-active svg { color: inherit; }
.bp-filter small { opacity: 0.6; font-weight: 500; }

/* ── Post ── */
.bp-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9100; pointer-events: none; }
.bp-progress span { display: block; height: 100%; background: var(--cat); transform-origin: 0 50%; transform: scaleX(0); }

.bp-hero {
    position: relative; overflow: hidden;
    padding: 128px 0 64px;
    background:
        radial-gradient(900px 400px at 85% 30%, color-mix(in srgb, var(--cat) 28%, transparent), transparent 70%),
        linear-gradient(135deg, var(--cat-deep) 0%, #071210 100%);
    color: #f5f5dc;
}
.bp-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.bp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 22px; }
.bp-crumbs a { color: rgba(245,245,220,0.75); text-decoration: none; }
.bp-crumbs a:hover { color: #fff; }
.bp-crumbs .bp-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px 5px 10px; border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--cat) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat) 55%, transparent);
    color: #fff; font-weight: 600;
}
.bp-crumbs .bp-pill svg { color: var(--cat); font-size: 15px; }
.bp-hero h1 {
    color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.15;
    font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; text-align: left;
}
.bp-lede { font-size: 1.12rem; line-height: 1.6; color: rgba(245,245,220,0.82); margin: 0 0 24px; max-width: 560px; }
.bp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: rgba(245,245,220,0.7); }
.bp-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--cat); color: var(--cat-deep); font-weight: 800; font-size: 13px;
}
.bp-meta b { color: #fff; font-weight: 600; }
.bp-hero-art {
    border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 7;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(245,245,220,0.08);
    transform: rotate(1.2deg);
}
.bp-hero-art svg { display: block; width: 100%; height: 100%; }

.bp-layout {
    display: grid; grid-template-columns: minmax(0, 720px) 240px;
    gap: 72px; justify-content: center; padding-top: 56px; padding-bottom: 40px;
}
.bp-rail { position: relative; }
.bp-rail-inner { position: sticky; top: 100px; }
.bp-rail h4, .bp-toc-mobile summary {
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); margin: 0 0 14px;
}
.bp-toc { list-style: none; margin: 0 0 32px; padding: 0; border-left: 2px solid var(--border); }
.bp-toc a {
    display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent;
    color: var(--text-muted); font-size: 14px; line-height: 1.4; text-decoration: none;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.bp-toc a:hover { color: var(--text); }
.bp-toc a.is-active { color: var(--text); border-left-color: var(--cat); font-weight: 600; }
.bp-share { display: flex; gap: 8px; }
.bp-share a, .bp-share button {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    border: 1px solid var(--border-strong); color: var(--text); background: var(--card);
    transition: border-color var(--t-fast), color var(--t-fast);
}
.bp-share a:hover, .bp-share button:hover { border-color: var(--cat); color: var(--cat); }
.bp-share svg { width: 17px; height: 17px; }
.bp-toc-mobile { display: none; margin-bottom: 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 14px 18px; }
.bp-toc-mobile summary { margin: 0; cursor: pointer; }
.bp-toc-mobile .bp-toc { margin: 14px 0 4px; }

/* Article body */
.blog-post-body { font-size: 1.0625rem; line-height: 1.78; color: var(--text); }
.blog-post-body > p:first-child { font-size: 1.2rem; line-height: 1.7; }
.blog-post-body p, .blog-post-body li, .blog-post-body td { color: var(--text); font-size: inherit; line-height: inherit; }
.blog-post-body p { margin: 0 0 20px; }
.blog-post-body h2 {
    font-size: 1.6rem; line-height: 1.25; color: var(--text); font-weight: 800; letter-spacing: -0.01em;
    margin: 56px 0 18px; scroll-margin-top: 100px;
}
.blog-post-body h2::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
    background: var(--cat); margin-bottom: 16px;
}
.blog-post-body h3 { font-size: 1.2rem; color: var(--text); font-weight: 700; margin: 34px 0 12px; }
.blog-post-body strong { color: var(--text); font-weight: 700; }
.blog-post-body a {
    color: var(--text); font-weight: 600; text-decoration: underline;
    text-decoration-color: var(--cat); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.blog-post-body a:hover { color: var(--cat); }

.blog-post-body ul { list-style: none; padding: 0; margin: 0 0 24px; }
.blog-post-body ul > li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.blog-post-body ul > li::before {
    content: ''; position: absolute; left: 4px; top: 0.66em;
    width: 8px; height: 8px; border-radius: 2px; background: var(--cat); transform: rotate(45deg);
}

/* Ordered lists read as step timelines */
.blog-post-body ol { list-style: none; padding: 0; margin: 8px 0 28px; counter-reset: step; }
.blog-post-body ol > li { counter-increment: step; position: relative; padding: 4px 0 20px 54px; }
.blog-post-body ol > li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--cat); color: var(--cat-deep); font-weight: 800; font-size: 15px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--cat) 18%, transparent);
}
.blog-post-body ol > li:not(:last-child)::after {
    content: ''; position: absolute; left: 17px; top: 44px; bottom: 4px; width: 2px;
    background: linear-gradient(var(--cat), transparent); opacity: 0.45;
}

.blog-post-body table {
    width: 100%; border-collapse: collapse; margin: 8px 0 28px; font-size: 0.95rem;
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.blog-post-body thead th {
    text-align: left; font-weight: 700; color: var(--text); background: var(--bg-alt);
    padding: 12px 14px; border-bottom: 2px solid var(--cat);
}
.blog-post-body td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.blog-post-body tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-alt) 45%, transparent); }
.blog-post-body tbody tr:last-child td { border-bottom: 0; }

.blog-post-body blockquote {
    margin: 0 0 24px; padding: 18px 22px; border-radius: 0 14px 14px 0;
    border-left: 4px solid var(--cat); background: color-mix(in srgb, var(--cat) 9%, var(--card));
}
.blog-post-body blockquote p:last-child { margin: 0; }
.blog-post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em;
    background: var(--bg-alt); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px;
}
.blog-post-body pre { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 18px; overflow-x: auto; margin: 0 0 24px; }
.blog-post-body pre code { background: none; border: 0; padding: 0; }

/* Explainer flow */
.blog-flow {
    margin: 4px 0 32px; padding: 26px 22px 18px; border-radius: 20px;
    background:
        radial-gradient(500px 200px at 50% 0%, color-mix(in srgb, var(--cat) 14%, transparent), transparent 70%),
        var(--card);
    border: 1px solid var(--border);
}
.flow { display: flex; align-items: stretch; gap: 0; }
.flow + .flow-row-label { margin-top: 22px; }
.flow-row-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.flow-node {
    flex: 1 1 0; min-width: 0; text-align: center;
    padding: 16px 10px 14px; border-radius: 14px;
    background: var(--bg); border: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.flow-node.is-hot { border-color: var(--cat); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat) 14%, transparent); }
.flow-icon {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
    background: color-mix(in srgb, var(--cat) 16%, transparent); color: var(--cat);
}
.flow-node.is-hot .flow-icon { background: var(--cat); color: var(--cat-deep); }
.flow-icon svg { width: 22px; height: 22px; }
.flow-node strong { font-size: 0.95rem; color: var(--text); line-height: 1.3; }
.flow-node > span:last-child { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.flow-arrow {
    flex: 0 0 56px; position: relative; display: flex; align-items: center; justify-content: center;
}
.flow-arrow::before {
    content: ''; position: absolute; left: 8px; right: 12px; top: 50%; height: 2px;
    background: repeating-linear-gradient(90deg, var(--cat) 0 6px, transparent 6px 11px);
}
.flow-arrow::after {
    content: ''; position: absolute; right: 8px; top: calc(50% - 5px);
    border: 5px solid transparent; border-left: 7px solid var(--cat); border-right: 0;
}
.flow-arrow span {
    position: relative; top: -16px; font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--card); padding: 0 4px;
}
.flow-arrow span:empty { display: none; }
.flow-5 .flow-arrow { flex-basis: 30px; }
.flow-5 .flow-node > span:last-child { font-size: 0.75rem; }
.flow-return {
    margin-top: 14px; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--text);
    padding: 9px 14px; border-radius: 10px; background: color-mix(in srgb, var(--cat) 10%, transparent);
}
.blog-flow figcaption { margin-top: 14px; text-align: center; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* FAQ accordion */
.bp-faq { margin: 56px 0 24px; }
.bp-faq details {
    border: 1px solid var(--border); border-radius: 14px; background: var(--card);
    margin-bottom: 12px; transition: border-color var(--t-fast);
}
.bp-faq details[open] { border-color: var(--cat); }
.bp-faq summary {
    list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; position: relative;
    font-weight: 700; color: var(--text); line-height: 1.45;
}
.bp-faq summary::-webkit-details-marker { display: none; }
.bp-faq summary::after {
    content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in srgb, var(--cat) 16%, transparent); color: var(--text);
    font-size: 20px; font-weight: 500; line-height: 1; transition: transform var(--t-base);
}
.bp-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.bp-faq .bp-faq-a { padding: 0 20px 18px; color: var(--text-muted); }
.blog-post-body .bp-faq .bp-faq-a p { margin: 0; color: var(--text-muted); }

/* Tags + CTA */
.bp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--border); }
.bp-tags span { font-size: 13px; padding: 5px 12px; border-radius: var(--radius-full); background: var(--bg-alt); color: var(--text-muted); }
.bp-cta {
    margin-top: 36px; padding: 28px; border-radius: 20px;
    display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
    background:
        radial-gradient(400px 200px at 100% 0%, color-mix(in srgb, var(--cat) 30%, transparent), transparent 70%),
        linear-gradient(135deg, var(--cat-deep), #071210);
    color: #f5f5dc;
}
.bp-cta-icon {
    width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
    background: var(--cat); color: var(--cat-deep); font-size: 30px;
}
.bp-cta h3 { color: #fff; font-size: 1.3rem; margin: 0 0 6px; }
.bp-cta p { margin: 0 0 16px; color: rgba(245,245,220,0.8); font-size: 0.97rem; }
.bp-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bp-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 12px;
    font-weight: 700; font-size: 15px; text-decoration: none; transition: transform var(--t-fast), background var(--t-fast);
}
.bp-btn:hover { transform: translateY(-1px); }
.bp-btn-primary { background: #f5f5dc; color: #0a1512; }
.bp-btn-ghost { color: #f5f5dc; border: 1px solid rgba(245,245,220,0.3); }
.bp-btn-ghost:hover { background: rgba(245,245,220,0.08); color: #fff; }

.bp-more { padding: 40px 0 90px; }
.bp-more h2 { font-size: 1.6rem; color: var(--text); margin: 0 0 24px; font-weight: 800; }

@media (max-width: 1100px) {
    .bp-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
    .bp-rail { display: none; }
    .bp-toc-mobile { display: block; }
}
@media (max-width: 900px) {
    .bp-hero { padding: 108px 0 44px; }
    .bp-hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .bp-hero-art { transform: none; }
}
@media (max-width: 640px) {
    .flow { flex-direction: column; }
    .flow-node { flex-direction: row; text-align: left; gap: 12px; padding: 12px 14px; }
    .flow-node .flow-icon { margin: 0; flex-shrink: 0; }
    .flow-node strong { min-width: 0; }
    .flow-node > span:last-child { margin-left: auto; text-align: right; max-width: 50%; }
    .flow-arrow { flex-basis: 34px; }
    .flow-5 .flow-arrow { flex-basis: 24px; }
    .flow-arrow::before { left: 50%; right: auto; top: 4px; bottom: 10px; width: 2px; height: auto;
        background: repeating-linear-gradient(180deg, var(--cat) 0 6px, transparent 6px 11px); }
    .flow-arrow::after { right: auto; left: calc(50% - 5px); top: auto; bottom: 4px;
        border: 5px solid transparent; border-top: 7px solid var(--cat); border-bottom: 0; }
    .flow-arrow span { top: 0; left: 16px; }
    .blog-post-body table { display: block; overflow-x: auto; white-space: nowrap; }
    .bp-cta { grid-template-columns: 1fr; }
}
