/* The learner blog - /blog, /post, /write (pages/blog.html, post.html,
   write.html). Rules and the reasons behind them: DESIGN.md, "Blog".
   Every colour is a design-system token, so both themes and every palette
   follow; the post body itself is drawn by topic-split-view.6f621646c721.css's .tmd-*
   rules (the same renderer as a topic.md). */

.blog-shell { max-width: 720px; margin: 0 auto; padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-8); }
.blog-shell--wide { max-width: 1180px; }
.blog-shell [hidden] { display: none !important; }

.blog-eyebrow { margin: 0; font-size: var(--ds-text-xs); font-weight: 600; letter-spacing: var(--ds-tracking-wide); text-transform: uppercase; color: var(--ds-text-muted); }
.blog-muted { color: var(--ds-text-muted); }
.blog-msg { min-height: 1.4em; margin: var(--ds-space-2) 0 0; font-size: var(--ds-text-sm); color: var(--ds-text-muted); }
.blog-msg--err { color: var(--ds-danger); }
.blog-msg--ok { color: var(--ds-success); }

/* --- feed ------------------------------------------------------------- */
.blog-head { display: grid; gap: var(--ds-space-3); margin-bottom: var(--ds-space-5); }
.blog-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-3); flex-wrap: wrap; }
.blog-head h1 { margin: var(--ds-space-1) 0 0; }
.blog-head p { margin: 0; color: var(--ds-text-2); max-width: 60ch; }
.blog-search { width: 100%; }
.blog-tags { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
.blog-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-border-subtle); background: var(--ds-surface-2); color: var(--ds-text-2);
  font-size: var(--ds-text-sm); cursor: pointer; text-decoration: none; line-height: 1.5;
}
.blog-tag:hover { border-color: var(--ds-border-strong); color: var(--ds-text); }
.blog-tag[aria-pressed="true"] { background: var(--ds-accent-quiet); border-color: var(--ds-accent-line); color: var(--ds-accent); }
.blog-tag small { color: var(--ds-text-muted); font-variant-numeric: tabular-nums; }
span.blog-tag { cursor: default; }

.blog-list { display: grid; }
.blog-card { display: grid; gap: 6px; padding: var(--ds-space-5) 0; border-top: 1px solid var(--ds-border-subtle); color: inherit; text-decoration: none; }
.blog-card:first-child { border-top: 0; }
.blog-card h2 { margin: 2px 0 0; font-size: var(--ds-text-lg); line-height: var(--ds-leading-snug); }
.blog-card:hover h2, .blog-card:focus-visible h2 { color: var(--ds-accent); }
.blog-card p { margin: 0; color: var(--ds-text-2); }
.blog-byline { display: flex; align-items: center; gap: var(--ds-space-2); flex-wrap: wrap; font-size: var(--ds-text-sm); color: var(--ds-text-muted); }
.blog-byline a { color: var(--ds-text); font-weight: 600; text-decoration: none; }
.blog-byline a:hover { text-decoration: underline; }
.blog-meta { display: flex; align-items: center; gap: var(--ds-space-3); flex-wrap: wrap; font-size: var(--ds-text-sm); color: var(--ds-text-muted); font-variant-numeric: tabular-nums; }

.blog-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-size: var(--ds-text-xs); font-weight: 700; letter-spacing: .02em;
  background: color-mix(in srgb, var(--blog-av, var(--ds-accent)) 24%, var(--ds-surface-2));
  color: var(--ds-text); border: 1px solid color-mix(in srgb, var(--blog-av, var(--ds-accent)) 45%, transparent);
}
.blog-avatar--lg { width: 44px; height: 44px; font-size: var(--ds-text-sm); }

.blog-author-head { display: flex; align-items: center; gap: var(--ds-space-3); }
.blog-author-head h1 { margin: 0; }

