/* blog.css — public blog (index + single post). Uses the site design tokens
   from styles.css (loaded first), so it follows the active theme. */

.blog-page { min-height: 100vh; background: var(--bg); color: var(--ink); }

/* Header */
.blog-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 64px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.blog-head a.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.blog-head .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display, inherit); }
.blog-head .brand b { font-family: var(--font-display, inherit); font-size: 19px; font-weight: 700; }
.blog-head .actions { display: flex; align-items: center; gap: 18px; }
.blog-head .actions a { text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.blog-head .actions a:hover { color: var(--ink); }
.blog-head .actions .btn-cta { background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-weight: 600; }

.blog-wrap { max-width: 1120px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 40px) 80px; }

/* Index hero */
.blog-hero { margin-bottom: 40px; }
.blog-hero .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.blog-hero h1 { font-family: var(--font-display, inherit); font-size: clamp(38px, 6vw, 60px); font-weight: 800; line-height: 1.02; margin: 12px 0 0; letter-spacing: -.02em; }
.blog-hero p { font-size: 18px; color: var(--ink-2); margin: 14px 0 0; max-width: 580px; line-height: 1.6; }

/* Category filters */
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.blog-cats a {
  text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-2); background: var(--surface);
}
.blog-cats a:hover { border-color: var(--ink-3); color: var(--ink); }
.blog-cats a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Post grid */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.blog-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -18px color-mix(in oklab, var(--ink) 40%, transparent); }
.blog-card .cover { aspect-ratio: 16/9; background: var(--bg-2) center/cover no-repeat; }
.blog-card .cover.placeholder { display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 16%, var(--surface)), var(--surface)); }
.blog-card .cover.placeholder span { font-family: var(--font-display, inherit); font-size: 40px; font-weight: 800; color: color-mix(in oklab, var(--brand) 50%, var(--ink-3)); }
.blog-card .body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card .cat { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.blog-card h2 { font-family: var(--font-display, inherit); font-size: 21px; font-weight: 700; line-height: 1.22; margin: 0; }
.blog-card p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.blog-card .meta { margin-top: auto; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; }

.blog-empty { text-align: center; padding: 80px 20px; color: var(--ink-2); }
.blog-empty .big { font-size: 40px; margin-bottom: 12px; }

/* Single post */
.post-wrap { max-width: 760px; margin: 0 auto; padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 32px) 80px; }
.post-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; margin-bottom: 26px; }
.post-back:hover { color: var(--ink); }
.post-cat { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.post-title { font-family: var(--font-display, inherit); font-size: clamp(32px, 5.5vw, 52px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; margin: 12px 0 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 0; color: var(--ink-3); font-size: 14px; }
.post-meta .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.post-cover { margin: 30px 0 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-2) center/cover no-repeat; }

.post-body { margin-top: 38px; font-size: 18px; line-height: 1.75; color: var(--ink); }
.post-body > *:first-child { margin-top: 0; }
.post-body h2 { font-family: var(--font-display, inherit); font-size: 28px; font-weight: 700; margin: 1.6em 0 .5em; letter-spacing: -.01em; }
.post-body h3 { font-size: 22px; font-weight: 700; margin: 1.4em 0 .4em; }
.post-body p { margin: 0 0 1.1em; }
.post-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.post-body ul, .post-body ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.post-body li { margin: .35em 0; }
.post-body blockquote { border-left: 3px solid var(--brand); margin: 1.5em 0; padding: 6px 0 6px 20px; font-style: italic; color: var(--ink-2); font-size: 20px; }
.post-body img, .post-body .blog-figure img { max-width: 100%; height: auto; border-radius: 12px; display: block; }
.post-body .blog-figure { margin: 1.8em 0; }
.post-body .blog-figure figcaption { font-size: 13.5px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.post-body .blog-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.8em 0; border-radius: 12px; overflow: hidden; background: #000; }
.post-body .blog-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-tags a { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
.post-tags a:hover { color: var(--ink); border-color: var(--ink-3); }

.blog-foot { border-top: 1px solid var(--line); padding: 30px clamp(20px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; color: var(--ink-3); font-size: 13.5px; }
.blog-foot a { color: var(--ink-2); text-decoration: none; }
.blog-foot a:hover { color: var(--ink); }

@media (max-width: 620px) {
  .blog-head .actions a:not(.btn-cta) { display: none; }
}
