/* ── Blog header (blog.html / post.html) ────────────────────────────────────── */
.blog-header {
  padding: 8px 0 0;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 0;
}

.blog-header h1 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #111;
  margin: 0 0 4px;
}

.blog-header .subtitle {
  font-size: 0.8em;
  color: #999;
  margin: 0 0 20px;
}

.blog-header .back-link {
  font-size: 0.8em;
  color: #8C1515;
  display: inline-block;
  margin-bottom: 16px;
}

/* ── Category tab navigation ────────────────────────────────────────────────── */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 18px;
  border-bottom: none;
  margin-bottom: 0;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  border: 1px solid #d8d8d8;
  border-radius: 20px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.1px;
  line-height: 1.5;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  white-space: nowrap;
}

.category-tab:hover {
  background: #f4f4f4;
  border-color: #bbb;
  color: #222;
}

.category-tab.active {
  background: #8C1515;
  border-color: #8C1515;
  color: #fff;
  font-weight: 600;
}

/* ── Post list ──────────────────────────────────────────────────────────────── */
.posts-list { list-style: none; padding: 0; margin: 0; }

.post-item {
  border-bottom: 1px solid #e5e5e5;
  padding: 20px 0;
}

.post-item:last-child { border-bottom: none; }

.post-meta-line {
  font-size: 11px;
  color: #999;
  margin-bottom: 5px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.2px;
}

.post-item h3 {
  margin: 0 0 6px;
  font-size: 1.05em;
  font-family: 'Georgia', serif;
  font-weight: 700;
  line-height: 1.35;
}

.post-item h3 a { color: #111; text-decoration: none; }
.post-item h3 a:hover { color: #8C1515; }

.post-description {
  font-size: 0.85em;
  color: #555;
  margin: 0 0 8px;
  line-height: 1.65;
  font-family: 'Inter', sans-serif;
}

/* ── Tag chips ──────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  border: 1px solid #8C1515;
  color: #8C1515;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── Post page ──────────────────────────────────────────────────────────────── */
.post-header {
  padding: 0 0 28px;
  border-bottom: 1px solid #e5e5e5;
}

.post-header .post-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post-header h1 {
  font-family: 'Georgia', serif;
  font-size: 1.65em;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.post-header .post-dateline {
  font-size: 11px;
  color: #999;
  font-family: 'Inter', sans-serif;
}

.post-header .back-link {
  font-size: 0.8em;
  color: #8C1515;
  display: inline-block;
  margin-bottom: 16px;
}

/* ── Post content (article body) ────────────────────────────────────────────── */
#post-content {
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.85;
  color: #222;
  padding: 32px 0 40px;
}

#post-content h1,
#post-content h2,
#post-content h3,
#post-content h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}

#post-content h1 { font-size: 1.5em; margin: 2em 0 0.6em; }
#post-content h2 { font-size: 1.2em; margin: 1.8em 0 0.5em; letter-spacing: -0.1px; }
#post-content h3 { font-size: 1.05em; margin: 1.5em 0 0.4em; }
#post-content h4 { font-size: 0.95em; margin: 1.2em 0 0.3em; color: #444; }

#post-content p { margin: 0 0 1.1em; }

#post-content a { color: #8C1515; border-bottom: 1px solid transparent; transition: border-color 0.15s; }
#post-content a:hover { border-bottom-color: #8C1515; text-decoration: none; }

#post-content code {
  background: #f5f5f5;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
  font-size: 0.875em;
  color: #d73a49;
}

#post-content pre {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 1.5em 0;
}

#post-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875em;
  line-height: 1.6;
}

#post-content blockquote {
  border-left: 3px solid #8C1515;
  margin: 1.5em 0;
  padding: 0.6em 1em;
  color: #555;
  font-style: italic;
  background: #fafafa;
  border-radius: 0 3px 3px 0;
}

#post-content ul, #post-content ol { margin: 0.8em 0; padding-left: 1.8em; }
#post-content li { margin-bottom: 0.4em; }

#post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.9em;
  font-family: 'Inter', sans-serif;
}

#post-content th, #post-content td {
  border: 1px solid #e1e4e8;
  padding: 7px 12px;
  text-align: left;
}

#post-content th { background: #f6f8fa; font-weight: 600; color: #333; }
#post-content tr:nth-child(even) { background: #fafafa; }

#post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#post-content hr { border: none; border-top: 1px solid #e5e5e5; margin: 2em 0; }

/* ── KaTeX math ─────────────────────────────────────────────────────────────── */
#post-content .katex-display {
  margin: 1.4em 0;
  padding: 0.4em 0;
  overflow-x: auto;
  overflow-y: hidden;
  font-size: 1.05em;
}

#post-content .katex {
  font-size: 1.05em;
}

#post-content .katex-display > .katex {
  display: block;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 600px) {
  #post-content .katex-display { font-size: 0.92em; }
  #post-content .katex-display > .katex { white-space: normal; }
}

/* ── Loading / error states ─────────────────────────────────────────────────── */
.loading, .error, .no-posts {
  text-align: center;
  color: #999;
  padding: 2em;
  font-style: italic;
  font-family: 'Inter', sans-serif;
  font-size: 0.875em;
}

.error { color: #d73a49; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .post-header { padding: 0 0 20px; }
  .post-header h1 { font-size: 1.35em; }
  #post-content { font-size: 15px; padding: 24px 0 32px; }
  #post-content h1 { font-size: 1.3em; }
  #post-content h2 { font-size: 1.1em; }
  #post-content pre { padding: 10px 12px; font-size: 0.85em; }
  #post-content table { font-size: 0.82em; }
  #post-content th, #post-content td { padding: 5px 8px; }
}
