/* ===== Base Reset & Typography ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3 {
  font-family: 'Merriweather', serif;
  margin: 1.5rem 0 1rem;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; color: var(--accent); }
h3 { font-size: 1.3rem; }

/* ===== Links ===== */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.site-title a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.site-title a:hover { color: var(--accent); }

/* ===== Theme Toggle ===== */
#theme-toggle {
  background: var(--nav-bg);
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: background 0.2s;
}
#theme-toggle:hover { background: var(--nav-bg-hover); }

/* ===== Featured Post ===== */
.featured {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.featured h2 {
  margin-top: 0;
  font-size: 1.6rem;
}
.featured .date {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.featured .excerpt {
  margin: 1rem 0;
}
.read-more {
  font-weight: 600;
}

/* ===== Previous Posts ===== */
.previous h3 {
  margin-bottom: 1rem;
}
.previous ul {
  list-style: none;
  padding: 0;
}
.previous li {
  background: var(--card-bg);
  margin: 0.5rem 0;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.previous li:hover { background: var(--card-hover); }

/* ===== Individual Post ===== */
.post h2 {
  font-size: 1.8rem;
  margin-top: 0;
}
.post .date {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.post .tags {
  margin-top: 1.5rem;
}
.post .tags a {
  background: var(--nav-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  font-size: 0.85rem;
}
.post .tags a:hover { background: var(--nav-bg-hover); }

/* ===== Post Navigation ===== */
.post-nav {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.post-nav a {
  background: var(--nav-bg);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  color: var(--text);
}
.post-nav a:hover { background: var(--nav-bg-hover); }

/* ===== Theme Variables ===== */
:root {
  --bg: #f9fafb;
  --text: #222;
  --muted: #666;
  --accent: #0066cc;
  --accent-hover: #004999;
  --card-bg: #fff;
  --card-hover: #f0f4f8;
  --nav-bg: #eee;
  --nav-bg-hover: #ddd;
}

[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #e0e0e0;
  --muted: #aaa;
  --accent: #4ea3ff;
  --accent-hover: #82c7ff;
  --card-bg: #2a2a2a;
  --card-hover: #333;
  --nav-bg: #333;
  --nav-bg-hover: #444;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.site-nav a:hover {
  background: var(--nav-bg-hover);
}