/* ═══════════════════════════════════════════
   DESIGN TOKENS — mirrors new_index.css
   (self-contained, overrides base.css vars)
═══════════════════════════════════════════ */
:root {
  --bg:       oklch(0.975 0.007 75);
  --bg2:      oklch(0.955 0.007 75);
  --bg3:      oklch(0.930 0.008 75);
  --line:     oklch(0.875 0.006 75);
  --text:     oklch(0.14  0.012 250);
  --text-dim: oklch(0.46  0.010 250);
  --text-sub: oklch(0.64  0.008 250);
  --accent:   oklch(0.34  0.08  162);
  --accent-l: oklch(0.34  0.08  162 / 0.09);
  --f-serif:  Georgia, Garamond, "Palatino Linotype", "Times New Roman", serif;
  --f-sans:   system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono:   ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --pad:      max(24px, 5vw);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       oklch(0.10  0.010 200);
    --bg2:      oklch(0.135 0.010 200);
    --bg3:      oklch(0.165 0.010 200);
    --line:     oklch(0.24  0.008 200);
    --text:     oklch(0.93  0.005 75);
    --text-dim: oklch(0.66  0.008 200);
    --text-sub: oklch(0.48  0.006 200);
    --accent:   oklch(0.72  0.14  162);
    --accent-l: oklch(0.72  0.14  162 / 0.10);
  }
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* ═══════════════════════════════════════════
   SITE HEADER — fixed, matches site-nav
═══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: oklch(0.975 0.007 75 / 0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: oklch(0.10 0.010 200 / 0.92); }
}
.logo-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.logo-mark { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.logo-name {
  font-size: 15px; font-weight: 600;
  letter-spacing: 0.03em; line-height: 1.2;
}
.logo-name small {
  display: block; font-size: 10px; font-weight: 400;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-sub);
}
.back-link {
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--text-sub);
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ═══════════════════════════════════════════
   BLOG SHELL & LAYOUT
═══════════════════════════════════════════ */
.blog-shell {
  padding-top: 60px;
  min-height: 100vh;
}

.blog-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}

/* ═══════════════════════════════════════════
   BLOG HERO
═══════════════════════════════════════════ */
.blog-hero {
  padding: 56px var(--pad) 44px;
  border-bottom: 1px solid var(--line);
}

.blog-eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.blog-eyebrow::before {
  content: ''; display: block;
  width: 28px; height: 1px;
  background: var(--accent); flex-shrink: 0;
}
.t-label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-sub);
}

.blog-hero h1 {
  font-family: var(--f-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 14px;
}

.blog-hero > p {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════
   FEED VIEW SWITCH
═══════════════════════════════════════════ */
.feed-switch {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--bg2);
  margin-bottom: 0;
}
.feed-switch__btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-sub);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.feed-switch__btn + .feed-switch__btn {
  border-left: 1px solid var(--line);
}
.feed-switch__btn:hover { color: var(--text); }
.feed-switch__btn.is-active {
  color: var(--accent);
  background: var(--accent-l);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   FEED FILTER BAR
═══════════════════════════════════════════ */
.feed-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--pad);
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.feed-filter[hidden] { display: none; }
.feed-filter__summary { color: var(--text-dim); font-weight: 300; }
.feed-filter__clear { color: var(--accent); font-size: 12px; }
.feed-filter__clear:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════
   BLOG FEED
═══════════════════════════════════════════ */
.blog-feed { border-bottom: 1px solid var(--line); }

.status {
  padding: 20px var(--pad);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 300;
  border-bottom: 1px solid var(--line);
}

.news-grid { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════
   POST CARD
═══════════════════════════════════════════ */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px var(--pad);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.15s;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: var(--bg2); }
.post-card.is-clickable { cursor: pointer; }
.post-card.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.post-card--highlight { background: var(--accent-l); }

/* ─── Post header ─── */
.post-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.post-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--accent-l);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.post-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.post-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.post-author-line {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 5px;
}
.post-author { font-size: 13px; font-weight: 600; color: var(--text); }
.post-handle,
.post-separator,
.post-meta { font-size: 12px; color: var(--text-sub); }
.post-submeta { font-size: 11px; color: var(--text-sub); letter-spacing: 0.03em; }

.post-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-l);
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ─── Post image ─── */
.post-image {
  width: 100%;
  height: clamp(180px, 38vw, 400px);
  object-fit: cover;
  border: 1px solid var(--line);
}

