:root {
  color-scheme: light dark;
  --bg: #fdfcfb;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #c1440e;
  --border: #e5e0da;
  --quote-bg: #f3efe8;
  --max-width: 680px;
  --sans-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f;
    --fg: #f2efe9;
    --muted: #a3998c;
    --accent: #ff8552;
    --border: #2c2822;
    --quote-bg: #201c17;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14120f;
  --fg: #f2efe9;
  --muted: #a3998c;
  --accent: #ff8552;
  --border: #2c2822;
  --quote-bg: #201c17;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}
.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.2;
}
.site-tagline {
  flex-basis: 100%;
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.2;
}
.site-nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--sans-font);
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--accent); }
.theme-toggle {
  margin-left: 1.25rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }

@media (max-width: 600px) {
  .site-tagline { display: none; }
}

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.post-list-item {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.post-list-item h2 { margin-bottom: 0.25rem; }
.post-list-item h2 a { color: var(--fg); text-decoration: none; }
.post-list-item h2 a:hover { color: var(--accent); }
.post-meta {
  color: var(--muted);
  font-family: var(--sans-font);
  font-size: 0.9rem;
}

.post-title { margin-bottom: 0.25rem; }
.post-content { font-size: 1.125rem; }
.post-content img { max-width: 100%; }
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--quote-bg);
  border-radius: 8px;
}
.post-content blockquote p { margin: 0.5rem 0; }
.post-content blockquote p:first-child { margin-top: 0; }
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-image {
  margin: 1.5rem 0;
}
.post-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.post-image figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: var(--sans-font);
  font-size: 0.85rem;
}

.post-share,
.post-nav {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--sans-font);
  font-size: 0.9rem;
  display: flex;
  gap: 0.75rem;
}
.post-share {
  margin-top: 2rem;
  align-items: center;
  flex-wrap: wrap;
}
.post-share-label { color: var(--muted); }
.post-share-link {
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.post-share-link:hover { text-decoration: underline; }

.post-nav {
  margin-top: 1.5rem;
  justify-content: space-between;
}
.post-nav-link { color: var(--accent); text-decoration: none; }
.post-nav-link:hover { text-decoration: underline; }
.post-nav-next { margin-left: auto; text-align: right; }

.back-to-top {
  margin-top: 1.5rem;
  font-family: var(--sans-font);
  font-size: 0.85rem;
}
.back-to-top a { color: var(--muted); text-decoration: none; }
.back-to-top a:hover { color: var(--accent); }

.comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.comments h2 { font-size: 1.2rem; }

.comment-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:first-child { padding-top: 0; }
.comment-meta {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-family: var(--sans-font);
  font-size: 0.85rem;
}
.comment-author { color: var(--fg); font-weight: bold; }
.comment-body { margin: 0; }
.comment-empty {
  color: var(--muted);
  font-family: var(--sans-font);
  font-size: 0.9rem;
}

.comment-form {
  font-family: var(--sans-font);
}
.comment-field { margin-bottom: 0.85rem; }
.comment-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.comment-field input,
.comment-field textarea,
.subscribe-form input[type="email"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
}
.comment-field input,
.comment-field textarea {
  width: 100%;
  font: inherit;
  resize: vertical;
}
.comment-honeypot,
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.comment-form button,
.subscribe-form button {
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.comment-form button:disabled,
.subscribe-form button:disabled { opacity: 0.6; cursor: default; }
.comment-status,
.subscribe-status {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 2rem 0 3rem;
  font-family: var(--sans-font);
}
.footer-subscribe h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.subscribe-form input[type="email"] { flex: 1 1 220px; }
.subscribe-status { flex-basis: 100%; }

.footer-meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-meta a { color: var(--muted); }