/* --- post ------------------------------------------------------------- */
.blog-post-head { display: grid; gap: var(--ds-space-3); margin-bottom: var(--ds-space-4); }
.blog-post-head h1 { margin: 0; font-size: var(--ds-text-2xl) !important; line-height: var(--ds-leading-tight); }
.blog-sub { margin: 0; font-size: var(--ds-text-lg); color: var(--ds-text-muted); line-height: var(--ds-leading-snug); }
.blog-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); flex-wrap: wrap;
  padding: var(--ds-space-3) 0; margin-bottom: var(--ds-space-5);
  border-top: 1px solid var(--ds-border-subtle); border-bottom: 1px solid var(--ds-border-subtle);
}
.blog-actions { display: flex; align-items: center; gap: var(--ds-space-2); flex-wrap: wrap; }
.blog-clap { font-variant-numeric: tabular-nums; }
.blog-clap[data-mine="true"] { border-color: var(--ds-accent-line); color: var(--ds-accent); }
.blog-clap small { color: var(--ds-text-muted); font-weight: 500; }
.blog-body .tmd-article { font-size: var(--ds-text-md); }
.blog-body .tmd-meta { display: none; }
.blog-notice {
  display: grid; gap: var(--ds-space-2); padding: var(--ds-space-4) var(--ds-space-5); border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-border); background: var(--ds-surface-2);
}
.blog-notice strong { color: var(--ds-text); }
.blog-notice p { margin: 0; color: var(--ds-text-2); }
.blog-notice--warn { border-color: color-mix(in srgb, var(--ds-warning) 45%, transparent); background: var(--ds-warning-quiet); }
.blog-notice-actions { display: flex; gap: var(--ds-space-2); flex-wrap: wrap; margin-top: var(--ds-space-1); }
.blog-foot { margin-top: var(--ds-space-7); display: grid; gap: var(--ds-space-4); }
.blog-report { display: grid; gap: var(--ds-space-2); }

.blog-status { display: inline-block; padding: 2px 9px; border-radius: var(--ds-radius-pill); font-size: var(--ds-text-xs); font-weight: 600; white-space: nowrap; }
.blog-status--draft { background: var(--ds-surface-3); color: var(--ds-text-muted); border: 1px solid var(--ds-border-subtle); }
.blog-status--pending { background: var(--ds-warning-quiet); color: var(--ds-warning); }
.blog-status--published { background: var(--ds-success-quiet); color: var(--ds-success); }
.blog-status--hidden { background: var(--ds-danger-quiet); color: var(--ds-danger); }

/* --- editor ----------------------------------------------------------- */
.blog-editor-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-3); flex-wrap: wrap; margin-bottom: var(--ds-space-4); }
.blog-editor-top h1 { margin: var(--ds-space-1) 0 0; }
.blog-trust { padding: var(--ds-space-3) var(--ds-space-4); border-radius: var(--ds-radius); background: var(--ds-surface-2); border: 1px solid var(--ds-border-subtle); color: var(--ds-text-2); font-size: var(--ds-text-sm); margin-bottom: var(--ds-space-4); }
.blog-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ds-space-5); align-items: start; }
.blog-pane { display: grid; gap: var(--ds-space-3); min-width: 0; }
.blog-field { display: grid; gap: 6px; }
.blog-field .ds-input { width: 100%; }
.blog-title-input { font-size: var(--ds-text-lg) !important; font-weight: 600; }
.blog-md {
  min-height: 460px; resize: vertical; font-family: var(--ds-font-mono); font-size: var(--ds-text-sm); line-height: 1.6;
}
.blog-hint { margin: 0; font-size: var(--ds-text-xs); color: var(--ds-text-muted); }
.blog-preview {
  position: sticky; top: calc(var(--ds-navbar-h, 56px) + var(--ds-space-4));
  max-height: calc(100vh - var(--ds-navbar-h, 56px) - var(--ds-space-7)); overflow: auto;
  padding: var(--ds-space-5); border-radius: var(--ds-radius-lg); border: 1px solid var(--ds-border-subtle); background: var(--ds-surface);
}
.blog-preview h2.blog-preview-title { margin: 0 0 var(--ds-space-1); font-size: var(--ds-text-xl); }
.blog-mine { margin-top: var(--ds-space-7); }
.blog-mine h2 { font-size: var(--ds-text-lg); margin: 0 0 var(--ds-space-3); }
.blog-rows { border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.blog-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ds-space-3); align-items: center; padding: var(--ds-space-3) var(--ds-space-4); border-top: 1px solid var(--ds-border-subtle); }
.blog-row:first-child { border-top: 0; }
.blog-row h3 { margin: 0 0 4px; font-size: var(--ds-text-base); overflow-wrap: anywhere; }
.blog-row-actions { display: flex; gap: var(--ds-space-2); flex-wrap: wrap; justify-content: flex-end; }
.blog-row[aria-current="true"] { background: var(--ds-accent-quiet); }

@media (max-width: 900px) {
  .blog-editor { grid-template-columns: minmax(0, 1fr); }
  .blog-preview { position: static; max-height: none; }
  .blog-md { min-height: 300px; }
  .blog-row { grid-template-columns: minmax(0, 1fr); }
  .blog-row-actions { justify-content: flex-start; }
}

