/* blog-v2.css — scoped (.bp-*) evolution of the blog post page.
   Additive: does NOT touch .post-content / .post-full-content / blog.css.
   All colors via existing tokens so dark mode + brand stay correct. */

:root {
    --bp-accent: var(--bs-primary, #fecb08);
    --bp-rule: var(--border-color, #dee2e6);
    --bp-muted: #6c757d;
    --bp-surface: #fff;
    --bp-elev: #f8f9fa;
    --bp-ink: var(--default-text-color, #333);
    --bp-up: #198754;
    --bp-down: #dc3545;
}

[data-bs-theme="dark"] {
    --bp-muted: #9aa0a6;
    --bp-surface: #212529;
    --bp-elev: #2a2e33;
    --bp-rule: #3a3f44;
}

/* ---- Reading progress ---- */
.bp-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1080; }
.bp-progress > i { display: block; height: 100%; width: 0; background: var(--bp-accent); }

/* ---- Editorial header ---- */
.bp-eyebrow {
    font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--bp-muted); margin-bottom: .65rem;
}
.bp-eyebrow a { color: var(--bp-muted); text-decoration: none; }
.bp-eyebrow a:hover { color: var(--bp-accent); }
.bp-eyebrow .sep { margin: 0 .5rem; opacity: .5; }
.bp-seriestag {
    display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    font-size: .85rem; color: var(--bp-muted); margin-bottom: .75rem;
    padding: .35rem .75rem; border: 1px solid var(--bp-rule); border-radius: 999px;
}
.bp-seriestag i { color: var(--bp-accent); }
.bp-seriestag a { color: var(--bp-ink); font-weight: 600; text-decoration: none; }
.bp-seriestag a:hover { color: var(--bp-accent); }
.bp-seriestag .ep {
    background: var(--bp-accent); color: #1a1a1a; font-weight: 600;
    padding: .05rem .5rem; border-radius: 999px; font-size: .78rem;
}
.bp-toc-disc { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--bp-rule); }

/* Post hero — cover image as page-header background */
.bp-hero .page-header-bg { opacity: .5; filter: blur(1px); }
/* bottom:-1px closes a sub-pixel sliver where the bg image's clipped
   render rounds 1px taller than the inset:0 overlay (otherwise a thin
   washed-out strip shows at the very bottom of the hero). */
