:root {
  --primary: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #fff;
  --bg-soft: #f9fafb;
  --cta-bg: #16a34a;
  --cta-hover: #15803d;
  --header-bg: #1e293b;
  --star: #f59e0b;
  --r: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--r); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem; line-height: 1.75; color: var(--text); background: var(--bg);
}

/* ── Header ── */
.site-header {
  background: var(--header-bg); position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.site-logo { color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.site-nav a { color: rgba(255,255,255,.8); text-decoration: none; font-size: .875rem; margin-left: 1.5rem; }
.site-nav a:hover { color: #fff; }

/* ── Layout ── */
.site-container {
  max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem;
  display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start;
}
@media (max-width: 768px) {
  .site-container { grid-template-columns: 1fr; padding: 1.25rem 1rem; }
}

/* ── Hero banner ── */
.hero-banner {
  background-size: cover; background-position: center;
  height: 280px; border-radius: var(--r); overflow: hidden;
  position: relative; margin-bottom: 2rem;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.65));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 2rem; color: #fff;
}
.hero-overlay h1 {
  font-size: clamp(1.4rem,3vw,2rem); font-weight: 800;
  letter-spacing: -.02em; margin-bottom: .4rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.hero-overlay p { font-size: 1rem; opacity: .9; }
.hero-gradient {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border-radius: var(--r); padding: 2.5rem 2rem; margin-bottom: 2rem; color: #fff;
}
.hero-gradient h1 { font-size: clamp(1.4rem,3vw,2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.hero-gradient p { opacity: .85; }

/* ── Post cards ── */
.posts-feed { display: flex; flex-direction: column; gap: 1rem; }
.post-card {
  border: 1px solid var(--border); border-radius: var(--r); background: var(--bg);
  transition: box-shadow .15s, transform .1s;
}
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.post-card-body { padding: 1.25rem 1.5rem; }
.post-card h2 { font-size: 1.08rem; font-weight: 700; line-height: 1.4; margin-bottom: .4rem; }
.post-card h2 a { text-decoration: none; color: var(--text); }
.post-card h2 a:hover { color: var(--primary); }
.post-excerpt { font-size: .875rem; color: var(--muted); margin-bottom: .75rem; line-height: 1.6; }
.post-badge {
  display: inline-block; background: var(--star); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .2em .55em; border-radius: 4px; margin-bottom: .5rem;
}
.post-meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.post-meta .sep { opacity: .4; }
.read-more { color: var(--primary); text-decoration: none; font-weight: 600; }
.read-more:hover { text-decoration: underline; }
.section-heading { font-size: 1.4rem; font-weight: 800; color: #111827; }

/* ── Article ── */
.post-banner {
  background-size: cover; background-position: center;
  height: 220px; border-radius: var(--r); overflow: hidden;
  position: relative; margin-bottom: 2rem;
}
.post-banner-inner {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.45));
  display: flex; align-items: flex-end; padding: 1rem 1.5rem;
}
.post-tag {
  background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .25em .75em;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .05em;
}
.post-header { margin-bottom: 1.75rem; }
.post h1 {
  font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800;
  letter-spacing: -.02em; line-height: 1.25; margin-bottom: .75rem; color: #111827;
}
.post .post-meta { margin-bottom: 1rem; }
.post .post-meta strong { color: var(--text); }
.rating-box {
  display: flex; align-items: center; gap: 1rem;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--r); padding: .875rem 1.25rem; margin: 1rem 0 1.5rem;
}
.rating-label { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.rating-label strong { color: var(--text); font-size: 1.2rem; }
.rating-bar-wrap { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: linear-gradient(90deg,#f59e0b,#d97706); border-radius: 4px; width: calc(var(--score,5) * 10%); }

/* ── Prose ── */
.post-content { line-height: 1.8; }
.post-content p { margin-bottom: 1.1rem; }
.post-content h2 {
  font-size: 1.3rem; font-weight: 700; margin: 2.5rem 0 .6rem;
  padding-bottom: .4rem; border-bottom: 2px solid var(--border); color: #111827;
}
.post-content h3 { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 .4rem; }
.post-content ul, .post-content ol { margin: .75rem 0 1rem 1.5rem; }
.post-content li { margin-bottom: .35rem; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.post-content blockquote {
  border-left: 4px solid var(--primary); background: #eff6ff;
  margin: 1.5rem 0; padding: .75rem 1.25rem;
  border-radius: 0 var(--r) var(--r) 0; color: #374151;
}
.post-content strong { font-weight: 700; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.post-content th { background: var(--bg-soft); font-weight: 600; text-align: left; padding: .6rem .875rem; border: 1px solid var(--border); }
.post-content td { padding: .5rem .875rem; border: 1px solid var(--border); }
.post-content tr:nth-child(even) { background: #fafafa; }

/* ── CTA ── */
.cta { margin: 2.5rem 0; padding: 1.5rem; background: linear-gradient(135deg,#f0fdf4,#dcfce7); border: 1px solid #86efac; border-radius: var(--r); text-align: center; }
.cta a {
  background: var(--cta-bg); color: #fff; padding: .875rem 2.5rem;
  border-radius: var(--r); text-decoration: none; font-weight: 700; font-size: 1.05rem;
  display: inline-block; transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.cta a:hover { background: var(--cta-hover); transform: translateY(-1px); }

/* ── Sidebar ── */
.site-sidebar { position: sticky; top: 72px; }
.widget { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 1.25rem; margin-bottom: 1.25rem; }
.widget-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.author-card { display: flex; gap: .875rem; align-items: flex-start; }
.author-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-size: 1.25rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.author-info strong { display: block; font-size: .95rem; margin-bottom: .25rem; }
.author-info p { font-size: .8rem; color: var(--muted); line-height: 1.5; margin: 0; }
.widget-list { list-style: none; }
.widget-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.widget-list li:last-child { border-bottom: none; }
.widget-list a { text-decoration: none; color: var(--primary); }
.widget-list a:hover { text-decoration: underline; }
.widget-list span { color: var(--muted); font-size: .8rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); font-size: .78rem; padding: .2em .6em; border-radius: 4px; text-decoration: none; }
.tag:hover { background: #eff6ff; border-color: var(--primary); color: var(--primary); }

/* ── Footer ── */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; font-size: .875rem; color: var(--muted); margin-top: 2rem; }
