/* base.css — shared across all pages */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F8F6F2;
  --surface:   #FFFFFF;
  --text:      #1C1C1C;
  --muted:     #7A7166;
  --border:    #E2DDD6;
  --accent:    #8B7355;
  --radius:    8px;
  --font-body: 'Georgia', 'Noto Serif SC', serif;
  --font-ui:   system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }

/* ── Post page shell ─────────────────────────────────────────────── */

.page-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.post-header .post-meta-line {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
}

.post-header .post-meta-line .tag {
  background: var(--border);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.78rem;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
}

.post-content p + p { margin-top: 1.2em; }
.post-content h2 { font-size: 1.35rem; margin: 2em 0 0.6em; }
.post-content h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin: 0.8em 0; }
.post-content li + li { margin-top: 0.3em; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.2em 0;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-content pre {
  background: #1E1E2E;
  color: #CDD6F4;
  font-family: var(--font-mono);
  font-size: 0.88em;
  line-height: 1.6;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.4em 0;
}
.post-content pre code { background: none; padding: 0; }
.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.2em 0;
}
.post-content table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.5em 0.9em; }
.post-content th { background: var(--border); font-family: var(--font-ui); font-size: 0.88rem; }

/* ── KaTeX display override ──────────────────────────────────────── */
.katex-display { overflow-x: auto; padding: 0.5em 0; }

/* ── Back link ───────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); opacity: 1; }

/* ── View counter ────────────────────────────────────────────────── */
.view-badge {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}