.bp-hero-overlay { background: linear-gradient(180deg, rgba(10,10,10,.50) 0%, rgba(10,10,10,.84) 100%) !important; bottom: -1px !important; }
.bp-hero-series { font-size: .85rem; color: rgba(255,255,255,.8); margin-bottom: .6rem; }
.bp-hero-series a { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--bp-accent); padding-bottom: 1px; }
.bp-hero-lede { font-size: 1.15rem; color: rgba(255,255,255,.85); max-width: 70ch; }
.bp-hero .bp-meta { color: #fff; }
.bp-hero .bp-byline .bp-n a { color: #fff; text-decoration: none; }
.bp-hero .bp-byline .bp-n a:hover { color: var(--bp-accent); }
.bp-hero .bp-byline .bp-sub { color: rgba(255,255,255,.7); }
.bp-hero .bp-avatar { background: rgba(255,255,255,.18); color: #fff; }
.bp-hero .bp-stats { color: rgba(255,255,255,.8); }
.bp-hero .bp-stats b { color: #fff; }
.bp-hero .bp-votebtn { color: rgba(255,255,255,.8); }
.bp-hero .bp-votebtn b { color: #fff; }
.bp-hero .bp-votebtn.up:hover, .bp-hero .bp-votebtn.up:hover b,
.bp-hero .bp-votebtn.up.on, .bp-hero .bp-votebtn.up.on b { color: #6ee7a8; }
.bp-hero .bp-votebtn.down:hover, .bp-hero .bp-votebtn.down:hover b,
.bp-hero .bp-votebtn.down.on, .bp-hero .bp-votebtn.down.on b { color: #ff8a8a; }
.bp-hero .bp-stats .bp-up, .bp-hero .bp-stats .bp-down { color: rgba(255,255,255,.85); }

.bp-title { font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .6rem; }
.bp-lede { font-size: 1.15rem; color: var(--bp-muted); margin: 0 0 1.1rem; }

.bp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.1rem; }
.bp-byline { display: inline-flex; align-items: center; gap: .55rem; }
.bp-avatar-link { display: inline-flex; line-height: 0; text-decoration: none; }
.bp-avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    background: var(--bp-elev); display: inline-grid; place-items: center;
    font-weight: 600; font-size: .85rem; color: var(--bp-ink);
}
.bp-byline .bp-n { font-weight: 600; line-height: 1.15; }
.bp-byline .bp-n a { color: inherit; text-decoration: none; }
.bp-byline .bp-n a:hover { color: var(--bp-accent); }
.bp-byline .bp-sub { font-size: .8rem; color: var(--bp-muted); }
.bp-stats { display: flex; gap: .9rem; font-size: .9rem; color: var(--bp-muted); margin-left: auto; align-items: center; }
.bp-stats b { color: var(--bp-ink); }
.bp-stats .bp-up { color: var(--bp-up); }
.bp-stats .bp-down { color: var(--bp-down); }
.bp-stats form { display: inline; }
.bp-votebtn {
    background: none; border: 0; padding: 0; cursor: pointer; color: var(--bp-muted);
    display: inline-flex; align-items: center; font: inherit; transition: color .15s;
}
.bp-votebtn b { color: var(--bp-ink); }
.bp-votebtn.up:hover, .bp-votebtn.up:hover b,
.bp-votebtn.up.on, .bp-votebtn.up.on b { color: var(--bp-up); }
.bp-votebtn.down:hover, .bp-votebtn.down:hover b,
.bp-votebtn.down.on, .bp-votebtn.down.on b { color: var(--bp-down); }

/* ---- 2-col grid: sticky TOC + content (desktop only) ---- */
.bp-grid { display: block; }
@media (min-width: 992px) {
    .bp-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem; align-items: start; }
    /* Posts without headings: single column, centered, capped at a comfortable
       reading width so essay-style posts don't sprawl and don't get shoved
       sideways by the empty TOC gutter. */
    .bp-grid--solo { display: block; max-width: 760px; margin-inline: auto; }
    .bp-toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
}
.bp-toc-label {
    font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--bp-muted); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--bp-rule);
}
.bp-toc ol { list-style: none; margin: 0; padding: 0; }
.bp-toc li { line-height: 1.35; }
.bp-toc li.lvl3 { padding-left: 1rem; }
.bp-toc a {
    display: block; padding: .3rem 0 .3rem .75rem; border-left: 2px solid var(--bp-rule);
    color: var(--bp-muted); text-decoration: none; font-size: .88rem; transition: color .15s, border-color .15s;
}
.bp-toc a:hover { color: var(--bp-ink); }
.bp-toc a.active { color: var(--bp-accent); border-left-color: var(--bp-accent); }

/* Mobile TOC = collapsible */
.bp-toc-mobile { border: 1px solid var(--bp-rule); border-radius: .375rem; margin: 1rem 0 1.5rem; }
.bp-toc-mobile > summary { padding: .6rem 1rem; cursor: pointer; font-weight: 600; }
.bp-toc-mobile ol { list-style: none; margin: 0; padding: 0 1rem 1rem; }
.bp-toc-mobile li.lvl3 { padding-left: 1rem; }
.bp-toc-mobile a { color: var(--bp-ink); text-decoration: none; display: block; padding: .25rem 0; font-size: .9rem; }
@media (min-width: 992px) { .bp-toc-mobile { display: none; } }

/* ---- Series stepper (top + bottom) ---- */
.bp-series { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0; }
.bp-series a, .bp-series span.empty {
    display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem;
    border: 1px solid var(--bp-rule); border-radius: .375rem; text-decoration: none; color: var(--bp-ink);
    transition: border-color .15s, transform .15s;
}
.bp-series a:hover { border-color: var(--bp-accent); transform: translateY(-2px); }
.bp-series .lbl { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bp-muted); }
.bp-series .ttl { font-weight: 700; line-height: 1.25; }
.bp-series .nx { text-align: right; }
@media (max-width: 575px) { .bp-series { grid-template-columns: 1fr; } }

/* ---- Author bio card ---- */
.bp-authorcard {
    display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.4rem;
    border: 1px solid var(--bp-rule); border-radius: .5rem; background: var(--bp-elev); margin: 2.5rem 0;
}
.bp-authorcard img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bp-authorcard .nm { font-weight: 700; font-size: 1.1rem; }
.bp-authorcard .bio { color: var(--bp-muted); margin: .3rem 0 .55rem; font-size: .95rem; }
.bp-authorcard a { font-size: .85rem; margin-right: .85rem; text-decoration: none; }
.bp-authorcard a:hover { color: var(--bp-accent); }

/* ---- Comments ---- */
.bp-comments { width: 100%; }
.bp-comments-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.bp-comments-head h3 { font-weight: 800; margin: 0; }
.bp-composer { background: var(--bp-elev); border: 1px solid var(--bp-rule); border-radius: .5rem; padding: 1rem; margin-bottom: 2rem; }
.bp-comment { padding: 1rem 0; border-top: 1px solid var(--bp-rule); }
.bp-comment:first-of-type { border-top: 0; padding-top: .25rem; }
/* Brief highlight when you're scrolled to your just-posted comment.
   Only background/box-shadow animate -> no layout shift. */
.bp-comment.bp-flash { animation: bpFlash 2.2s ease; border-radius: .4rem; }
@keyframes bpFlash {
    0%   { background: color-mix(in srgb, var(--bp-accent) 28%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--bp-accent) 16%, transparent); }
    100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.bp-cmeta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .55rem; margin-bottom: .35rem; line-height: 1.4; }
