/* modules/blog/assets/blog.css — the public blog surface (listing + a single post).
 *
 * Scoped under `.blog`, exactly the way modules/forums/assets/forums.css scopes under
 * `.forums`: a theme's own rules keep the page around it, and every colour, radius, shadow
 * and font reads the theme contract's --cms-* tokens (site/themes/README.md section 6). A
 * theme that defines them restyles the whole blog without touching this file.
 *
 * Blog never shipped its own stylesheet before this file — its two views were written in
 * the private class vocabulary of a theme that never lived in this repo at all, so /blog
 * rendered unstyled on every fork except the one nobody could see. Unlike forums, there is
 * no pre-1.5.0 name to fall back to here: blog never read a custom property at all before
 * today. So each token reads --cms-* first, then a currentColor-derived neutral, which
 * adapts to a light or a dark theme on its own where a literal cannot.
 *
 * ⚠️ Body text falls back to currentColor UNDIMMED, and that is deliberate. `.blog` sets its
 * own color from this token, so a descendant that derives from currentColor again multiplies
 * the alpha: 0.78 x 0.78 = 0.61, about 2.7:1 on white, below AA. A module has no business
 * making the theme's body text lighter than the theme set it — only muted and meta text is
 * dimmed, and only once.
 *
 * The plain literal before each color-mix() declaration is the intended value written out so
 * a reader can see it, NOT a runtime fallback: a custom property accepts any token stream, so
 * the color-mix() line always parses and always wins, and an engine without color-mix()
 * computes the token to inherit/initial rather than to that literal.
 *
 * Two breakpoints (960px, 620px): the card grid runs 3 columns, then 2, then 1. */

.blog {
    --blog-ink:var(--cms-ink, currentColor);
    --blog-text:#576071;
    --blog-text:var(--cms-text, currentColor);   /* NOT dimmed: see the note above */
    --blog-muted:#8A93A3;
    --blog-muted:var(--cms-muted, color-mix(in oklab, currentColor 60%, transparent));
    --blog-line:#E7E9EF;
    --blog-line:var(--cms-line, color-mix(in oklab, currentColor 14%, transparent));
    --blog-line-strong:#D6DBE4;
    --blog-line-strong:var(--cms-line-strong, color-mix(in oklab, currentColor 30%, transparent));
    --blog-accent:#059669;
    --blog-accent:var(--cms-accent, #059669);
    --blog-surface:#FFFFFF;
    --blog-surface:var(--cms-surface, color-mix(in oklab, currentColor 4%, transparent));
    --blog-sunk:#F7F8FA;
    --blog-sunk:var(--cms-sunk, color-mix(in oklab, currentColor 7%, transparent));
    --blog-shadow:var(--cms-shadow, none);
    --blog-radius:var(--cms-radius, 10px);
    --blog-radius-sm:var(--cms-radius-sm, 7px);
    --blog-font:var(--cms-font, inherit);
    --blog-font-display:var(--cms-font-display, var(--blog-font));
    --blog-font-mono:var(--cms-font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
    display:flex;
    flex-direction:column;
    gap:32px;
    color:var(--blog-text);
    font-family:var(--blog-font);
}

.blog-index{gap:40px}
.blog-post{gap:28px}

/* :where() contributes no specificity, so this is the DEFAULT link colour and focus ring
   that any component class below overrides without needing a longer selector. */
:where(.blog) a{color:var(--blog-accent);text-decoration:none}
:where(.blog) a:focus-visible,:where(.blog) button:focus-visible{outline:2px solid var(--blog-accent);outline-offset:2px;border-radius:4px}

/* -- shared: meta text and tag pills, used on both views --------------------------- */
.blog-meta{font-family:var(--blog-font-mono);font-size:0.8125rem;color:var(--blog-muted);letter-spacing:-0.01em}
.blog-tags{display:inline-flex;flex-wrap:wrap;gap:6px}
.blog-tag{display:inline-flex;align-items:center;padding:3px 10px;
    border:1px solid var(--blog-line-strong);border-radius:999px;
    font-size:0.75rem;font-weight:600;color:var(--blog-text)}

/* -- shared: the ghost button used by the pager and (sized up) nowhere else -------- */
.blog-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
    min-height:44px;padding-inline:16px;border:1px solid var(--blog-line-strong);
    border-radius:var(--blog-radius-sm);background:var(--blog-surface);color:var(--blog-ink);
    font-family:var(--blog-font);font-size:0.875rem;font-weight:600;text-decoration:none;
    box-shadow:var(--blog-shadow);transition:border-color .15s ease,color .15s ease}
.blog-btn:hover{border-color:var(--blog-accent);color:var(--blog-accent)}

/* -- index: hero header -------------------------------------------------------------- */
.blog-head{padding-bottom:28px;border-bottom:1px solid var(--blog-line)}
.blog-heading{margin:0;font-family:var(--blog-font-display);font-size:2.25rem;font-weight:600;
    letter-spacing:-0.03em;line-height:1.1;color:var(--blog-ink)}
.blog-empty{margin:0;color:var(--blog-text)}

/* -- index: the card grid ------------------------------------------------------------ */
.blog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}

