/* ── Blog Post — Single Post View ──────────────────────── */

/* --abl-blog-accent + paper palette variables are defined once in
   abl-common-ui-themes.css and inherited here via the cascade. */

/* Brown paper body — see abl-blog-index.css for the full recipe.
   Single-post pages (NovaNews-generated daily blog posts via the
   blog-newscurator-post.html template) need the same paper effect
   as the rest of the blog ecosystem. The local palette remap
   (--abl-text, --abl-heading, --abl-card, etc.) propagates to all
   descendants via CSS variable inheritance. */
body {
    /* ── Local palette override (paper edition) ── */
    --abl-bg:           var(--abl-blog-paper);
    --abl-surface:      color-mix(in srgb, var(--abl-blog-paper) 92%, var(--abl-blog-paper-edge));
    --abl-card:         color-mix(in srgb, var(--abl-blog-paper) 88%, var(--abl-blog-paper-edge));
    --abl-border:       color-mix(in srgb, var(--abl-blog-paper-edge) 70%, transparent);
    --abl-border-light: color-mix(in srgb, var(--abl-blog-paper-edge) 40%, transparent);
    --abl-text:         var(--abl-blog-paper-text);
    --abl-heading:      var(--abl-blog-paper-heading);
    --abl-muted:        var(--abl-blog-paper-muted);

    background-color: var(--abl-blog-paper);
    background-image:
        var(--abl-blog-paper-noise),
        radial-gradient(ellipse 100% 80% at 50% 50%,
            transparent 40%,
            color-mix(in srgb, var(--abl-blog-paper-edge) 60%, transparent) 100%);
    background-attachment: fixed;
    background-size: 200px 200px, cover;
    background-repeat: repeat, no-repeat;
    color: var(--abl-blog-paper-text);
    min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────── */
.abl-blog-post-wrap {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* ── Post Card ─────────────────────────────────────────────
   Wraps the title + meta + body so the detail view mirrors
   the card look from the blog index (/blog). Uses the same
   palette variables that the paper body remap sets, so it
   blends with the paper background while still reading as a
   distinct "page" of content. */
.abl-blog-post-card {
    display: block;
    background: var(--abl-card);
    border: 1px solid var(--abl-border);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--abl-card-shadow);
}

/* ── Back to Blog (top-left breadcrumb) ────────────────── */
.abl-blog-post-breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 24px 0;  /* 64px navbar + 16px spacing */
}
.abl-blog-post-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--abl-muted, #64748b);
    text-decoration: none;
    transition: color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.abl-blog-post-breadcrumb-link:hover {
    /* Header rules deliberately do NOT use the blog accent — the
       breadcrumb stays visually neutral regardless of the admin's
       blog colour. Same convention as the AEI landing breadcrumb
       and the AEI shell back button. */
    color: var(--abl-heading);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* ── Title ─────────────────────────────────────────────── */
.abl-blog-post-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 32px;
    color: var(--abl-heading, #1e293b);
}

/* ── Meta (date + author tag) ──────────────────────────── */
.abl-blog-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--abl-muted, #64748b);
}
.abl-blog-post-meta span + span::before {
    content: "\00b7";
    margin-right: 12px;
}

/* ── Body (with vertical left border) ──────────────────── */
.abl-blog-post-body {
    border-left: 2px solid var(--abl-border, #e2e8f0);
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--abl-text, #334155);
}
.abl-blog-post-body h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--abl-heading, #1e293b);
}
.abl-blog-post-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 22px 0 8px;
    color: var(--abl-heading, #1e293b);
}
.abl-blog-post-body p {
    margin: 0 0 16px;
}
.abl-blog-post-body a {
    color: var(--abl-blog-accent, #c6953b);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.abl-blog-post-body a:hover {
    opacity: 0.8;
}
.abl-blog-post-body strong {
    color: var(--abl-heading, #1e293b);
    font-weight: 600;
}
.abl-blog-post-body ul, .abl-blog-post-body ol {
    padding-left: 24px;
    margin: 0 0 16px;
}
.abl-blog-post-body li {
    margin-bottom: 6px;
}
.abl-blog-post-body blockquote {
    border-left: 3px solid var(--abl-blog-accent, #c6953b);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--abl-muted, #64748b);
    font-style: italic;
}

/* ── HTML-mode post (full-width, no prose constraints) ─── */
.abl-blog-post-wrap--html {
    max-width: 1100px;
}
.abl-blog-post-body-html {
    font-size: 15px;
    line-height: 1.7;
    color: var(--abl-text, #334155);
    /* No border-left, no padding-left, no max-width cap */
}

/* ── Collapsible body ──────────────────────────────────── */
.abl-blog-post-body-preview {
    position: relative;
}
.abl-blog-post-body-preview--truncated {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
/* Fade to the card background (not page bg) — the preview now
   lives inside .abl-blog-post-card, so the gradient must blend
   into --abl-card to mask truncated content cleanly. */
.abl-blog-post-body-preview--truncated:not(.abl-blog-post-body-preview--expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(transparent, var(--abl-card));
    pointer-events: none;
}
.abl-blog-post-body-preview--expanded {
    max-height: none;
}

/* ── Toggle button ─────────────────────────────────────── */
.abl-blog-post-toggle {
    background: none;
    border: none;
    color: var(--abl-blog-accent, #c6953b);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
}
.abl-blog-post-toggle:hover {
    opacity: 0.8;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
    .abl-blog-post-wrap {
        padding: 24px 16px 64px;
    }
    .abl-blog-post-card {
        padding: 24px;
    }
    .abl-blog-post-title {
        font-size: 26px;
    }
    .abl-blog-post-body {
        font-size: 14px;
        padding-left: 16px;
    }
}
