/* Blog pages (views: resources/views/blog, chrome: App\Services\Blog\SiteShell).
   Loaded after the built site's sheets and uses only their tokens
   (public/site/css/tokens.css) and the home page's frame (--page, --sec-gap,
   .hm-sec, .hm-index from home.css). Kept outside public/site, which
   `site:sync` replaces.
   CONTENTS
     1. Frame: top of page, breadcrumbs, topic links
     2. Lists: featured article, card grid, pager
     3. Article: preview bar, head, byline, cover, contents list, prose
     4. Article end: tags, note, author card
     5. Author page
     6. Reduced motion */

/* 1. FRAME ===================================================== */
.bl-top { display: grid; gap: var(--s-4); padding: var(--s-12) var(--page) 0; }
.bl-top .t-h1 { max-width: 20ch; text-wrap: balance; }
.bl-lead { max-width: 52ch; }

.bl-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); color: var(--text-3); }
.bl-crumbs li + li::before { content: "/"; margin-inline-end: var(--s-2); color: var(--line-control); }
.bl-crumbs a { color: var(--text-2); text-decoration: none; }
.bl-crumbs [aria-current] { display: inline-block; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.bl-cats { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.bl-cats a {
    display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: var(--s-4);
    border: 1px solid var(--line-strong); border-radius: var(--r-pill);
    color: var(--text); font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
    transition: border-color var(--t-ui) var(--ease), background-color var(--t-ui) var(--ease);
}
.bl-cats a[aria-current] { border-color: var(--text); background: var(--text); color: var(--bg); }

/* 2. LISTS ===================================================== */
.bl-feature { padding: var(--s-10) var(--page) 0; }
.bl-feature-card { display: grid; gap: var(--s-6); color: var(--text); text-decoration: none; }
.bl-feature-media, .bl-card-media { overflow: hidden; border-radius: var(--r-card); background: var(--surface-mint); aspect-ratio: 16 / 9; }
.bl-feature-media img, .bl-card-media img { width: 100%; height: 100%; object-fit: cover; }
.bl-feature-text { display: grid; gap: var(--s-3); align-content: center; }
.bl-feature-text .t-h2 { text-wrap: balance; }
@media (min-width: 64rem) {
    .bl-feature-card { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-10); }
}

.bl-card-blank {
    display: grid; place-items: end start; width: 100%; height: 100%; padding: var(--s-5);
    color: var(--text-brand-strong); font-size: var(--fs-lg); font-weight: 500; letter-spacing: var(--tr-head);
}

.bl-list { padding: var(--sec-gap) var(--page) 0; }
main > .bl-list:last-child { padding-bottom: var(--sec-gap); }
.bl-list-title { margin-bottom: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line-strong); font-size: var(--fs-sm); font-weight: 500; color: var(--text-3); }
.bl-grid { display: grid; gap: var(--s-10) var(--s-6); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .bl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.bl-card a { display: grid; gap: var(--s-2); color: var(--text); text-decoration: none; }
.bl-card-media { margin-bottom: var(--s-2); }
.bl-card .t-h4 { font-size: var(--fs-lg); line-height: 1.3; text-wrap: balance; transition: color var(--t-ui) var(--ease); }
.bl-meta { font-size: var(--fs-xs); color: var(--text-3); }
@media (hover: hover) and (pointer: fine) {
    .bl-card a:hover .t-h4, .bl-feature-card:hover .t-h2 { color: var(--text-brand); }
    .bl-cats a:not([aria-current]):hover { border-color: var(--line-control); }
}

.bl-empty { padding-block: var(--s-6); }

.bl-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-12); }

/* 3. ARTICLE =================================================== */
.bl-preview {
    position: sticky; top: 0; z-index: 60; padding: var(--s-2) var(--page);
    background: var(--signal); color: var(--text); font-size: var(--fs-sm); font-weight: 500; text-align: center;
}

.bl-head { display: grid; gap: var(--s-4); max-width: 52rem; padding: var(--s-12) var(--page) 0; }
.bl-head .t-h1 { text-wrap: balance; }
.bl-cat { justify-self: start; color: var(--text-brand); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }

