/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto;
  padding: 40px 20px;
  color: #333;
  background: #fff;
  font-size: 16px;
}

/* Typography */
h1 {
  font-size: 1.8em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

h2 {
  margin-top: 2em;
  margin-bottom: 1em;
  font-size: 1.3em;
  font-weight: 600;
}

h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-size: 1.1em;
  font-weight: 600;
}

p {
  margin-bottom: 1.2em;
}

/* Links */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Post-specific styles */
.post-meta {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 2em;
  border-bottom: 1px solid #eee;
  padding-bottom: 1em;
}

.post-date {
  color: #888;
  font-size: 0.8em;
  font-weight: normal;
}

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

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

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

.post-content p {
  margin-bottom: 1.2em;
}

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

.post-content li {
  margin-bottom: 0.3em;
}

/* Code styles */
code {
  background: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9em;
}

pre {
  background: #f5f5f5;
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1.2em;
}

pre code {
  background: none;
  padding: 0;
}

/* Notes index styles */
.notes-post {
  margin-bottom: 3em;
}

.notes-post h2 {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.notes-post h2 a {
  color: #333;
  text-decoration: none;
}

.notes-post h2 a:hover {
  color: #0066cc;
}

.post-separator {
  border: none;
  border-top: 1px solid #eee;
  margin: 3em 0;
}

/* Pagination */
.pagination {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid #eee;
}

.pagination-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-link {
  color: #666;
  text-decoration: none;
  font-size: 0.9em;
  padding: 0.5em 1em;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pagination-link:hover {
  color: #0066cc;
  border-color: #0066cc;
  text-decoration: none;
}

.pagination-newer {
  margin-right: auto;
}

.pagination-older {
  margin-left: auto;
}

/* Navigation */
.back-link {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid #eee;
}

.back-link a {
  color: #666;
  text-decoration: none;
  font-size: 0.9em;
}

.back-link a:hover {
  color: #0066cc;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 20px 15px;
    font-size: 15px;
  }
  
  h1 {
    font-size: 1.6em;
  }
  
  h2 {
    font-size: 1.2em;
  }
  
  h3 {
    font-size: 1.05em;
  }
  
  .post-meta {
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px 10px;
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.5em;
    margin-bottom: 0.7em;
  }
  
  .post-meta {
    margin-bottom: 1.5em;
    padding-bottom: 0.8em;
  }
  
  .back-link {
    margin-bottom: 1.5em;
    padding-bottom: 1em;
  }
  
  pre {
    padding: 0.8em;
    font-size: 0.85em;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  .post-meta {
    color: #999;
    border-bottom-color: #333;
  }
  
  .post-date {
    color: #aaa;
  }
  
  a {
    color: #4a9eff;
  }
  
  .back-link {
    border-bottom-color: #333;
  }
  
  .back-link a {
    color: #999;
  }
  
  .back-link a:hover {
    color: #4a9eff;
  }
  
  .notes-post h2 a {
    color: #e0e0e0;
  }
  
  .notes-post h2 a:hover {
    color: #4a9eff;
  }
  
  .post-separator {
    border-top-color: #333;
  }
  
  .pagination {
    border-top-color: #333;
  }
  
  .pagination-link {
    color: #999;
    border-color: #444;
  }
  
  .pagination-link:hover {
    color: #4a9eff;
    border-color: #4a9eff;
  }
  
  code {
    background: #2a2a2a;
    color: #e0e0e0;
  }
  
  pre {
    background: #2a2a2a;
  }
}