/* Simple, classless CSS with dark mode support */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-light: #666666;
  --link: #0066cc;
  --link-hover: #0052a3;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
  --header-bg: #fafafa;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --text: #e0e0e0;
  --text-light: #999999;
  --link: #66b3ff;
  --link-hover: #99ccff;
  --border: #333333;
  --code-bg: #2a2a2a;
  --header-bg: #0d0d0d;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  background-color: var(--header-bg);
  padding: 1.5rem;
  margin: -2rem -1rem 2rem -1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}

header nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

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

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

code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

pre code {
  background-color: transparent;
  padding: 0;
}

blockquote {
  border-left: 4px solid var(--border);
  margin: 1.5rem 0;
  padding-left: 1rem;
  color: var(--text-light);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

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

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

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

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

.post-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.post-title {
  margin: 0.5rem 0;
  font-size: 1.8rem;
}

.post-excerpt {
  color: var(--text);
  margin-top: 0.5rem;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background-color: var(--code-bg);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text);
  border: 1px solid var(--border);
}

.tag:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* Dark mode toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--code-bg);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.5rem;
  }

  header {
    margin: -1rem -0.5rem 1.5rem -0.5rem;
    padding: 1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }

  .post-title {
    font-size: 1.5rem;
  }
}
