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

:root {
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #fff;
  --bg-code: #f5f5f5;
  --border: #e5e5e5;
  --max-width: 680px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.blog-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.blog-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.blog-header .brand {
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
}

/* Blog post */
.blog-post {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.blog-post h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
}

.post-meta .updated {
  font-style: italic;
}

.blog-post h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.blog-post h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.blog-post p {
  margin-bottom: 1rem;
}

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

.blog-post li {
  margin-bottom: 0.35rem;
}

.blog-post blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  background: var(--bg-code);
}

.blog-post code {
  font-family: "SF Mono", "Fira Code", monospace;
  background: var(--bg-code);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

.blog-post pre {
  background: var(--bg-code);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.blog-post pre code {
  background: none;
  padding: 0;
}

.blog-post img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.blog-post table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

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

.blog-post th {
  background: var(--bg-code);
  font-weight: 600;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  text-decoration: none;
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Related posts */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.related-posts ul {
  list-style: none;
  padding: 0;
}

.related-posts li {
  margin-bottom: 0.5rem;
}

/* Blog index */
.blog-index {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.blog-index h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.blog-intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-list a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.post-list a:hover {
  color: var(--accent);
}

.post-list .post-date {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.post-list .post-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Footer */
.blog-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