.bp-cname { font-weight: 600; font-size: .92rem; }
.bp-time, .bp-edited { font-size: .8rem; color: var(--bp-muted); }
.bp-time::before, .bp-edited::before { content: "·"; margin-right: .55rem; color: var(--bp-muted); }
.bp-tag-author {
    font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
    background: var(--bp-accent); color: #1a1a1a; padding: .1rem .45rem; border-radius: 999px; font-weight: 600;
}
.bp-tag-pending {
    font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
    background: #ffc107; color: #1a1a1a; padding: .1rem .45rem; border-radius: 999px;
}
.bp-edited { cursor: help; }
.bp-cbody { white-space: pre-wrap; line-height: 1.65; color: var(--bp-ink); }
.bp-cactions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .7rem; }
.bp-votes { display: inline-flex; border: 1px solid var(--bp-rule); border-radius: 999px; overflow: hidden; }
.bp-votes button, .bp-votes span {
    background: none; border: 0; padding: .2rem .6rem; font-size: .82rem; color: var(--bp-muted);
    display: inline-flex; align-items: center; gap: .25rem; cursor: pointer;
}
.bp-votes form { display: inline; }
.bp-votes .n { padding: 0; display: inline; }
.bp-votes .up:hover, .bp-votes .up.on { color: var(--bp-up); }
.bp-votes .down:hover, .bp-votes .down.on { color: var(--bp-down); }
.bp-votes .divider { width: 1px; padding: 0; background: var(--bp-rule); }
.bp-cact-btn { background: none; border: 0; color: var(--bp-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; padding: 0; }
.bp-cact-btn:hover { color: var(--bp-ink); }
.bp-edit-locked { opacity: .5; cursor: not-allowed; }
.bp-edit-locked:hover { color: var(--bp-muted); }
.bp-reply-form, .bp-edit-form {
    margin: .75rem 0 .25rem; padding: .85rem; border: 1px solid var(--bp-rule);
    border-radius: .5rem; background: var(--bp-elev); max-width: 640px;
}
.bp-reply-form textarea, .bp-edit-form textarea { resize: vertical; }

.bp-del-btn:hover { color: var(--bp-down); }

.bp-deleted { color: var(--bp-muted); font-style: italic; }

/* Anchored hint bubble — position:fixed so it never shifts layout */
.bp-hint {
    position: fixed; transform: translate(-50%, -100%) translateY(4px);
    background: var(--bp-ink); color: var(--bp-surface);
    padding: .4rem .7rem; border-radius: .4rem; font-size: .8rem; font-weight: 500;
    white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.28);
    z-index: 1090; pointer-events: none; opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}
