/* ─── Blog Theme: unified with homepage ─── */
:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-light: #777;
  --accent: #1a56db;
  --border: #e0e0e0;
  --bg: #ffffff;
  --max-width: 820px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Blog List Page ─── */
.blog-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

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

.blog-header-inner h1 {
  font-family: 'EB Garamond', serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0.4rem 0 0.3rem;
  letter-spacing: -0.01em;
}

.blog-subtitle {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.93rem;
}

.back-home, .back-blog {
  font-size: 0.88rem;
  color: var(--text-light);
  text-decoration: none;
}

.back-home:hover, .back-blog:hover {
  color: var(--accent);
  text-decoration: none;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-card {
  border-bottom: 1px solid #f0f0f0;
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card a {
  display: block;
  padding: 1.2rem 0;
  text-decoration: none;
  color: inherit;
}

.blog-card a:hover {
  text-decoration: none;
}

.blog-card a:hover h2 {
  color: var(--accent);
}

.blog-card time {
  font-size: 0.83rem;
  color: var(--text-light);
  font-weight: 500;
}

.blog-card h2 {
  margin: 0.2rem 0 0.4rem;
  font-family: 'EB Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
}

.blog-card .excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-card .tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  background: #f0f4ff;
  color: var(--accent);
  font-weight: 500;
}

.blog-footer, .post-footer .copyright {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Single Post Page ─── */
.post-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

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

.post-header-inner h1 {
  font-family: 'EB Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  margin: 0.4rem 0 0.6rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.meta-sep { color: var(--border); }

.reading-time { font-style: italic; }

/* ─── Post Content Typography ─── */
.post-content article {
  padding: 0;
}

.post-content h2 {
  font-family: 'EB Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #f0f0f0;
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

.post-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}

.post-content p {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.93rem;
  line-height: 1.75;
}

.post-content ul, .post-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.post-content li {
  margin-bottom: 0.3rem;
  font-size: 0.93rem;
  line-height: 1.7;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2rem 0;
  padding: 0.6rem 1.2rem;
  background: #f8faff;
  border-radius: 0 4px 4px 0;
}

.post-content blockquote p {
  margin: 0;
  color: var(--text-secondary);
}

/* Code blocks */
.post-content code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, monospace;
  font-size: 0.85rem;
  background: #f5f5f5;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.2rem 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.88rem;
}

.post-content th, .post-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: #fafafa;
  font-weight: 600;
}

.post-content tr:nth-child(even) {
  background: #fafafa;
}

/* Images */
.post-content img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1.2rem 0;
}

/* HR */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Strong/Bold */
.post-content strong {
  font-weight: 600;
}

/* Post footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .post-header-inner h1 {
    font-size: 1.5rem;
  }

  .blog-header-inner h1 {
    font-size: 1.8rem;
  }

  .blog-card h2 {
    font-size: 1.15rem;
  }
}
