/* ---- Blog styles: base (shared with site) + blog-specific ---- */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #323232;
  --text-muted: #6c757d;
  --heading: #2b2b2b;
  --link: #2962ff;
  --link-hover: #0039cb;
  --border: #eaeaea;
  --nav-bg: rgba(255,255,255,0.95);
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}
html[data-theme="dark"] {
  --bg: #1b1e21;
  --surface: #23272b;
  --text: #cfd2d6;
  --text-muted: #9aa0a6;
  --heading: #f1f3f4;
  --link: #6ea8ff;
  --link-hover: #a9c9ff;
  --border: #33383d;
  --nav-bg: rgba(27,30,33,0.95);
  --shadow: 0 1px 4px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--link-hover); }
h1, h2, h3 { font-family: 'Montserrat', sans-serif; color: var(--heading); line-height: 1.2; }

/* ---- Nav ---- */
nav.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--heading); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 0.95rem; color: var(--heading); }
.nav-links a:hover { color: var(--link); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 1.1rem; color: var(--heading);
  width: 40px; height: 40px; line-height: 1; display: flex;
  align-items: center; justify-content: center; transition: background .15s ease;
}
.theme-toggle:hover { background: var(--border); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; width: 40px; height: 40px; cursor: pointer; color: var(--heading);
  align-items: center; justify-content: center; }

footer { text-align: center; padding: 34px 20px; color: var(--text-muted); font-size: 0.88rem; }

/* ---- Blog index ---- */
.blog-wrap { max-width: 760px; margin: 0 auto; padding: 56px 20px 40px; }
.blog-wrap .page-title { font-size: 2.4rem; font-weight: 600; margin: 0 0 8px; }
.blog-wrap .page-sub { color: var(--text-muted); margin: 0 0 24px; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-card { padding: 26px 0; border-bottom: 1px solid var(--border); }
.post-card:last-child { border-bottom: none; }
.post-card h2 { font-size: 1.5rem; font-weight: 600; margin: 0 0 6px; }
.post-card h2 a { color: var(--heading); }
.post-card h2 a:hover { color: var(--link); }
.post-card .date { color: var(--text-muted); font-size: 0.9rem; }
.post-card .teaser { margin: 10px 0 0; }

/* ---- Post pages ---- */
article.post { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.post .post-title { font-size: 2.3rem; font-weight: 600; margin: 0 0 10px; }
.post .post-meta { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 6px; }
.post .back { display: inline-block; margin-bottom: 26px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; font-size: 0.9rem; }
.post .lead { font-size: 1.18rem; color: var(--heading); }
.post p { margin: 0 0 20px; }
.post h2 { font-size: 1.6rem; font-weight: 600; margin: 42px 0 14px; }
.post h3 { font-size: 1.25rem; font-weight: 600; margin: 30px 0 10px; }
.post ul { margin: 0 0 20px; padding-left: 22px; }
.post li { margin-bottom: 8px; }
.post figure { margin: 32px 0; }
.post figure img { width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.post figcaption { color: var(--text-muted); font-size: 0.86rem; margin-top: 10px; text-align: center; }
.post .note { border-left: 3px solid var(--link); background: var(--surface);
  padding: 12px 18px; margin: 24px 0; color: var(--text); border-radius: 0 8px 8px 0;
  box-shadow: var(--shadow); }
.post blockquote { border-left: 3px solid var(--border); margin: 24px 0; padding: 4px 18px;
  color: var(--text-muted); font-style: italic; }
.post code { background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; font-size: 0.9em; }
.post pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5;
  box-shadow: var(--shadow); margin: 0 0 20px; }
.post pre code { background: none; border: none; padding: 0; font-size: inherit; }
.embed-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); padding: 10px; background: var(--surface);
  margin: 8px 0 24px; }
.embed-card iframe { display: block; border-radius: 8px; }
.cta { display: inline-block; background: var(--link); color: #fff; font-family: 'Montserrat', sans-serif;
  font-weight: 600; padding: 12px 24px; border-radius: 10px; margin-top: 8px; }
.cta:hover { background: var(--link-hover); color: #fff; }
.post .disclaimer { color: var(--text-muted); font-size: 0.85rem; margin-top: 40px;
  padding-top: 18px; border-top: 1px solid var(--border); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .blog-wrap .page-title, .post .post-title { font-size: 1.9rem; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--nav-bg); border-bottom: 1px solid var(--border); padding: 8px 20px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .nav-toggle { display: flex; }
}