/* ─── Post title ─── */
.post-title {
  font-family: var(--f-serif);
  font-size: clamp(18px, 2.8vw, 22px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}

/* ─── Post text ─── */
.post-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
  font-weight: 300;
  white-space: pre-line;
}
.post-text--article { color: var(--text-sub); }
.post-text a { color: var(--accent); }
.post-text-preview,
.post-text-rest { white-space: pre-line; }
.post-text-details { display: block; margin-top: 10px; }
.post-text-details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.03em;
  list-style: none;
}
.post-text-details > summary::-webkit-details-marker { display: none; }
.post-text-details[open] > summary { display: none; }
.post-text-details[open] .post-text-rest { display: block; margin-top: 8px; }

/* ─── Link preview ─── */
.post-link-preview {
  display: block;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.post-link-preview:hover { background: var(--bg3); border-color: var(--accent); }
.post-link-preview img {
  width: 100%; height: 200px; object-fit: cover;
  display: block; border-bottom: 1px solid var(--line);
}
.post-link-meta { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.post-link-meta strong { font-size: 14px; font-weight: 500; color: var(--text); }
.post-link-meta span { font-size: 12px; color: var(--text-sub); }

/* ─── Post actions ─── */
.post-actions {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.post-action {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-sub);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.post-action:hover { border-color: var(--accent); color: var(--text); }
.post-action--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.post-action--primary:hover { opacity: 0.85; color: var(--bg); }

/* ─── Post tags ─── */
.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.post-tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s;
}
.post-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Code in feed ─── */
code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
}
pre {
  margin: 10px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg3);
  overflow-x: auto;
}
pre code { display: block; padding: 0; border: none; background: transparent; }

/* ═══════════════════════════════════════════
   LOAD MORE
═══════════════════════════════════════════ */
.load-more {
  display: flex; justify-content: center;
  padding: 28px var(--pad);
}
.load-more button {
  display: inline-block;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.load-more button:hover {
  background: var(--accent);
  color: var(--bg);
}
.load-more button[disabled] {
  border-color: var(--line);
  color: var(--text-sub);
  cursor: not-allowed;
}
.load-more button[disabled]:hover { background: transparent; color: var(--text-sub); }
.load-more button.primary { /* same styles via .btn below */ }

/* ═══════════════════════════════════════════
   ARTICLE PAGE
═══════════════════════════════════════════ */
.blog-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px var(--pad) 96px;
}

.blog-article > .card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.blog-article header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-article h1 {
  font-family: var(--f-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}

.blog-article header > p {
  font-size: 16px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.7;
  max-width: 560px;
}
.muted { color: var(--text-sub); }

.article-hero {
  width: 100%;
  height: clamp(200px, 42vw, 380px);
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 32px;
}

.article-body {
  line-height: 1.85;
  display: grid;
  gap: 18px;
  min-width: 0;
}
.article-body > * { min-width: 0; }

.article-body ul,
.article-body ol {
  padding-inline-start: 1.6em;
  margin: 0;
}
.article-body li + li { margin-top: 0.35em; }

.article-body p {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 300;
  margin: 0;
  max-width: 640px;
}

.article-body h2 {
  font-family: var(--f-serif);
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 8px;
}
.article-body h2:first-child { border-top: none; padding-top: 0; }

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.article-body a { color: var(--accent); }
.article-body a:hover { text-decoration: underline; text-underline-offset: 2px; }

.article-body blockquote {
  margin: 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg2);
  color: var(--text-dim);
  font-weight: 300;
}

.article-body :where(code:not(pre code)) {
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
}
.article-body pre {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--bg3);
  overflow-x: auto;
}
.article-body pre code {
  display: block; padding: 0;
  border: none; background: transparent;
  font-size: 13px; white-space: pre;
}

.article-body img {
  max-width: 100%;
  border: 1px solid var(--line);
  display: block;
}

.article-body .article-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg2);
}
.article-body table {
  width: max-content; min-width: 100%;
  border-spacing: 0; border-collapse: separate;
}
.article-body thead { background: var(--bg3); }
.article-body th,
.article-body td {
  padding: 10px 14px;
  min-width: 140px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
.article-body th { font-weight: 600; color: var(--text); }
.article-body td { color: var(--text-dim); font-weight: 300; }
.article-body tr > :last-child { border-right: none; }
.article-body tbody tr:last-child > * { border-bottom: none; }

/* ─── Article tags ─── */
.article-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-tags span {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 11px;
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════
   SITE FOOTER — matches site-footer
═══════════════════════════════════════════ */
.site-footer {
  padding: 28px var(--pad);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-sub);
}
.site-footer a { color: var(--text-sub); transition: color 0.2s; }
.site-footer a:hover { color: var(--text); }
.site-footer-links { display: flex; gap: 20px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 560px) {
  .blog-hero { padding: 40px var(--pad) 32px; }
  .post-card { padding: 20px var(--pad); }
  .blog-article { padding: 40px var(--pad) 64px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
