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

:root {
  --text:     #1a1a1a;
  --muted:    #888;
  --border:   #e8e8e8;
  --bg:       #fafaf8;
  --accent:   #2a2a2a;
  --max-w:    680px;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

html { font-size: 18px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* ── Layout ── */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Header ── */
header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

header a { text-decoration: none; color: var(--text); }

.site-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav {
  font-size: 0.85rem;
  color: var(--muted);
}

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

.site-nav a:hover { color: var(--text); }

/* ── Post List ── */
.post-list { list-style: none; }

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  flex: 1;
}

.post-list a:hover { color: #555; }

.post-date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Single Post ── */
.post-header { margin-bottom: 2.5rem; }

.post-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.post-content { font-size: 1rem; }

.post-content p { margin-bottom: 1.4rem; }

.post-content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

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

.post-content li { margin-bottom: 0.3rem; }

.post-content a { color: var(--text); }

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

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

/* ── Back link ── */
.back-link {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover { color: var(--text); }

/* ── Footer ── */
footer {
  margin: 4rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  html { font-size: 16px; }
  header { flex-direction: column; gap: 0.75rem; }
  .site-nav a:first-child { margin-left: 0; }
  .post-list li { flex-direction: column; gap: 0.15rem; }
}

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

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

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

.post-nav-label {
  font-size: 0.78rem;
  color: var(--muted);
}

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

.post-nav-link:hover .post-nav-title {
  color: #555;
}

@media (max-width: 480px) {
  .post-nav { flex-direction: column; }
  .post-nav-next { text-align: left; margin-left: 0; }
  .post-nav-link { max-width: 100%; }
}
