html { scroll-behavior: smooth; }

/* ─── Page hero ───────────────────────────────────────── */
.blog-page-hero {
  padding: 140px 40px 60px;
  border-bottom: 1px solid var(--card-border);
}
.blog-hero-heading {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
  max-width: 700px;
}
.blog-hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
}

/* ─── Post list ───────────────────────────────────────── */
.blog-section { padding: 60px 40px 100px; }
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 8px;
  border-top: 1px solid var(--card-border);
}
.post-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 32px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--card-border);
  transition: opacity 0.2s;
}
.post-card:hover { opacity: 0.7; }
.post-date {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  padding-top: 3px;
}
.post-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.post-excerpt {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 12px;
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange-bright);
  background: rgba(217,79,0,0.1);
  padding: 3px 9px;
  border-radius: 5px;
}

/* ─── Table of contents ───────────────────────────────── */
.post-toc-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.post-toc ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.post-toc ol ol {
  margin: 7px 0 0 2px;
  padding-left: 14px;
  border-left: 1px solid var(--card-border);
}
.post-toc li {
  line-height: 1.35;
  margin-top: 0;
}
.post-toc a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 9px;
  margin-left: -11px;
  transition: color 0.15s, border-color 0.15s;
}
.post-toc a:hover { color: var(--text); }
.post-toc a.active {
  color: var(--orange-bright);
  border-left-color: var(--orange-bright);
  font-weight: 500;
}

/* ─── Article ─────────────────────────────────────────── */
.post-hero {
  padding: 140px 40px 50px;
  border-bottom: 1px solid var(--card-border);
}
.post-hero .container { max-width: 980px; }
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 28px;
}
.post-back:hover { color: var(--orange-bright); }
.post-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.post-meta-sep { opacity: 0.5; }

.post-body-section { padding: 60px 40px 120px; }
.post-body-section .container { max-width: 980px; }
.post-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-areas: "content toc";
  gap: 56px;
  align-items: start;
}
.post-toc {
  grid-area: toc;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
}
.post-body {
  grid-area: content;
  min-width: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.post-body > * + * { margin-top: 22px; }
.post-body p { color: var(--text-muted); }
.post-body h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 48px;
  color: var(--text);
  scroll-margin-top: 80px;
}
.post-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 36px;
  color: var(--text);
  scroll-margin-top: 80px;
}
.post-body h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin-top: 28px;
  color: var(--text);
  scroll-margin-top: 80px;
}
.post-body ul, .post-body ol {
  color: var(--text-muted);
  padding-left: 22px;
  line-height: 1.7;
}
.post-body li + li { margin-top: 6px; }
.post-body a { color: var(--orange-bright); text-decoration: underline; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  color: var(--orange-warm);
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-body pre {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
}
.post-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}
.post-body blockquote {
  border-left: 2px solid var(--orange-bright);
  padding-left: 18px;
  color: var(--text-muted);
  font-style: italic;
}
.post-body img {
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.07);
}
.post-footer {
  max-width: 720px;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--card-border);
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 980px) {
  .post-hero .container,
  .post-body-section .container { max-width: 720px; }
  .post-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "toc"
      "content";
    gap: 0;
  }
  .post-toc {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 22px;
  }
}
@media (max-width: 820px) {
  .blog-page-hero, .post-hero { padding: 110px 20px 40px; }
  .blog-section { padding: 40px 20px 60px; }
  .post-body-section { padding: 40px 20px 80px; }
  .post-card { grid-template-columns: 1fr; gap: 8px; }
  .post-date { padding-top: 0; }
}