/* --- the blog's own frame (assets/js/blog-chrome.6f621646c721.js) --------------------
   No app shell on these pages: a top bar, the column, a footer. */
body.blog-page { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--ds-bg); color: var(--ds-text); font-family: var(--ds-font-sans); }
body.blog-page > main { flex: 1; width: 100%; box-sizing: border-box; }
.blog-skip { position: absolute; left: 12px; top: -48px; z-index: var(--ds-z-skiplink, 1000); padding: 8px 12px; border-radius: var(--ds-radius); background: var(--ds-accent-fill); color: var(--ds-text-on-fill); text-decoration: none; }
.blog-skip:focus { top: 12px; }
.blog-top {
  position: sticky; top: 0; z-index: var(--ds-z-navbar, 50);
  background: color-mix(in srgb, var(--ds-bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ds-border-subtle);
}
.blog-top-in { max-width: 1180px; margin: 0 auto; padding: 0 var(--ds-space-4); min-height: 60px; display: flex; align-items: center; gap: var(--ds-space-4); }
.blog-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ds-text); text-decoration: none; font-weight: 700; font-size: var(--ds-text-md); letter-spacing: -0.01em; }
.blog-brand em { font-style: normal; font-weight: 500; color: var(--ds-text-muted); }
.blog-brand-mark { width: 30px; height: 30px; border-radius: var(--ds-radius); display: inline-grid; place-items: center; background: var(--ds-text); color: var(--ds-bg); font-size: var(--ds-text-xs); font-weight: 800; }
.blog-nav { display: flex; gap: 2px; flex: 1; }
.blog-nav a { padding: 6px 10px; border-radius: var(--ds-radius-pill); color: var(--ds-text-2); text-decoration: none; font-size: var(--ds-text-sm); }
.blog-nav a:hover { color: var(--ds-text); background: var(--ds-surface-2); }
.blog-nav a[aria-current="page"] { color: var(--ds-text); font-weight: 600; }
.blog-top-actions { display: flex; align-items: center; gap: var(--ds-space-2); }
.blog-write-link { gap: 6px; }
.blog-write-link[aria-current="page"] { color: var(--ds-accent); }
.blog-account { position: relative; min-width: 32px; display: flex; justify-content: flex-end; }
.blog-me { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; }
.blog-me:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.blog-avatar--md { width: 32px; height: 32px; font-size: var(--ds-text-xs); }
.blog-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; display: grid; padding: 6px;
  border-radius: var(--ds-radius-lg); border: 1px solid var(--ds-border); background: var(--ds-surface); box-shadow: var(--ds-shadow-lg);
}
.blog-menu[hidden], body.blog-page [hidden] { display: none !important; }
.blog-menu a { padding: 8px 10px; border-radius: var(--ds-radius-sm); color: var(--ds-text); text-decoration: none; font-size: var(--ds-text-sm); }
.blog-menu a:hover, .blog-menu a:focus-visible { background: var(--ds-surface-2); outline: none; }
.blog-menu-name { margin: 0; padding: 8px 10px 6px; font-weight: 600; font-size: var(--ds-text-sm); border-bottom: 1px solid var(--ds-border-subtle); margin-bottom: 4px; overflow-wrap: anywhere; }
.blog-foot { border-top: 1px solid var(--ds-border-subtle); margin-top: var(--ds-space-8); }
.blog-foot-in { max-width: 1180px; margin: 0 auto; padding: var(--ds-space-5) var(--ds-space-4); display: flex; justify-content: space-between; gap: var(--ds-space-3); flex-wrap: wrap; font-size: var(--ds-text-sm); color: var(--ds-text-muted); }
.blog-foot a { color: var(--ds-text-2); }

/* Without the shell, the page owns its type scale. */
body.blog-page .blog-head h1 { font-size: var(--ds-text-2xl); letter-spacing: -0.02em; line-height: 1.1; }
body.blog-page .blog-card h2 { font-size: var(--ds-text-xl); letter-spacing: -0.015em; }
body.blog-page .blog-card p { font-size: var(--ds-text-md); }
body.blog-page .blog-body .tmd-article { font-size: var(--ds-text-md); line-height: 1.75; }
body.blog-page .blog-editor-top h1 { font-size: var(--ds-text-2xl); }

@media (max-width: 560px) {
  .blog-top-in { gap: var(--ds-space-2); }
  .blog-brand em, .blog-write-link span, .blog-nav { display: none; }
  .blog-top-actions { margin-left: auto; }
}
