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

:root {
  --max-width: 800px;
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --text-color: #333;
  --bg-color: #fff;
  --border-color: #e1e4e8;
  --code-bg: #f6f8fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 1rem;
}

/* Header */
header {
  max-width: var(--max-width);
  margin: 0 auto 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  color: var(--secondary-color);
}

.tagline {
  font-size: 1.1rem;
  color: #666;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
}

h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin: 1.5rem 0 0.8rem;
}

/* Post list */
#post-list {
  margin-top: 1.5rem;
}

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

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

.post-item h3 {
  margin: 0 0 0.5rem;
}

.post-item h3 a {
  color: var(--primary-color);
  text-decoration: none;
}

.post-item h3 a:hover {
  color: var(--secondary-color);
}

.post-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

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

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 0.85rem;
  color: #666;
}

/* Post content */
article {
  line-height: 1.8;
}

article h1 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

article p {
  margin-bottom: 1rem;
}

article ul, article ol {
  margin: 1rem 0 1rem 2rem;
}

article li {
  margin-bottom: 0.5rem;
}

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

article a:hover {
  text-decoration: underline;
}

/* Code blocks */
article pre {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow-x: auto;
}

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

article p code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Math */
.MathJax {
  font-size: 1.1em;
}

/* Bibliography and Citations */
#bibliography {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

#bibliography h2 {
  margin-bottom: 1.5rem;
}

#bibliography .csl-entry {
  margin-bottom: 1rem;
  padding-left: 2rem;
  text-indent: -2rem;
  line-height: 1.6;
}

cite {
  font-style: normal;
}

cite .citation-link {
  color: var(--secondary-color);
  text-decoration: none;
}

cite .citation-link:hover {
  text-decoration: underline;
}

#bibliography .csl-entry {
  margin-bottom: 1rem;
  padding-left: 2rem;
  text-indent: -2rem;
  line-height: 1.6;
  scroll-margin-top: 2rem;
}

#bibliography .csl-entry:target {
  background-color: #fff3cd;
}

/* Post navigation */
.post-nav {
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-nav a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
}

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

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

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  article h1 {
    font-size: 1.8rem;
  }
}

