/* Medium-style Clean Blog Theme */

:root {
  --primary-color: #1a1a1a;
  --secondary-color: #6b6b6b;
  --accent-color: #0066cc;
  --border-color: #e6e6e6;
  --background-color: #ffffff;
  --code-background: #f6f8fa;
  --max-width: 960px;
  --header-max-width: 1200px;
}

/* Dark mode variables */
[data-theme="dark"] {
  --primary-color: #e6e6e6;
  --secondary-color: #a8a8a8;
  --accent-color: #4d9fff;
  --border-color: #333333;
  --background-color: #1a1a1a;
  --code-background: #2d2d2d;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--primary-color);
  background-color: var(--background-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
  margin-bottom: 60px;
}

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

.site-title {
  font-size: 24px;
  font-weight: 600;
}

.site-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.site-nav a {
  color: var(--secondary-color);
  text-decoration: none;
  margin-left: 30px;
  font-size: 16px;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--primary-color);
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 200px);
}

/* Blog List */
.blog-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.blog-header {
  text-align: center;
  margin-bottom: 80px;
}

.blog-header h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: 'Merriweather', serif;
}

.blog-header p {
  font-size: 20px;
  color: var(--secondary-color);
}

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

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

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

.post-item h2 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
  font-family: 'Merriweather', serif;
}

.post-item h2 a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-excerpt {
  font-size: 18px;
  color: var(--secondary-color);
  margin-bottom: 16px;
  line-height: 1.6;
}

.post-item-meta {
  font-size: 14px;
  color: var(--secondary-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

.read-more {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
}

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

/* Individual Post */
.post-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.post-header {
  margin-bottom: 48px;
  text-align: center;
}

.post-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  font-family: 'Merriweather', serif;
}

.post-meta {
  font-size: 14px;
  color: var(--secondary-color);
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
}

.post-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.tag {
  background-color: var(--code-background);
  color: var(--secondary-color);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.post-content {
  font-family: 'Merriweather', serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--primary-color);
  margin-bottom: 60px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.post-content h1 { font-size: 32px; }
.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }

.post-content p {
  margin-bottom: 24px;
}

.post-content a {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}

.post-content a:hover {
  text-decoration-color: var(--accent-color);
}

.post-content ul,
.post-content ol {
  margin-bottom: 24px;
  padding-left: 32px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content code {
  background-color: var(--code-background);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 16px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.post-content pre {
  background-color: var(--code-background);
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
}

.post-content blockquote {
  border-left: 3px solid var(--border-color);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--secondary-color);
}

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

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 16px;
}

.post-content th,
.post-content td {
  padding: 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.post-content th {
  background-color: var(--code-background);
  font-weight: 600;
}

.post-footer {
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.back-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
}

.site-footer p {
  color: var(--secondary-color);
  font-size: 14px;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--primary-color);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 20px;
}

.theme-toggle:hover {
  background-color: var(--code-background);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-icon {
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .site-header .container {
    flex-direction: column;
    gap: 16px;
  }

  .site-nav a {
    margin-left: 16px;
  }

  .site-nav a:first-child {
    margin-left: 0;
  }

  .blog-header h1 {
    font-size: 36px;
  }

  .post-item h2 {
    font-size: 24px;
  }

  .post-title {
    font-size: 32px;
  }

  .post-content {
    font-size: 16px;
  }

  .post-content h1 { font-size: 24px; }
  .post-content h2 { font-size: 20px; }
  .post-content h3 { font-size: 18px; }

  .theme-toggle {
    margin-left: 12px;
    padding: 6px 12px;
    font-size: 12px;
  }
}
