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

:root {
  --text-color: #1a1a1a;
  --link-color: #0066cc;
  --border-color: #ddd;
  --background: #fff;
  --code-bg: #f5f5f5;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --link-color: #6cb6ff;
    --border-color: #444;
    --background: #1a1a1a;
    --code-bg: #2d2d2d;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background: var(--background);
  padding: 0 1rem;
}

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

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

.site-title:hover {
  color: var(--link-color);
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 0;
  min-height: calc(100vh - 150px);
}

/* Post list */
.date-header {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.date-header:first-of-type {
  margin-top: 0;
}

.post-item {
  margin-bottom: 0.5rem;
  padding-left: 0;
}

.post-item a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 500;
}

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

.post-excerpt {
  margin-top: 0.25rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Untitled posts (shown inline on home) */
.post-item--untitled {
  margin-bottom: 1rem;
}

.post-content-inline {
  font-size: 1.05rem;
}

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

.post-content-inline p:last-child {
  margin-bottom: 0;
}

.post-content-inline a {
  color: var(--link-color);
  text-decoration: none;
}

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

/* Individual post */
.post-header {
  margin-bottom: 1.25rem;
}

.post-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.post-header time {
  font-size: 1rem;
}

.post-content {
  font-size: 1.05rem;
}

.post-content h2 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.post-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
}

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

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

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

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

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

.post-content code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

.post-content pre {
  background: var(--code-bg);
  padding: 0.75rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

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

.post-content blockquote {
  border-left: 3px solid var(--border-color);
  padding-left: 0.75rem;
  margin: 0.75rem 0;
  color: #555;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 0.75rem 0;
}

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

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

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

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

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

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

/* Responsive */
@media (max-width: 768px) {
  .post-header h1 {
    font-size: 1.5rem;
  }
  
  .post-content {
    font-size: 1rem;
  }
}
