/* Minimal blog stylesheet — inspired by macwright.com */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Fira Code", "JetBrains Mono", Consolas, monospace;
  --bg: #fff;
  --text: #111;
  --text-dim: #555;
  --link: #111;
  --link-visited: #333;
  --border: #eee;
  --max-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --text: #ccc;
    --text-dim: #888;
    --link: #ccc;
    --link-visited: #aaa;
    --border: #333;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.nav {
  padding: 40px 0 20px;
}
.nav .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.nav-title {
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 16px;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
}
.nav-links a:hover {
  text-decoration: underline;
}

/* Post list (index/archive) */
.posts {
  margin: 20px 0;
}
.post-summary {
  display: grid;
  grid-template-columns: min-content 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
}
.post-summary time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.post-summary a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}
.post-summary a:hover {
  text-decoration: underline;
}
.post-summary a:visited {
  color: var(--link-visited);
}

.badge {
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

.year-heading {
  margin: 24px 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.more {
  margin-top: 16px;
}
.more a {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Single post */
.post-header {
  margin: 20px 0;
}
.post-header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.post-header time {
  color: var(--text-dim);
  font-size: 0.9rem;
}
.post-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.post-tags a {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 8px;
}
.post-tags a:hover {
  text-decoration: underline;
}

/* Post body */
.post-body {
  margin: 24px 0;
}
.post-body h2 {
  margin: 32px 0 12px;
  font-size: 1.3rem;
  font-weight: 600;
}
.post-body h3 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}
.post-body p {
  margin: 16px 0;
}
.post-body a {
  color: var(--link);
}
.post-body a:visited {
  color: var(--link-visited);
}
.post-body img {
  max-width: 100%;
  height: auto;
}
.post-body blockquote {
  margin: 16px 0;
  padding: 10px 20px;
  border-left: 3px solid var(--border);
  color: var(--text-dim);
  font-style: italic;
}
.post-body blockquote p {
  margin: 0;
}

/* Code */
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 5px;
  border-radius: 3px;
}
.post-body pre {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.post-body pre code {
  background: none;
  padding: 0;
}

/* Lists */
.post-body ul, .post-body ol {
  margin: 16px 0;
  padding-left: 24px;
}
.post-body li {
  margin: 4px 0;
}

/* Tables */
.post-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 24px 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.post-body th {
  font-weight: 600;
  border-bottom: 2px solid var(--text);
  padding: 6px 10px;
  text-align: left;
}
.post-body td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.post-body td:not(:first-child),
.post-body th:not(:first-child) {
  text-align: right;
}
.post-body td:first-child {
  white-space: nowrap;
}


/* Inline entries (notes shown on index) */
.feed {
  margin: 20px 0;
}
.feed .post-summary {
  margin: 0;
}
.entry {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.entry-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.entry-title {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}
.entry-title:hover {
  text-decoration: underline;
}
.entry-meta time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.entry-body {
  margin: 0;
}
.entry-body > p:first-child {
  margin-top: 0;
}
.entry-body > p:last-child {
  margin-bottom: 0;
}
.entry-tags {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.entry-tags a {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
}
.entry-tags a:hover {
  text-decoration: underline;
}
.continue {
  margin: 8px 0 0;
}
.continue a {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none;
}
.continue a:hover {
  text-decoration: underline;
}

/* Tags index */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.tag-item {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 10px;
}
.tag-item:hover {
  text-decoration: underline;
}
.tag-count {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Footer */
footer {
  margin-top: 60px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
  .post-summary {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .post-summary time {
    font-size: 0.8rem;
  }
  .post-header h1 {
    font-size: 1.5rem;
  }
}
