/* ============================================================
   HackNao English — Blog styles
   Builds on the design tokens in styles.css (--bg, --accent, etc.).
   Used by the Astro-generated pages under /blog/.
   ============================================================ */

.blog-main { min-height: 60vh; }

/* ---------- Header tweaks for the blog ---------- */
.blog-nav .lang-switch {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 550;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.blog-nav .lang-switch:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Listing hero ---------- */
.blog-hero { padding: 64px 0 24px; }
.blog-hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  margin: 10px 0 12px;
}
.blog-hero-sub {
  color: var(--muted);
  font-size: 18px;
  max-width: 640px;
}

/* ---------- Post grid ---------- */
.blog-list-wrap { padding: 24px 0 72px; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.post-card-link { display: block; height: 100%; }
.post-card-body { padding: 24px; }
.post-card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.post-card-title {
  font-size: 21px;
  line-height: 1.25;
  margin-bottom: 10px;
}
.post-card-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  display: flex;
  gap: 8px;
}

/* ---------- Post detail ---------- */
.post-container { max-width: 820px; padding-top: 48px; padding-bottom: 24px; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.breadcrumb a:hover { color: var(--accent); }

.post-header { margin-bottom: 32px; }
.post-header h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  margin: 14px 0 16px;
}
.post-lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}
.post-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* TOC + body layout */
.post-body-wrap { display: block; }
.post-toc {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 32px;
}
.post-toc-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.post-toc ul { list-style: none; margin: 0; padding: 0; }
.post-toc li { margin: 6px 0; font-size: 14.5px; }
.post-toc li.toc-3 { padding-left: 16px; font-size: 13.5px; }
.post-toc a { color: var(--text); }
.post-toc a:hover { color: var(--accent); }

@media (min-width: 1080px) {
  .post-body-wrap {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 48px;
    align-items: start;
  }
  .post-body-wrap .prose { grid-column: 1; grid-row: 1; }
  .post-toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 90px;
    margin: 0;
  }
}

/* ---------- Prose (rendered markdown) ---------- */
.prose { font-size: 17.5px; line-height: 1.75; color: var(--text); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 {
  font-size: 27px;
  margin-top: 1.8em;
  scroll-margin-top: 90px;
}
.prose h3 {
  font-size: 21px;
  margin-top: 1.5em;
  scroll-margin-top: 90px;
}
.prose p { margin-top: 1.1em; }
.prose a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin-top: 1.1em; }
.prose li { margin: .5em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 650; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 1.4em 0;
  color: var(--muted);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.prose pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }

.post-back { margin-top: 40px; font-family: var(--font-mono); font-size: 14px; }
.post-back a { color: var(--accent-strong); }
.post-back a:hover { color: var(--accent); }

/* ---------- Related ---------- */
.related { padding: 24px 0 80px; }
.related-title { font-size: 24px; margin-bottom: 24px; }

@media (max-width: 600px) {
  .blog-hero { padding: 40px 0 16px; }
  .post-container { padding-top: 32px; }
  .prose { font-size: 16.5px; }
}