.bl-byline { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.bl-byline p { margin: 0; }
.bl-by a, .bl-reviewed a { color: var(--text); font-weight: 500; text-underline-offset: 0.2em; }
.bl-reviewed { color: var(--text-2); }
.bl-dates { display: flex; flex-wrap: wrap; gap: 0 var(--s-1); font-size: var(--fs-xs); }

.bl-avatar { flex: none; border-radius: 50%; object-fit: cover; }
.bl-avatar-blank { display: grid; place-items: center; width: 3rem; height: 3rem; background: var(--surface-mint); color: var(--text-brand-strong); font-size: var(--fs-sm); font-weight: 600; }

.bl-cover { margin: var(--s-10) var(--page) 0; }
.bl-cover img { width: 100%; max-height: 40rem; border-radius: var(--r-card); object-fit: cover; aspect-ratio: 16 / 9; }

.bl-layout { display: grid; gap: var(--s-8); padding: var(--s-12) var(--page) 0; }
@media (min-width: 64rem) {
    .bl-layout { grid-template-columns: 15rem minmax(0, 44rem); gap: var(--s-16); }
    .bl-layout-solo { grid-template-columns: minmax(0, 44rem); }
    .bl-toc nav { position: sticky; top: calc(var(--hdr-h, 4.5rem) + var(--s-6)); }
}

.bl-toc nav { display: grid; gap: var(--s-3); }
.bl-toc ol { display: grid; gap: var(--s-2); margin: 0; padding: 0 0 0 var(--s-4); border-left: 1px solid var(--line-strong); list-style: none; }
.bl-toc a { display: block; padding-block: var(--s-1); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; text-decoration: none; }
.bl-toc .bl-toc-3 a { padding-inline-start: var(--s-3); font-size: var(--fs-xs); }
@media (hover: hover) and (pointer: fine) { .bl-toc a:hover { color: var(--text-brand); } }
@media (max-width: 63.99rem) {
    .bl-toc { padding: var(--s-5); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
}

/* The prose: what the editor writes, set for reading. */
.bl-prose { color: var(--text); font-size: 1.0625rem; line-height: 1.7; }
.bl-prose > * + * { margin-top: 1.1em; }
.bl-prose h2, .bl-prose h3 { scroll-margin-top: calc(var(--hdr-h, 4.5rem) + var(--s-6)); text-wrap: balance; }
.bl-prose h2 { margin-top: 2.2em; font-size: var(--fs-2xl); font-weight: 500; line-height: var(--lh-head); letter-spacing: var(--tr-head); }
.bl-prose h3 { margin-top: 1.8em; font-size: var(--fs-xl); font-weight: 500; line-height: 1.3; }
.bl-prose h2 + *, .bl-prose h3 + * { margin-top: 0.6em; }
.bl-prose p, .bl-prose li { text-wrap: pretty; }
.bl-prose a { color: var(--text-brand); text-underline-offset: 0.2em; }
.bl-prose strong { font-weight: 600; }
.bl-prose ul, .bl-prose ol { padding-left: 1.25em; }
.bl-prose li + li { margin-top: 0.4em; }
.bl-prose li::marker { color: var(--text-3); }
.bl-prose blockquote { margin-inline: 0; padding: var(--s-1) 0 var(--s-1) var(--s-5); border-left: 2px solid var(--text-brand); color: var(--text-2); }
.bl-prose hr { margin-block: 2.5em; border: 0; border-top: 1px solid var(--line-strong); }
.bl-prose img { border-radius: var(--r-card); }
.bl-prose figure figcaption { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-3); }
.bl-prose mark { padding: 0 0.15em; border-radius: 2px; background: var(--surface-mint); color: inherit; }
.bl-prose .lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--text-2); }
.bl-prose small { font-size: var(--fs-sm); color: var(--text-2); }
.bl-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.bl-prose th, .bl-prose td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.bl-prose th { font-weight: 600; }
.bl-prose details { border-bottom: 1px solid var(--line-strong); }
.bl-prose details > summary { display: flex; align-items: center; min-height: 3rem; padding-block: var(--s-3); cursor: pointer; font-weight: 500; }
.bl-prose details > :not(summary) { padding-bottom: var(--s-4); }
.bl-prose pre { overflow-x: auto; padding: var(--s-4); border-radius: var(--r-sm); background: var(--surface); font-family: var(--font-mono); font-size: var(--fs-sm); }

/* 4. ARTICLE END =============================================== */
.bl-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-10) 0 0; padding: 0; list-style: none; }
.bl-tags li { padding: var(--s-1) var(--s-3); border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); color: var(--text-2); }

.bl-note { margin-top: var(--s-8); max-width: 60ch; }

.bl-author { display: flex; gap: var(--s-5); align-items: flex-start; margin-top: var(--s-8); padding: var(--s-6); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bl-author > div { display: grid; gap: var(--s-1); }
.bl-author .bl-avatar-blank { width: 4.5rem; height: 4.5rem; font-size: var(--fs-lg); }
.bl-author h2 a { color: var(--text); text-decoration: none; }
.bl-author-bio { margin-top: var(--s-2); max-width: 60ch; }
.bl-author-links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-top: var(--s-2); }
.bl-author-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--text-brand); text-underline-offset: 0.2em; }
@media (max-width: 30rem) { .bl-author { flex-direction: column; } }

/* 5. AUTHOR PAGE =============================================== */
.bl-profile-head { display: flex; align-items: center; gap: var(--s-5); }
.bl-profile-head .bl-avatar-blank { width: 7rem; height: 7rem; font-size: var(--fs-2xl); }
.bl-profile-bio { max-width: 64ch; }

/* 6. REDUCED MOTION ============================================ */
@media (prefers-reduced-motion: reduce) {
    .bl-cats a, .bl-card .t-h4 { transition: none; }
}
