:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #6b6b6b;
  --accent: #2557a7;
  --chip-bg: #eef1f5;
  --chip-bg-active: #2557a7;
  --chip-fg-active: #ffffff;
  --border: #e2e2e2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e9e9e9;
    --bg: #14161a;
    --muted: #9a9a9a;
    --accent: #7aa7e8;
    --chip-bg: #22262e;
    --chip-bg-active: #7aa7e8;
    --chip-fg-active: #14161a;
    --border: #2a2d33;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
}

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

.site-subtitle {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

a { color: var(--accent); }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.tag-chip {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.tag-chip:hover {
  border-color: var(--accent);
}

.tag-chip.is-active {
  background: var(--chip-bg-active);
  color: var(--chip-fg-active);
  border-color: var(--chip-bg-active);
}

.feed-links {
  margin: 0.35rem 0 0;
}

.feed-links a {
  color: var(--muted);
  text-decoration: none;
}

.feed-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.2rem 0;
}

/* Author styles always beat the browser's built-in [hidden]{display:none}
   rule, so the .post-item display:flex above silently overrides it and
   the JS tag filter's `post.hidden = true` would do nothing without
   this explicit override. */
.post-item[hidden] {
  display: none;
}

.post-date {
  flex: 0 0 auto;
  width: 7.5rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.post-title {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
}

.post-content { margin-top: 1.75rem; }

.post-content > h1:first-of-type { margin-top: 0.25rem; }

.post-content img,
.post-content video {
  max-width: 100%;
  height: auto;
}

.post-attachments {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-attachments h2 {
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-back { margin-top: 2.5rem; }

.post-empty { color: var(--muted); }