.bp-hint.show { opacity: 1; transform: translate(-50%, -100%) translateY(0); }

/* Inline form feedback — sits in the button row, no layout jump */
.bp-formmsg {
    font-size: .85rem; opacity: 0; transition: opacity .15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bp-formmsg.show { opacity: 1; }
.bp-formmsg.error { color: var(--bp-down); }
.bp-formmsg.info { color: var(--bp-muted); }

/* Reddit/GitHub-style reply thread: thin rail, indented, hover-lit */
.bp-replies {
    margin: .35rem 0 0; padding-left: 1.5rem;
    border-left: 2px solid var(--bp-rule); transition: border-color .15s;
}
.bp-replies:hover { border-left-color: var(--bp-muted); }
.bp-replies .bp-comment {
    padding: .7rem 0;
    border-top: 1px solid var(--bp-rule);
}
.bp-replies .bp-comment:first-of-type { border-top: 0; padding-top: .25rem; }
.bp-replies .bp-replies { padding-left: 1.25rem; } /* nested guard */

/* ---- Related posts ---- */
.bp-related { max-width: 1100px; margin: 3rem auto 0; }
.bp-related h3 { font-weight: 800; margin-bottom: 1.25rem; }
.bp-rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 768px) { .bp-rgrid { grid-template-columns: 1fr; } }
.bp-rcard {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    border: 1px solid var(--bp-rule); border-radius: .5rem; padding: 1rem; transition: border-color .15s, transform .15s;
}
.bp-rcard:hover { border-color: var(--bp-accent); transform: translateY(-3px); }
.bp-rcard .c { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bp-muted); }
.bp-rcard .t { font-weight: 700; line-height: 1.25; margin: .2rem 0 .35rem; }
.bp-rcard .e {
    font-size: .88rem; color: var(--bp-muted); margin-bottom: .6rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bp-rcard .f { font-size: .76rem; color: var(--bp-muted); margin-top: auto; }

/* ---- Listing page ---- */
.bp-tagctx { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bp-muted); margin-bottom: .35rem; }
.bp-tagctx a { color: var(--bp-muted); text-decoration: none; }
.bp-tagctx a:hover { color: var(--bp-accent); }

.bp-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--bp-surface); border: 1px solid var(--bp-rule);
    border-radius: .5rem; overflow: hidden;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bp-card:hover { border-color: var(--bp-accent); transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.10); }
