/* ------------------------------------------------------------------
   Blog: index and posts. Loaded after base.css.
   Long-form reading, so the page is calm: no grid, no 3D, one measure.
   ------------------------------------------------------------------ */
:root {
    --ok: #5ee39a;
    --bad: #ff7a8a;
    --measure: 44rem;
}

.post-page { padding: 120px 0 0; }
.container {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.post-article { max-width: var(--measure); margin-inline: auto; }
.post-article--compliance { max-width: 52.5rem; }
.post-article--wide { max-width: 65rem; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 40px; font-family: var(--mono); font-size: var(--t-xs); color: var(--line-3); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-3); }
.breadcrumb a { color: var(--line-2); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--dim); }
.breadcrumb [aria-current="page"] { color: var(--line-3); }

/* Post header */
.post-header { display: grid; gap: 14px; margin-bottom: 48px; }
.post-series-badge { color: var(--dim); font-size: var(--t-sm); font-weight: 500; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: var(--t-xs); color: var(--line-3); }
.post-header h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    font-weight: 700;
    font-variation-settings: "wdth" 112;
    line-height: 1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.post-dek { font-size: var(--t-lg); line-height: 1.5; color: var(--line-2); max-width: 40em; }
.post-dek strong { color: var(--line); font-weight: 600; }

/* Prose */
.post-content { font-size: 1.0625rem; line-height: 1.75; }
.post-content > * + * { margin-top: 1.25em; }
.post-content p, .post-content li { color: #c9ced6; }
.post-content h2 {
    margin-top: 2.6em;
    font-size: var(--t-2xl);
    font-weight: 650;
    font-variation-settings: "wdth" 110;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--line);
    text-wrap: balance;
}
.post-content h3 {
    margin-top: 2em;
    font-size: var(--t-xl);
    font-weight: 650;
    font-variation-settings: "wdth" 106;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--line);
}
.post-content ul, .post-content ol { display: grid; gap: 0.6em; margin-top: 1em; margin-bottom: 1em; padding-left: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li::marker { color: var(--line-3); }
.post-content a:not([class]) { color: var(--dim); border-bottom: 1px solid rgba(92, 200, 255, 0.35); transition: color 0.2s, border-color 0.2s; }
.post-content a:not([class]):hover { color: #fff; border-color: #fff; }
.post-content strong { color: var(--line); font-weight: 600; }
.post-content em { color: var(--line); }
.post-content code {
    padding: 1px 6px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--space-2);
    color: var(--line);
    font-size: 0.86em;
}
.post-content blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 24px;
    border-left: 2px solid var(--dim);
    font-size: var(--t-lg);
    line-height: 1.55;
    color: var(--line);
}

.post-summary {
    padding: 24px 28px;
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    background: var(--space-2);
}
.post-summary h2 { margin: 0 0 12px; font-size: var(--t-sm); font-weight: 600; letter-spacing: 0; color: var(--dim); }
.post-summary p + p { margin-top: 12px; }

/* Figures, diagrams and tables */
.post-content figure {
    margin: 2.75rem 0;
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    overflow: hidden;
    background: var(--space-2);
}
.post-content figure img,
.post-content figure video { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--rule); }
.post-content figcaption { padding: 14px 20px; font-size: var(--t-sm); line-height: 1.6; color: var(--line-2); }
.post-content figcaption strong { margin-right: 6px; font-family: var(--mono); font-size: var(--t-xs); font-weight: 500; color: var(--dim); }

.diagram-block {
    margin: 2rem 0;
    padding: 20px 24px;
    overflow-x: auto;
    border: 1px solid var(--rule-2);
    border-radius: 10px;
    background: #07080a;
    /* A <div>, not a <pre>: without this the browser collapses every newline and indent. */
    white-space: pre;
    tab-size: 4;
    font-family: var(--mono);
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--line);
}
.diagram-block .dim { color: var(--line-3); }
.diagram-block .hl { color: var(--dim); }
.diagram-block .grn { color: var(--ok); }
.diagram-block .red { color: var(--bad); }
.diagram-block .amb { color: var(--flag); }

.verdict-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.78em;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}
.verdict-tag--comply { color: var(--ok); background: rgba(94, 227, 154, 0.1); border: 1px solid rgba(94, 227, 154, 0.35); }
.verdict-tag--violate { color: var(--bad); background: rgba(255, 122, 138, 0.1); border: 1px solid rgba(255, 122, 138, 0.35); }
.verdict-tag--review { color: var(--flag); background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.35); }

