/* Bear Red Graphite Theme */

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

:root {
  --bg: #FAF8F5;
  --text: #2C2C2C;
  --accent: #D7494C;
  --muted: #8E8E93;
  --border: #E8E4DF;
  --code-bg: #F2EFEB;
  --font: "Avenir Next", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Fira Code", monospace;
  --max-width: 680px;
  --radius: 8px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  min-height: 60vh;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* Header */

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title:hover {
  color: var(--accent);
}

/* Post list */

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

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

.post-list li:first-child {
  padding-top: 0.5rem;
}

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

.post-list a {
  text-decoration: none;
  display: block;
}

.post-list .post-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

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

.post-list .post-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.post-list .post-excerpt {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Single post */

.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-header .post-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-body .back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.post-body .back-link:hover {
  text-decoration: underline;
}

/* Markdown content */

.post-body h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.post-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.post-body p {
  margin-bottom: 1.25rem;
}

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

.post-body a:hover {
  text-decoration: underline;
}

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

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

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

.post-body blockquote p {
  margin-bottom: 0;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

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

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.post-body strong {
  font-weight: 600;
}

/* Responsive */

@media (max-width: 600px) {
  header {
    padding: 2rem 1rem 0.75rem;
  }

  main {
    padding: 1rem 1rem 3rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }

  .post-list .post-title {
    font-size: 1.1rem;
  }
}
