/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

/* Layout */
.site-header, main, .site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  padding-top: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

.site-title:hover {
  color: #0066cc;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 0.875rem;
}

/* Posts list */
.posts h1 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.post-summary {
  margin-bottom: 2rem;
}

.post-summary h2 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
}

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

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

.post-summary time {
  font-size: 0.875rem;
  color: #666;
}

.post-summary .description {
  margin: 0.5rem 0 0 0;
  color: #555;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.post-header time {
  color: #666;
  font-size: 0.875rem;
}

.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

.post-content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

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

.post-content a {
  color: #0066cc;
}

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

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

/* Code blocks - Chroma syntax highlighting */
.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

/* Chroma syntax highlighting */
.highlight {
  margin: 1rem 0;
}

.highlight pre {
  margin: 0;
}

/* Light theme - GitHub style */
.chroma { background-color: #f6f8fa; }
.chroma .lnt { color: #7f7f7f; }
.chroma .ln { color: #7f7f7f; }
.chroma .k { color: #cf222e; }
.chroma .kc { color: #cf222e; }
.chroma .kd { color: #cf222e; }
.chroma .kn { color: #cf222e; }
.chroma .kp { color: #cf222e; }
.chroma .kr { color: #cf222e; }
.chroma .kt { color: #cf222e; }
.chroma .na { color: #1f2328; }
.chroma .nc { color: #1f2328; }
.chroma .no { color: #0550ae; }
.chroma .nd { color: #0550ae; }
.chroma .ni { color: #6639ba; }
.chroma .nn { color: #24292e; }
.chroma .nx { color: #1f2328; }
.chroma .nt { color: #0550ae; }
.chroma .nb { color: #6639ba; }
.chroma .nv { color: #953800; }
.chroma .nf { color: #6639ba; }
.chroma .fm { color: #6639ba; }
.chroma .s { color: #0a3069; }
.chroma .sa { color: #0a3069; }
.chroma .sb { color: #0a3069; }
.chroma .sc { color: #0a3069; }
.chroma .dl { color: #0a3069; }
.chroma .sd { color: #0a3069; }
.chroma .s2 { color: #0a3069; }
.chroma .se { color: #0a3069; }
.chroma .sh { color: #0a3069; }
.chroma .si { color: #0a3069; }
.chroma .sx { color: #0a3069; }
.chroma .sr { color: #0a3069; }
.chroma .s1 { color: #0a3069; }
.chroma .ss { color: #032f62; }
.chroma .m { color: #0550ae; }
.chroma .mb { color: #0550ae; }
.chroma .mf { color: #0550ae; }
.chroma .mh { color: #0550ae; }
.chroma .mi { color: #0550ae; }
.chroma .il { color: #0550ae; }
.chroma .mo { color: #0550ae; }
.chroma .o { color: #0550ae; }
.chroma .ow { color: #0550ae; }
.chroma .p { color: #1f2328; }
.chroma .c { color: #57606a; }
.chroma .ch { color: #57606a; }
.chroma .cm { color: #57606a; }
.chroma .c1 { color: #57606a; }
.chroma .cs { color: #57606a; }
.chroma .cp { color: #57606a; }
.chroma .cpf { color: #57606a; }

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th {
  background: #f6f8fa;
  font-weight: 600;
}

.post-content tr:nth-child(even) {
  background: #fafafa;
}

/* Blockquotes */
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid #ddd;
  color: #555;
  font-style: italic;
}

.post-content blockquote p {
  margin: 0.5rem 0;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  body {
    color: #e0e0e0;
    background: #1a1a1a;
  }

  .site-header {
    border-bottom-color: #333;
  }

  .site-title {
    color: #e0e0e0;
  }

  .site-title:hover {
    color: #6cb6ff;
  }

  .site-footer {
    border-top-color: #333;
    color: #888;
  }

  .post-summary h2 a {
    color: #e0e0e0;
  }

  .post-summary h2 a:hover {
    color: #6cb6ff;
  }

  .post-summary time,
  .post-header time {
    color: #888;
  }

  .post-summary .description {
    color: #aaa;
  }

  .post-content a {
    color: #6cb6ff;
  }

  .post-content code {
    background: #2d2d2d;
  }

  .post-content th {
    background: #2d2d2d;
  }

  .post-content th,
  .post-content td {
    border-color: #444;
  }

  .post-content tr:nth-child(even) {
    background: #222;
  }

  .post-content blockquote {
    border-left-color: #444;
    color: #aaa;
  }

  /* Dark theme - OneDark style */
  .chroma { color: #abb2bf; background-color: #282c34; }
  .chroma .lnt { color: #55595f; }
  .chroma .ln { color: #55595f; }
  .chroma .k { color: #c678dd; }
  .chroma .kc { color: #e5c07b; }
  .chroma .kd { color: #c678dd; }
  .chroma .kn { color: #c678dd; }
  .chroma .kp { color: #c678dd; }
  .chroma .kr { color: #c678dd; }
  .chroma .kt { color: #e5c07b; }
  .chroma .na { color: #e06c75; }
  .chroma .nc { color: #e5c07b; }
  .chroma .no { color: #e06c75; }
  .chroma .nd { color: #61afef; }
  .chroma .ni { color: #e06c75; }
  .chroma .nn { color: #e06c75; }
  .chroma .nx { color: #e06c75; }
  .chroma .nt { color: #e06c75; }
  .chroma .nb { color: #e5c07b; }
  .chroma .nv { color: #e06c75; }
  .chroma .nf { color: #61afef; }
  .chroma .fm { color: #56b6c2; }
  .chroma .s { color: #98c379; }
  .chroma .sa { color: #98c379; }
  .chroma .sb { color: #98c379; }
  .chroma .sc { color: #98c379; }
  .chroma .dl { color: #98c379; }
  .chroma .sd { color: #98c379; }
  .chroma .s2 { color: #98c379; }
  .chroma .se { color: #98c379; }
  .chroma .sh { color: #98c379; }
  .chroma .si { color: #98c379; }
  .chroma .sx { color: #98c379; }
  .chroma .sr { color: #98c379; }
  .chroma .s1 { color: #98c379; }
  .chroma .ss { color: #98c379; }
  .chroma .m { color: #d19a66; }
  .chroma .mb { color: #d19a66; }
  .chroma .mf { color: #d19a66; }
  .chroma .mh { color: #d19a66; }
  .chroma .mi { color: #d19a66; }
  .chroma .il { color: #d19a66; }
  .chroma .mo { color: #d19a66; }
  .chroma .o { color: #56b6c2; }
  .chroma .ow { color: #56b6c2; }
  .chroma .p { color: #abb2bf; }
  .chroma .c { color: #7f848e; }
  .chroma .ch { color: #7f848e; }
  .chroma .cm { color: #7f848e; }
  .chroma .c1 { color: #7f848e; }
  .chroma .cs { color: #7f848e; }
  .chroma .cp { color: #7f848e; }
  .chroma .cpf { color: #7f848e; }
}

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

  .post-header h1 {
    font-size: 1.5rem;
  }
}
