/* ============================================================
   public-blog.css
   Blog list (/blog) and blog post (/blog/{slug}) pages.
   Relies on tokens declared in public-nav.css and public-services.css.
   No font imports — public-nav.css already sets the stack.
   ============================================================ */

/* ============================================================
   Blog hero (list page)
   ============================================================ */
.blog-hero {
    padding: 80px 2rem 64px;
    background: var(--bg, #ffffff);
    text-align: center;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
}

.blog-hero__container {
    max-width: 720px;
    margin: 0 auto;
}

.blog-hero__eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sky, #0284c7);
    margin-bottom: 1rem;
}

.blog-hero__title {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--color-text, #0f172a);
    margin: 0 0 1rem;
}

.blog-hero__subtitle {
    font-size: 1.0625rem;
    color: var(--color-text-secondary, #64748b);
    line-height: 1.7;
    margin: 0 auto;
    max-width: 580px;
}

/* ============================================================
   Blog list
   ============================================================ */
.blog-list {
    padding: 64px 2rem 96px;
    background: var(--bg, #ffffff);
}

.blog-list__container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-list__empty {
    font-size: 1rem;
    color: var(--color-text-muted, #94a3b8);
    text-align: center;
    padding: 3rem 0;
}

/* ============================================================
   Blog card
   ============================================================ */
.blog-card {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
}

.blog-card:first-child {
    padding-top: 0;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted, #94a3b8);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.blog-card__author {
    color: var(--color-text-secondary, #64748b);
}

.blog-card__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 0.75rem;
}

.blog-card__title a {
    color: var(--color-text, #0f172a);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card__title a:hover {
    color: var(--sky, #0284c7);
}

.blog-card__title a:focus-visible {
    outline: 2px solid var(--color-primary, #0ea5e9);
    outline-offset: 2px;
    border-radius: 2px;
}

.blog-card__excerpt {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-secondary, #64748b);
    margin: 0 0 1.25rem;
}

.blog-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sky, #0284c7);
    text-decoration: none;
    transition: gap 0.2s, color 0.2s;
}

.blog-card__more svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.blog-card__more:hover {
    color: var(--sky-d, #0369a1);
    gap: 0.625rem;
}

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

.blog-card__more:focus-visible {
    outline: 2px solid var(--color-primary, #0ea5e9);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   Blog post
   ============================================================ */
.blog-post {
    max-width: 700px;
    margin: 0 auto;
    padding: 64px 2rem 96px;
}

/* Header */
.blog-post__header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
}

.blog-post__eyebrow {
    margin-bottom: 1.25rem;
}

.blog-post__eyebrow a {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sky, #0284c7);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-post__eyebrow a:hover {
    color: var(--sky-d, #0369a1);
}

.blog-post__eyebrow a:focus-visible {
    outline: 2px solid var(--color-primary, #0ea5e9);
    outline-offset: 2px;
    border-radius: 2px;
}

.blog-post__title {
    font-size: clamp(1.625rem, 3.5vw, 2.375rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--color-text, #0f172a);
    margin: 0 0 1.25rem;
}

.blog-post__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted, #94a3b8);
    flex-wrap: wrap;
}

/* Body typography */
.blog-post__body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text-secondary, #64748b);
}

.blog-post__lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text, #0f172a);
    margin-bottom: 2rem;
    font-weight: 400;
}

.blog-post__body p {
    margin: 0 0 1.5rem;
}

.blog-post__body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--color-text, #0f172a);
    margin: 3rem 0 1rem;
}

.blog-post__body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--color-text, #0f172a);
    margin: 2.25rem 0 0.75rem;
}

.blog-post__body ol {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
    list-style: decimal;
}

.blog-post__body ol li {
    margin-bottom: 0.625rem;
    padding-left: 0.375rem;
}

.blog-post__body strong {
    font-weight: 600;
    color: var(--color-text, #0f172a);
}

.blog-post__body em {
    font-style: italic;
    color: var(--color-text-secondary, #64748b);
}

.blog-post__body a {
    color: var(--color-primary, #0ea5e9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.blog-post__body a:hover {
    border-bottom-color: currentColor;
}

.blog-post__body a:focus-visible {
    outline: 2px solid var(--color-primary, #0ea5e9);
    outline-offset: 2px;
    border-radius: 2px;
}

.blog-post__body code {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 0.8125em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-bg-secondary, #f1f5f9);
    color: var(--color-text, #0f172a);
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
    white-space: nowrap;
}

/* Footer / back link */
.blog-post__footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border, rgba(0,0,0,0.08));
}

.blog-post__back {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-post__back:hover {
    color: var(--sky, #0284c7);
}

.blog-post__back:focus-visible {
    outline: 2px solid var(--color-primary, #0ea5e9);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .blog-hero {
        padding: 56px 1.5rem 48px;
    }

    .blog-list {
        padding: 48px 1.5rem 72px;
    }

    .blog-card {
        padding: 2rem 0;
    }

    .blog-post {
        padding: 48px 1.5rem 72px;
    }

    .blog-post__body h2 {
        font-size: 1.3125rem;
        margin-top: 2.5rem;
    }

    .blog-post__body h3 {
        font-size: 1.0625rem;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 40px 1rem 36px;
    }

    .blog-hero__subtitle {
        font-size: 0.9375rem;
    }

    .blog-list {
        padding: 32px 1rem 56px;
    }

    .blog-post {
        padding: 36px 1rem 56px;
    }

    .blog-post__lead {
        font-size: 1rem;
    }
}

/* ---------------------------------------------------------------------------
   Blog diagrams

   Inline SVG figures embedded in post bodies. The SVG markup carries only
   classes -- all presentation lives here, per the no-inline-CSS rule. Each
   diagram scales with its container via viewBox, so there is no fixed pixel
   width to break at narrow viewports.
   --------------------------------------------------------------------------- */

.blog-figure {
    margin: 2.5rem 0;
}

.blog-figure__frame {
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    /* Diagrams keep their aspect ratio; on very narrow screens allow the frame
       to scroll rather than letting text inside the SVG shrink to unreadable. */
    overflow-x: auto;
}

.blog-figure__svg {
    display: block;
    width: 100%;
    height: auto;
    min-width: 320px;
}

.blog-figure__caption {
    margin: 0.875rem 0 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-muted, #94a3b8);
    text-align: center;
}

/* Diagram primitives -------------------------------------------------------- */

.dgm-box {
    fill: var(--color-surface-alt, #f8fafc);
    stroke: var(--color-border, #cbd5e1);
    stroke-width: 1.5;
}

.dgm-box--accent {
    fill: #e0f2fe;
    stroke: #0ea5e9;
}

.dgm-box--warn {
    fill: #fef2f2;
    stroke: #ef4444;
}

.dgm-box--muted {
    fill: #f1f5f9;
    stroke: #cbd5e1;
    stroke-dasharray: 4 3;
}

.dgm-title {
    fill: var(--color-text, #0f172a);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
}

.dgm-label {
    fill: var(--color-text-secondary, #64748b);
    font-family: inherit;
    font-size: 11.5px;
}

.dgm-label--accent {
    fill: #0369a1;
    font-weight: 600;
}

.dgm-label--warn {
    fill: #b91c1c;
    font-weight: 600;
}

/* Right-anchored label: pins the text's END to its x coordinate so a longer
   string grows leftward into open space instead of sliding under whatever is
   painted next. Use wherever a label sits just before a box edge. */
.dgm-label--end {
    text-anchor: end;
}

.dgm-mono {
    fill: var(--color-text-secondary, #64748b);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.dgm-arrow {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.75;
}

.dgm-arrow--accent {
    stroke: #0ea5e9;
}

.dgm-arrow--warn {
    stroke: #ef4444;
}

.dgm-arrow--dashed {
    stroke-dasharray: 5 4;
}

.dgm-arrowhead {
    fill: #94a3b8;
}

.dgm-arrowhead--accent {
    fill: #0ea5e9;
}

.dgm-arrowhead--warn {
    fill: #ef4444;
}

.dgm-divider {
    stroke: var(--color-border, #e2e8f0);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

@media (max-width: 640px) {
    .blog-figure {
        margin: 2rem 0;
    }

    .blog-figure__frame {
        padding: 1rem 0.75rem;
    }
}