.table-responsive { margin: 2rem 0; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--space-2); }
.table-responsive table { width: 100%; min-width: 44rem; border-collapse: collapse; font-size: 0.9rem; line-height: 1.55; text-align: left; }
.table-responsive th, .table-responsive td { padding: 14px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; color: #c9ced6; }
.table-responsive th { font-family: var(--mono); font-size: var(--t-xs); font-weight: 500; color: var(--line-3); background: #07080a; }
.table-responsive tr:last-child td { border-bottom: 0; }
.table-responsive code { font-size: 0.82em; white-space: nowrap; }
.path-badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--rule-2); border-radius: 999px; font-family: var(--mono); font-size: 0.72rem; white-space: nowrap; }
.path-v { color: var(--dim); border-color: rgba(92, 200, 255, 0.4); }
.path-r { color: var(--flag); border-color: rgba(255, 181, 71, 0.4); }
.path-both { color: var(--graph); border-color: rgba(139, 124, 255, 0.5); }

.post-note {
    margin: 2.25rem 0;
    padding: 20px 24px;
    border: 1px solid var(--rule-2);
    border-left: 2px solid var(--dim);
    border-radius: 4px 10px 10px 4px;
    background: var(--space-2);
}
.post-note--warning { border-left-color: var(--flag); }
.post-note .post-note-title { margin: 0 0 6px; font-weight: 650; color: var(--line); }
.post-note--warning .post-note-title { color: var(--flag); }
.post-note p { font-size: 0.95rem; line-height: 1.65; }

/* Link card to the companion post */
.post-deepdive {
    display: grid;
    gap: 6px;
    margin: 2rem 0;
    padding: 22px 24px;
    border: 1px solid rgba(92, 200, 255, 0.35);
    border-radius: 12px;
    background: rgba(92, 200, 255, 0.04);
    transition: border-color 0.25s, background-color 0.25s;
}
.post-deepdive:hover { border-color: var(--dim); background: rgba(92, 200, 255, 0.08); }
.post-deepdive-kicker { color: var(--dim); font-size: var(--t-sm); font-weight: 500; }
.post-deepdive-title { font-size: var(--t-lg); font-weight: 650; color: var(--line); }
.post-deepdive-desc { color: var(--line-2); font-size: 0.95rem; line-height: 1.6; }
.post-deepdive-more { color: var(--dim); font-size: var(--t-sm); }

.post-repo-link { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* End of post */
.post-cta {
    margin-top: 80px;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    background:
        linear-gradient(rgba(232, 236, 242, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(90deg, rgba(232, 236, 242, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
        var(--space-2);
}
.post-cta h2 { font-size: var(--t-xl); font-weight: 650; font-variation-settings: "wdth" 110; letter-spacing: -0.02em; line-height: 1.15; }
.post-cta p { margin: 12px 0 24px; color: var(--line-2); max-width: 38em; }

.post-series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-series-nav a {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--rule-2);
    border-radius: 10px;
    transition: border-color 0.25s;
}
.post-series-nav a:hover { border-color: var(--dim); }
.post-series-nav .rel { font-family: var(--mono); font-size: var(--t-xs); color: var(--line-3); }
.post-series-nav .name { font-weight: 600; line-height: 1.3; }

/* ------------------------------------------------------------------
   Blog index
   ------------------------------------------------------------------ */
.blog-hub { max-width: 56rem; }
.blog-header { display: grid; gap: 16px; margin-bottom: 56px; }
.blog-header .kicker { color: var(--dim); font-size: var(--t-sm); font-weight: 500; }
.blog-header h1 {
    font-size: var(--t-3xl);
    font-weight: 750;
    font-variation-settings: "wdth" 120;
    line-height: 0.92;
    letter-spacing: -0.04em;
}
.blog-header p { color: var(--line-2); font-size: var(--t-lg); max-width: 36em; }
.blog-tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.blog-tag { padding: 5px 11px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: var(--t-sm); color: var(--line-2); }

.post-list { border-top: 1px solid var(--rule); }
.post-item { border-bottom: 1px solid var(--rule); }
.post-link { display: grid; gap: 10px; padding: 32px 0; }
.post-link .post-title {
    font-size: var(--t-2xl);
    font-weight: 650;
    font-variation-settings: "wdth" 110;
    letter-spacing: -0.025em;
    line-height: 1.08;
    transition: color 0.2s;
}
.post-link:hover .post-title { color: var(--dim); }
.post-excerpt { color: var(--line-2); max-width: 44rem; }
.post-more { color: var(--dim); font-size: var(--t-sm); }

@media (max-width: 760px) {
    .post-page { padding-top: 96px; }
    .post-series-nav { grid-template-columns: 1fr; }
    .post-content { font-size: 1rem; }
}
