/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Code+Pro:wght@400;500&display=swap');

/* Variables */
:root {
  --bg: #ffffff;
  --text: #222222;
  --text-muted: #888888;
  --border: #e5e5e5;
  --link: #0066cc;
  --link-hover: #004499;
  --accent: #f5f5f0;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'Source Code Pro', 'Courier New', monospace;
  --max-width: 640px;
  --spacing: 1.75rem;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* Header */
.site-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  text-decoration: none;
}

/* Main */
main.container {
  flex: 1;
  padding-top: 0;
  padding-bottom: 3rem;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.year-group h2.year-label {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-family: var(--font-serif);
}

.year-group ul {
  list-style: none;
  border-top: 1px solid var(--border);
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item time {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 4.5rem;
  font-family: var(--font-mono);
}

.post-item a {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

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

/* Post / Page */
.post-header,
.page-header {
  margin-bottom: 2.5rem;
}

.post-title,
.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Post Content */
.post-content,
.page-content {
  font-size: 1rem;
  line-height: 1.8;
}

.post-content > * + *,
.page-content > * + * {
  margin-top: 1.5rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1rem; }

.post-content p { margin-top: 1.25rem; }

.post-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.post-content li + li {
  margin-top: 0.35rem;
}

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

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

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Syntax highlighting - minimal rouge theme */
.highlight .c  { color: #999; font-style: italic }
.highlight .cm { color: #999; font-style: italic }
.highlight .cp { color: #999; font-weight: bold }
.highlight .c1 { color: #999; font-style: italic }
.highlight .cs { color: #999; font-weight: bold; font-style: italic }
.highlight .k  { color: #333; font-weight: bold }
.highlight .kd { color: #333; font-weight: bold }
.highlight .kn { color: #333; font-weight: bold }
.highlight .s  { color: #d14 }
.highlight .s1 { color: #d14 }
.highlight .s2 { color: #d14 }
.highlight .n  { color: #333 }
.highlight .nf { color: #900 }
.highlight .na { color: #008080 }
.highlight .nb { color: #0086B3 }
.highlight .mi { color: #099 }
.highlight .m  { color: #099 }

/* Tags */
.post-tags {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tags a {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

/* Post Nav */
.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  max-width: 45%;
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

.post-nav .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-nav .title {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}

.post-nav a:hover .title {
  color: var(--link);
}

/* Footer */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
}

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

.sep { color: var(--border); }

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

  .site-header {
    padding: 1.25rem 0 1rem;
    margin-bottom: 1.75rem;
  }

  .post-title,
  .page-title {
    font-size: 1.5rem;
  }

  .post-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .post-nav a {
    max-width: 100%;
  }

  .post-nav-next {
    text-align: left;
    margin-left: 0;
  }
}
.site-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}