.bp-card-img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; background: var(--bp-elev); }
.bp-card-body { padding: 1rem 1.05rem; display: flex; flex-direction: column; flex: 1; }
.bp-card-eyebrow {
    font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--bp-muted); margin-bottom: .4rem;
}
.bp-card-eyebrow .sep { margin: 0 .4rem; opacity: .5; }
.bp-card-title {
    font-weight: 700; font-size: 1.1rem; line-height: 1.25; margin: 0 0 .4rem; color: var(--bp-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bp-card-excerpt {
    font-size: .9rem; color: var(--bp-muted); margin: 0 0 .85rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.bp-card-foot {
    margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--bp-rule);
    display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--bp-muted);
}
.bp-card-foot .who { display: inline-flex; align-items: center; gap: .35rem; color: var(--bp-ink); }
.bp-card-foot .who .av {
    width: 22px; height: 22px; border-radius: 50%; background: var(--bp-elev);
    display: inline-grid; place-items: center; font-size: .68rem; font-weight: 600;
    object-fit: cover; flex-shrink: 0;
}
.bp-card-foot .meta { margin-left: auto; display: inline-flex; gap: .7rem; }

/* Top filter bar */
.bp-topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 2rem;
}
.bp-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.bp-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--bp-muted); }
.bp-search input {
    width: 100%; padding: .55rem .9rem .55rem 2.1rem; font-size: .92rem;
    background: var(--bp-surface); color: var(--bp-ink);
    border: 1px solid var(--bp-rule); border-radius: 999px; outline: none;
}
.bp-search input:focus { border-color: var(--bp-accent); }
.bp-sort {
    padding: .5rem .9rem; font-size: .9rem; border-radius: 999px;
    background: var(--bp-surface); color: var(--bp-ink); border: 1px solid var(--bp-rule); cursor: pointer;
}
.bp-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.bp-pill {
    font-size: .82rem; padding: .35rem .9rem; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--bp-muted); border: 1px solid var(--bp-rule);
    transition: color .15s, border-color .15s, background .15s;
}
.bp-pill:hover { color: var(--bp-ink); border-color: var(--bp-muted); }
.bp-pill.active { background: var(--bp-accent); color: #1a1a1a; border-color: var(--bp-accent); font-weight: 600; }
.bp-pill .n { opacity: .65; margin-left: .3rem; }

/* Featured (latest) banner */
.bp-feature {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
    border: 1px solid var(--bp-rule); border-radius: .75rem; overflow: hidden; margin-bottom: 2.5rem;
    transition: border-color .15s;
}
.bp-feature:hover { border-color: var(--bp-accent); }
.bp-feature a { display: contents; color: inherit; text-decoration: none; }
.bp-feature .img { aspect-ratio: 16 / 10; width: 100%; height: 100%; object-fit: cover; background: var(--bp-elev); }
.bp-feature .txt { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.bp-feature .kicker { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bp-accent); margin-bottom: .6rem; }
.bp-feature h2 { font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .7rem; }
.bp-feature p { color: var(--bp-muted); margin: 0 0 1.1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bp-feature .foot { font-size: .8rem; color: var(--bp-muted); display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; }
.bp-feature .foot .who { display: inline-flex; align-items: center; gap: .4rem; color: var(--bp-ink); }
.bp-feature .foot .who .av {
    width: 24px; height: 24px; border-radius: 50%; background: var(--bp-elev);
    display: inline-grid; place-items: center; font-size: .7rem; font-weight: 600;
    object-fit: cover; flex-shrink: 0;
}
@media (max-width: 768px) {
    .bp-feature { grid-template-columns: 1fr; }
    .bp-feature .img { aspect-ratio: 16 / 9; }
    .bp-feature .txt { padding: 1.25rem; }
}

/* Card grid (CSS grid, no Bootstrap cols) */
.bp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.bp-cards .blog-item { display: flex; }
.bp-cards .blog-item > a { display: flex; width: 100%; text-decoration: none; color: inherit; }
.bp-card-img-wrap { overflow: hidden; }
.bp-card-img-wrap .bp-card-img { transition: transform .4s cubic-bezier(.16,1,.3,1); }
.bp-card:hover .bp-card-img { transform: scale(1.04); }

.bp-empty { text-align: center; padding: 4rem 1rem; color: var(--bp-muted); }
.bp-empty i { font-size: 2.5rem; opacity: .5; }

::selection { background: var(--bp-accent); color: #1a1a1a; }