.blog-card{background:var(--blog-surface);border:1px solid var(--blog-line);
    border-radius:var(--blog-radius);box-shadow:var(--blog-shadow);overflow:hidden;
    transition:border-color .15s ease}
.blog-card:hover{border-color:var(--blog-line-strong)}
.blog-card-link{display:flex;flex-direction:column;height:100%;color:inherit;
    text-decoration:none}
.blog-card-cover{aspect-ratio:16/10;display:grid;place-items:center;
    background:var(--blog-sunk);border-bottom:1px solid var(--blog-line);
    color:var(--blog-line-strong);font-size:1.5rem}
.blog-card-cover picture{display:block;width:100%;height:100%}
.blog-card-cover img{display:block;width:100%;height:100%;object-fit:cover}
.blog-card-body{display:flex;flex-direction:column;gap:8px;flex-grow:1;padding:18px}
.blog-card-title{margin:0;font-family:var(--blog-font-display);font-size:1.0625rem;
    font-weight:600;letter-spacing:-0.02em;line-height:1.3;color:var(--blog-ink);
    transition:color .15s ease}
.blog-card-link:hover .blog-card-title{color:var(--blog-accent)}
.blog-card-excerpt{margin:0;font-size:0.9375rem;line-height:1.5;color:var(--blog-text)}
.blog-card-body .blog-tags{margin-top:auto;padding-top:10px}

/* -- index: pager --------------------------------------------------------------------- */
.blog-pager{display:flex;align-items:center;justify-content:space-between;gap:16px;
    padding-top:20px;border-top:1px solid var(--blog-line)}

/* -- post ------------------------------------------------------------------------------ */
.blog-back{display:inline-flex;align-items:center;gap:7px;min-height:44px;
    font-weight:600;font-size:0.9375rem}
.blog-post-head{padding-block:20px 28px;border-bottom:1px solid var(--blog-line)}
.blog-post-title{margin:0;font-family:var(--blog-font-display);font-size:2.5rem;
    font-weight:600;letter-spacing:-0.035em;line-height:1.1;color:var(--blog-ink)}
.blog-post-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px}
.blog-post-cover{aspect-ratio:2/1;overflow:hidden;background:var(--blog-sunk);border:1px solid var(--blog-line);border-radius:var(--blog-radius)}
.blog-post-cover picture{display:block;width:100%;height:100%}
.blog-post-cover img{display:block;width:100%;height:100%;object-fit:cover}

/* -- post: the prose body. Admin-authored HTML — nothing else in the product styles it -- */
.blog-prose{max-width:68ch;font-size:1.0625rem;line-height:1.75;color:var(--blog-text);
    display:flex;flex-direction:column;gap:18px;overflow-wrap:break-word}
.blog-prose > :first-child{margin-top:0}
.blog-prose h2,.blog-prose h3{font-family:var(--blog-font-display);font-weight:600;letter-spacing:-0.02em;line-height:1.25;color:var(--blog-ink)}
.blog-prose h2{font-size:1.5rem;margin-top:12px}
.blog-prose h3{font-size:1.1875rem;margin-top:8px}
.blog-prose p{margin:0}
.blog-prose strong{color:var(--blog-ink);font-weight:600}
.blog-prose ul,.blog-prose ol{margin:0;padding-left:1.4em;display:flex;
    flex-direction:column;gap:8px}
.blog-prose li{padding-left:2px}
.blog-prose blockquote{margin:0;padding-left:18px;border-left:3px solid var(--blog-line-strong);color:var(--blog-muted);font-style:italic}
.blog-prose code{font-family:var(--blog-font-mono);font-size:0.875em;background:var(--blog-sunk);padding:2px 6px;border-radius:4px}
.blog-prose pre{margin:0;padding:16px;background:var(--blog-sunk);
    border:1px solid var(--blog-line);border-radius:var(--blog-radius-sm);overflow-x:auto}
.blog-prose pre code{padding:0;background:none}
.blog-prose img{max-width:100%;height:auto;border-radius:var(--blog-radius-sm)}
.blog-prose a{text-decoration:underline;text-underline-offset:2px}
.blog-prose hr{height:1px;border:0;background:var(--blog-line);margin:4px 0}
.blog-prose table{display:block;overflow-x:auto;border-collapse:collapse;width:100%;font-size:0.9375rem}
.blog-prose th,.blog-prose td{padding:8px 12px;border:1px solid var(--blog-line);text-align:left}
.blog-prose th{background:var(--blog-sunk);font-weight:600;color:var(--blog-ink)}

/* Media queries at the very bottom of the sheet — house style (lint_rules CSS_MEDIA_ORDER). */
@media (max-width:960px){.blog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:620px){.blog-grid{grid-template-columns:1fr}}
