/* base.css — shared across all sections */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Overridden by each section's CSS */
  --color-bg: #fff;
  --color-surface: #f5f5f5;
  --color-text: #111;
  --color-text-muted: #555;
  --color-accent: #000;
  --color-accent-hover: #333;
  --color-border: #ddd;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: var(--font-body);
  --font-mono: "Fira Code", "Courier New", monospace;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --radius: 0.25rem;
  --max-width: 72ch;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  padding: var(--space-sm);
}

main {
  max-width: var(--max-width);
  margin: var(--space-md) auto;
  padding: 0 var(--space-sm);
}

/* ── Navigation ──────────────────────────────────────────── */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.site-nav__home {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.site-nav__home:hover { text-decoration: underline; }

.site-nav__sections {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
}

.site-nav__sections a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-nav__sections a:hover,
.site-nav__sections a:focus {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ── Individual post ─────────────────────────────────────── */
.post__header { margin-bottom: var(--space-md); }

.post__title {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.2;
}

.post__date {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
  display: block;
}

.post__description {
  margin-top: var(--space-sm);
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

.post__hero-image { margin: var(--space-md) 0; }

.post__hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.post__body { max-width: var(--max-width); }

.post__body h2,
.post__body h3 {
  font-family: var(--font-heading);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.post__body p { margin-bottom: var(--space-sm); }

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

.post__body img {
  max-width: 100%;
  border-radius: var(--radius);
}

.post__body blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: var(--space-sm);
  margin: var(--space-md) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.post__body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post__body pre {
  background: var(--color-surface);
  padding: var(--space-sm);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: var(--space-sm);
}

.post__body pre code {
  background: none;
  padding: 0;
}

.post__body ul {
  margin-left: 2em;
  margin-bottom: 1em;
}

.post__body hr {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.post__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.post__gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.post__footer {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.post__footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.post__footer a:hover { color: var(--color-accent); }

/* ── Section index page ──────────────────────────────────── */
.section-index__header {
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: var(--space-sm);
}

.section-index__title {
  font-family: var(--font-heading);
  font-size: 3rem;
}

.section-index__description {
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
}

.section-index__empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-card__inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-sm);
  align-items: start;
}

.post-card__thumb {
  width: 120px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.post-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

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

.post-card__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: var(--space-xs);
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

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

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .post-card__inner { grid-template-columns: 1fr; }
  .post-card__thumb { width: 100%; height: 160px; }
  .post__title { font-size: 1.5rem; }
  .section-index__title { font-size: 2rem; }
}
