/* ======================================================================
   blog.css - Blog index list and post article layout. Sits on top of
   docs.css. Post bodies render bare h2/p/strong/em/code/ul, so the
   .bp-body container styles its descendants directly.
   ====================================================================== */

/* ======================================================================
   Index list
   ====================================================================== */

.bp-list {
    margin: 32px 0 0;
    border-top: 1px solid var(--border);
}

.bp-card {
    display: block;
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
    color: inherit !important;
    transition: background 0.15s ease-out;
}

.bp-card-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    align-items: baseline;
    padding: 0 4px;
}

.bp-card:hover {
    background: color-mix(in srgb, var(--text) 3%, transparent);
}

.bp-card-meta {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    font-family: var(--doc-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.bp-card-category {
    color: var(--accent);
}

.bp-card-sep {
    opacity: 0.5;
}

.bp-card-title {
    grid-column: 1;
    grid-row: 2;
    font-family: var(--doc-font);
    font-size: clamp(17px, 1.9vw, 20px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
    text-wrap: balance;
}

.bp-card:hover .bp-card-title { color: var(--accent); }

.bp-card-arrow {
    grid-column: 2;
    grid-row: 2;
    font-family: var(--doc-mono);
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.15s ease-out, color 0.15s ease-out;
    align-self: center;
}

.bp-card:hover .bp-card-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

.bp-card-desc {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 8px 0 0;
    max-width: 70ch;
}

.bp-empty {
    margin: 32px 0 0;
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ======================================================================
   Post article
   ====================================================================== */

.bp-article {
    --bp-read: 68ch;
    margin: 0 auto;
    max-width: 760px;
    padding: 32px 32px 64px;
    color: var(--text);
}

@media (max-width: 720px) {
    .bp-article { padding: 24px 20px 48px; }
}

.bp-crumbs {
    margin: 0 0 24px;
    font-family: var(--doc-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.bp-crumbs a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease-out;
}

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

.bp-header {
    margin: 0 0 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.bp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-family: var(--doc-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 18px;
}

.bp-meta .bp-category { color: var(--accent); }
.bp-meta .bp-sep { opacity: 0.5; }

.bp-title {
    font-family: var(--doc-font);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 14px;
    text-wrap: balance;
}

.bp-desc {
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    max-width: 38em;
}

/* ----- Body content (bare h2/p/ul/strong/em/code) ----- */

.bp-body {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: var(--bp-read);
}

.bp-body > * + * { margin-top: 16px; }

.bp-body h2 {
    font-family: var(--doc-font);
    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--text);
    margin: 40px 0 0;
    text-wrap: balance;
}

.bp-body h2 + p { margin-top: 14px; }

.bp-body h3 {
    font-family: var(--doc-font);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 0;
    line-height: 1.3;
}

.bp-body p { margin: 16px 0 0; }
.bp-body p:first-child { margin-top: 0; }

.bp-body strong { color: var(--text); font-weight: 600; }

.bp-body em { color: var(--text); font-style: italic; }

.bp-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s ease-out;
}

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

.bp-body ul,
.bp-body ol {
    margin: 16px 0 0;
    padding: 0 0 0 22px;
}

.bp-body ul { list-style: none; }
.bp-body ul li { position: relative; padding: 4px 0; }
.bp-body ul li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 14px;
    width: 7px;
    height: 1px;
    background: color-mix(in srgb, var(--text) 35%, transparent);
}

.bp-body ol li { padding: 4px 0; }
.bp-body ol li + li { margin-top: 0; }

.bp-body li > * + * { margin-top: 6px; }

.bp-body code {
    font-family: var(--doc-mono);
    font-size: 0.9em;
    background: var(--doc-code-bg);
    border: 1px solid var(--doc-code-border);
    color: var(--text);
    padding: 1px 6px;
    border-radius: 4px;
}

.bp-body pre {
    margin: 16px 0 0;
    padding: 16px 18px;
    background: var(--doc-code-bg);
    border: 1px solid var(--doc-code-border);
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--doc-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
    tab-size: 2;
}

.bp-body pre code {
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    white-space: pre;
}

.bp-body blockquote {
    margin: 20px 0 0;
    padding: 4px 0 4px 16px;
    border-left: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border));
    color: var(--text);
    font-style: italic;
}

.bp-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

.bp-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 0;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.bp-body th,
.bp-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.bp-body th {
    background: color-mix(in srgb, var(--text) 3%, transparent);
    font-family: var(--doc-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.bp-body tbody tr:last-child td { border-bottom: 0; }

/* ======================================================================
   Related posts at the bottom
   ====================================================================== */

.bp-related {
    margin: 56px auto 0;
    max-width: 760px;
    padding: 32px 32px 0;
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .bp-related { padding: 24px 20px 0; }
}

.bp-related-label {
    font-family: var(--doc-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 18px;
}

.bp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.bp-related-card {
    background: var(--bg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: inherit !important;
    transition: background 0.15s ease-out;
}

.bp-related-card:hover {
    background: color-mix(in srgb, var(--accent) 5%, var(--bg));
}

.bp-related-category {
    font-family: var(--doc-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.bp-related-title {
    font-family: var(--doc-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

/* ======================================================================
   Inline cmd-mention pill (already styled globally, but kept readable
   inside body prose at 15.5px)
   ====================================================================== */

.bp-body .cmd-mention {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-family: var(--doc-mono);
    font-size: 0.86em;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.4;
    vertical-align: baseline;
}
