:root {
  --bg: #fafafa;
  --text: #222;
  --text-muted: #666;
  --accent: #c62828;
  --border: #ddd;
  --max-width: 1200px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  background: white;
}

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

header .logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

header a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

header a:hover {
  color: var(--accent);
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Home page */
.home h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.home .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-card a {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.post-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-card time {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.view-all {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.view-all:hover {
  text-decoration: underline;
}

/* Single post */
.post {
  max-width: 800px;
}

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

.post-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.post-header time {
  color: var(--text-muted);
}

.post-content {
  font-size: 1.1rem;
}

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

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
}

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

/* Blog archive */
.blog-archive h1 {
  margin-bottom: 2rem;
}

/* Page */
.page h1 {
  margin-bottom: 2rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: white;
}

/* Responsive */
@media (max-width: 768px) {
  .home h1 {
    font-size: 2rem;
  }
  
  .post-header h1 {
    font-size: 1.75rem;
  }
  
  main {
    padding: 1rem;
  }
}
