:root {
  /* Light mode variables */
  --bg-color: #ffffff;
  --text-color: #333333;
  --secondary-text: #666666;
  --border-color: #e5e5e5;
  --accent-color: #0066cc;
  --hover-color: #f5f5f5;
  --card-bg: #ffffff;
  --sidebar-bg: #f9f9f9;
}

/* Dark mode variables */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --secondary-text: #b0b0b0;
  --border-color: #333333;
  --accent-color: #4da6ff;
  --hover-color: #2a2a2a;
  --card-bg: #252525;
  --sidebar-bg: #2a2a2a;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Main content */
.main {
  flex: 1;
  padding: 2rem 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

/* Navigation */
.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-color);
}

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

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

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive design */
@media (max-width: 768px) {
  /* Navigation */
  .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Container */
  .container {
    padding: 0 1rem;
  }

  /* Posts */
  .posts {
    max-width: 100%;
  }

  .post-card {
    padding: 1rem;
  }

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

  /* Post content */
  .post {
    max-width: 100%;
    padding: 1.5rem;
  }

  .post-content h2 {
    font-size: 1.2rem;
  }

  .post-content h3 {
    font-size: 1rem;
  }

  /* Footer */
  .footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Post navigation */
  .post-footer {
    flex-direction: column;
    gap: 1rem;
  }

  .post-nav {
    text-align: center !important;
  }
}

/* Main content */
.main {
  padding: 2rem 0;
}

/* Posts */
.posts {
  max-width: 800px;
  margin: 0 auto;
}

.post-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

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

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

.post-title a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.post-date {
  margin-right: 1rem;
}

.post-categories {
  display: inline;
}

.post-categories a {
  color: var(--secondary-text);
  text-decoration: none;
  margin-right: 0.5rem;
  transition: color 0.3s ease;
}

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

.post-summary {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-read-more {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.post-read-more:hover {
  text-decoration: underline;
}

/* Post content */
.post {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
}

.post-content {
  line-height: 1.8;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

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

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

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

/* Code blocks */
.post-content pre {
  background-color: var(--hover-color);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
}

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

.post-content code {
  background-color: var(--hover-color);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

/* Post navigation */
.post-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.post-nav {
  flex: 1;
}

.post-nav.prev {
  text-align: left;
}

.post-nav.next {
  text-align: right;
}

.post-nav-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Tags */
.post-tags {
  display: inline;
}

.post-tags a {
  color: var(--secondary-text);
  text-decoration: none;
  margin-right: 0.5rem;
  transition: color 0.3s ease;
}

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

/* Sidebar */
.sidebar {
  width: 300px;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

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

.sidebar-list li {
  margin-bottom: 0.5rem;
}

.sidebar-list a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-tag {
  background-color: var(--hover-color);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-tag:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Layout with sidebar */
.layout-with-sidebar {
  display: flex;
  gap: 2rem;
}

.layout-with-sidebar .main-content {
  flex: 1;
}

/* Responsive sidebar */
@media (max-width: 1024px) {
  .layout-with-sidebar {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: static;
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 2rem;
  background-color: var(--card-bg);
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: var(--accent-color);
}

.copyright {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}