@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --text:        #111827;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --bg:          #ffffff;
  --border:      #f0f0f0;
  --accent:      #2d6a4f;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ── Home layout ─────────────────────────── */

.home-layout {
  display: flex;
  flex-direction: row;
  gap: 64px;
  align-items: flex-start;
}

.home-content {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar ─────────────────────────────── */

.sidebar {
  width: 160px;
  flex-shrink: 0;
  padding-top: 56px;
}

.sidebar-category {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.sidebar-subnav {
  margin-top: 4px;
  margin-left: 10px;
}

.sidebar-subnav a {
  font-size: 0.8125rem;
}

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

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

/* ── Header ─────────────────────────────── */

header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.site-name {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover {
  color: var(--accent);
}

.site-tagline {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Main ────────────────────────────────── */

main {
  flex: 1;
  padding: 56px 0;
}

/* ── Article list ────────────────────────── */

.post-list {
  list-style: none;
}

.post-item {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  padding-top: 0;
}

.post-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.post-title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 10px;
}

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

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

.post-excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.read-more {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.read-more:hover {
  text-decoration: underline;
}

/* ── Article detail ──────────────────────── */

.back-link {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 48px;
}

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

.article-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #374151;
}

.article-body p {
  margin-bottom: 24px;
}

.article-body h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body ul,
.article-body ol {
  margin: 0 0 24px 20px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.article-body th,
.article-body td {
  border: 1px solid #d0d0d0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  font-weight: 600;
  color: var(--text);
  background: #fafafa;
}

.article-body td a {
  color: var(--text);
  text-decoration: none;
}

.article-body td a:hover {
  text-decoration: underline;
}

.article-body li {
  margin-bottom: 8px;
}

/* ── Comparison table ────────────────────── */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #d0d0d0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  font-weight: 600;
  color: var(--text);
  background: #fafafa;
}

.comparison-table td a {
  color: var(--text);
  text-decoration: none;
}

.comparison-table td a:hover {
  text-decoration: underline;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3),
.comparison-table th:nth-child(4),
.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3),
.comparison-table td:nth-child(4) {
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

/* ── Pagination ──────────────────────────── */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.pagination-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.pagination-link:hover {
  text-decoration: underline;
}

.pagination-newer {
  margin-right: auto;
}

.pagination-older {
  margin-left: auto;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 768px) {
  header { padding: 32px 0 28px; }
  main   { padding: 40px 0; }
  .article-title { font-size: 1.375rem; }

  .home-layout {
    flex-direction: column;
    gap: 0;
  }

  .sidebar {
    width: 100%;
    padding-top: 0;
    padding-bottom: 40px;
    border-top: 1px solid var(--border);
  }
}
