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

/* ── Variables ── */
:root {
  --red: #C0292A;
  --red-dark: #991f1f;
  --text: #1a1a1a;
  --text-muted: #555;
  --text-faint: #999;
  --border: #e0e0e0;
  --bg: #ffffff;
  --font: system-ui, -apple-system, sans-serif;
  --max-width: 1000px;
}

/* ── Base ── */
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ── */
.site-header {
  border-bottom: 2px solid var(--red);
  padding: 1.25rem 0;
  margin-bottom: 3rem;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--red); }

.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--red); }

/* ── Tags & Labels ── */
.tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 1rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.tag.small {
  font-size: 10px;
  padding: 3px 9px;
  margin-bottom: 0.6rem;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  margin-bottom: 1.25rem;
}

/* ── Post meta ── */
.post-meta {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.post-meta .brand {
  color: var(--red);
  font-weight: 600;
}

/* ── Hero ── */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  max-width: 720px;
}
.hero-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--red); }
.hero-excerpt {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.1rem;
}

/* ── Article grid ── */
.latest { margin-bottom: 3rem; }
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}
.article-card {
  border-top: 2px solid var(--border);
  padding-top: 1.25rem;
  transition: border-color 0.15s;
}
.article-card:hover {
  border-top-color: var(--red);
}
.article-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.article-title a { color: var(--text); }
.article-title a:hover { color: var(--red); }
.article-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* ── Topic pills ── */
.topics { margin-bottom: 3rem; }
.topic-pills {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pill {
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pill:hover {
  border-color: var(--red);
  color: var(--red);
}
.pill.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

/* ── Category header ── */
.category-header { margin-bottom: 2.5rem; }
.category-title {
  font-size: 30px;
  font-weight: 700;
  border-left: 4px solid var(--red);
  padding-left: 1rem;
}
.empty { color: var(--text-faint); font-size: 14px; }

/* ── Post body ── */
.post {
  max-width: 700px;
  margin: 0 auto 4rem;
}
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.post-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}
.post-excerpt {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.1rem;
}
.post-body { font-size: 17px; line-height: 1.85; }
.post-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.3px;
}
.post-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.post-body p { margin-bottom: 1.4rem; }
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.post-body li { margin-bottom: 0.5rem; }
.post-body strong { font-weight: 600; }
.post-body a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--red-dark); }
.post-body blockquote {
  border-left: 3px solid var(--red);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--text-muted);
  margin: 2rem 0;
  font-style: italic;
  font-size: 18px;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4rem;
  font-size: 15px;
}
.post-body th {
  text-align: left;
  border-bottom: 2px solid var(--border);
  padding: 0.6rem 0.75rem;
  font-weight: 600;
}
.post-body td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
}
.post-body code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
}
.post-body pre {
  background: #f4f4f4;
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.4rem;
}
.post-body pre code { background: none; padding: 0; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 4rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy { font-size: 13px; color: var(--text-faint); }

/* ── Responsive ── */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero-title { font-size: 26px; }
  .post-title { font-size: 26px; }
  .article-grid { grid-template-columns: 1fr; }
  .container { padding: 0 1.25rem; }
}