/* ============================================================
   Page 4.1 — Blog post template (pages/blog_post.css)
   Linked from templates/pages/blog_post.php (posts render under
   the page key 'blog', so the layout auto-links pages/blog.css —
   shared article-card/newsletter styles live there). Tokens only.
   ============================================================ */

/* ── Article header: dark brand band (surface-dark in main.css);
      doubles as the spec's "no hero image" brand-tile fallback ── */
.post-hero {
    position: relative;
    padding-block: var(--space-xl) var(--space-2xl);
    overflow: hidden;
}
@media (min-width: 1024px) {
    .post-hero { padding-block: var(--space-xl) var(--space-3xl); }
}
.post-hero__category { margin-bottom: var(--space-md); }
.post-hero__title { margin-bottom: var(--space-md); }
.post-hero__byline {
    font-size: var(--text-sm); font-weight: 600;
    color: var(--ink-inverse);
}
.post-hero__meta {
    font-size: var(--text-sm);
    color: var(--ink-inverse-muted);
    margin-top: var(--space-2xs);
}

/* Cover image below the meta line: fixed ratio, no layout shift */
.post-hero__cover {
    margin-top: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1200 / 630;
    background: var(--navy-950);
}
.post-hero__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Decorative brand accent at the band's base (post-header-image slot) */
.post-hero__tile {
    position: absolute; inset-inline: 0; bottom: 0;
    height: 4px; /* raw px: hairline accent, not a spacing step */
    background: linear-gradient(90deg, var(--cyan-500) 0%, var(--accent-300) 60%, transparent 100%);
    opacity: .85;
}

/* Breadcrumb on the dark band: main.css colors target light
   surfaces — re-pin to the on-dark ink/cyan pairs (AA on navy) */
.post-hero .breadcrumb { color: var(--ink-inverse-muted); margin-bottom: var(--space-lg); }
.post-hero .breadcrumb__trail a { color: var(--cyan-300); }
.post-hero .breadcrumb__trail a:hover { color: var(--surface-0); }
.post-hero .breadcrumb__trail [aria-current="page"] { color: var(--ink-inverse); }
.post-hero .breadcrumb__sep { color: var(--ink-inverse-muted); }

/* ── Article body: white reading surface, centered measure ─── */
.post-article { background: var(--surface-0); }
.post-article .prose { margin-inline: auto; }
/* Lead paragraph (spec: text-lg, ink-600) — first body paragraph */
.post-article .prose > p:first-child {
    font-size: var(--text-lg);
    color: var(--ink-600);
}

/* ── Related posts: shared blog-grid, never a featured span ── */
.post-related { background: var(--surface-50); }
@media (min-width: 1024px) {
    .blog-grid--related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Images in the article body (BlogMarkdown): text-column width, no layout shift ── */
/* Never wider than the image itself (the width attribute = intrinsic width):
   a 640 px original stays sharp and centred instead of being upscaled. */
.post-article .prose figure.post-figure {
    width: fit-content;
    max-width: 100%;
    margin-block: var(--space-lg);
    margin-inline: auto;
}
.post-article .prose figure.post-figure img {
    display: block;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
    height: auto; /* width/height attributes reserve the box (aspect-ratio), so no CLS */
    border-radius: var(--radius-lg);
    background: var(--surface-50);
}
.post-article .prose figure.post-figure figcaption {
    margin-top: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--ink-600);
}

/* Fallback post: language tag under the title (article in another language than the UI) */
.post-hero__langline { margin: 0 0 var(--space-md); }
.post-lang-tag {
    display: inline-flex; align-items: center;
    border: 1px solid rgba(159, 177, 196, .5);
    color: var(--ink-inverse-muted);
    border-radius: var(--radius-full);
    padding: var(--space-3xs) var(--space-sm);
    font-size: var(--text-xs); font-weight: 600;
    letter-spacing: .04em;
}
