/* Editorial blog theme. Accent set per-site via --accent. */
:root {
  --accent: #2d7a4f;
  --text: #1a1a1a;
  --muted: #6b7280;
  --bg: #fdfdfc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --panel: #f6f7f8;
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--accent), transparent 75%);
}

/* ── Header ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
}

.site-header ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.site-header ul a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.site-header ul a:hover { color: var(--accent); }

/* ── Layout ───────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.home { max-width: 960px; margin: 0 auto; }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.site-desc {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.6rem;
}

.section-heading {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
}

.section-heading::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--accent);
  margin-top: 0.4rem;
  border-radius: 2px;
}

/* ── Post cards ───────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card,
.post-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover,
.post-summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.post-summary { margin-bottom: 1.5rem; }

.post-card h3,
.post-summary h3 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.post-card h3 a,
.post-summary h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.post-card h3 a:hover,
.post-summary h3 a:hover { color: var(--accent); }

.post-card p,
.post-summary p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.6rem 0;
}

.read-more {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.read-more:hover {
  color: color-mix(in srgb, var(--accent), black 15%);
}

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

.post-meta a { color: var(--accent); text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post-meta .dot { margin: 0 0.3rem; }

/* ── Article page ─────────────────────────────────── */
article.post h1 {
  font-size: 2rem;
  line-height: 1.3;
  letter-spacing: -0.4px;
}

.post-header { margin-bottom: 2rem; }
.post-header .post-meta { margin-top: 0.6rem; }

.toc {
  background: var(--panel);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.toc ul { padding-left: 1.2rem; }

.toc a {
  color: var(--muted);
  text-decoration: none;
}

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

/* ── Article content ──────────────────────────────── */
.post-content h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.2rem;
  margin: 1.8rem 0 0.8rem;
}

.post-content p { margin: 1.2rem 0; }

.post-content ul,
.post-content ol {
  margin: 1.2rem 0;
  padding-left: 1.6rem;
}

.post-content li { margin: 0.4rem 0; }

.post-content img {
  max-width: 100%;
  border-radius: 8px;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: #fafafa;
  padding: 0.5rem 1.2rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--muted);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th { background: var(--panel); }

.post-content tr:nth-child(even) td { background: #fafafa; }

/* ── Tags ─────────────────────────────────────────── */
.post-tags { margin: 2rem 0; }

.tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #f1f2f3;
  color: var(--muted);
  text-decoration: none;
  margin: 0 0.3rem 0.3rem 0;
  transition: background 0.15s, color 0.15s;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Related ──────────────────────────────────────── */
.related-posts {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.related-posts h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }

.related-posts ul { list-style: none; padding: 0; }

.related-posts li { margin: 0.6rem 0; }

.related-posts a {
  color: var(--accent);
  text-decoration: none;
}

.related-posts a:hover { text-decoration: underline; }

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

.site-footer a { color: var(--muted); }

/* ── Ads ──────────────────────────────────────────── */
.ad-container { margin: 2rem 0; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .post-grid { grid-template-columns: 1fr; }
  .site-header ul { gap: 1rem; }
  article.post h1 { font-size: 1.6rem; }
}
