/* ── Custom Properties (synced with main site) ── */
:root {
  --bg: #fafcfa;
  --bg-alt: #f2f5f2;
  --bg-dark: #0f1810;
  --text: #0f1810;
  --text-secondary: #4a5548;
  --text-muted: #6b7a69;
  --green: #1faa20;
  --green-light: #e4f2e4;
  --green-hover: #178a17;
  --border: #dde3dd;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 30px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h4, .nav-logo {
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

::selection {
  background-color: var(--green);
  color: white;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.btn:focus-visible {
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

img {
  max-width: 100%;
  display: block;
}

.container-sm {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ══════════════════════════════════════════════════
   Navigation (identical to main site)
   ══════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.nav-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Buttons (same as main site) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--green);
  color: white;
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  font-size: 18px;
  min-width: 200px;
}

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 10px 24px;
  font-size: 16px;
  min-width: auto;
}

/* ══════════════════════════════════════════════════
   Blog Hero
   ══════════════════════════════════════════════════ */
.blog-hero {
  padding: 160px 32px 48px;
  background: var(--bg-alt);
}

.blog-hero-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.blog-hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

/* ══════════════════════════════════════════════════
   Post List
   ══════════════════════════════════════════════════ */
.section {
  padding: 48px 32px 100px;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
}

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

.post-card:last-child {
  border-bottom: none;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.post-tags {
  display: flex;
  gap: 6px;
}

.tag {
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.post-card-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.post-card-title a {
  transition: color 0.15s;
}

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

.post-card-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-read-more {
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  transition: color 0.15s;
}

.post-read-more:hover {
  color: var(--green-hover);
}

/* ══════════════════════════════════════════════════
   Article Header (single post)
   ══════════════════════════════════════════════════ */
.article-header {
  padding: 160px 32px 48px;
  background: var(--bg-alt);
}

.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color 0.15s;
}

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

.article-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.article-desc {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════
   Article Body (prose)
   ══════════════════════════════════════════════════ */
.article-body {
  padding: 48px 0 80px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
}

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

.article-body h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 56px 0 16px;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 12px;
}

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

.article-body a {
  color: var(--green);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(31, 170, 32, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.article-body a:hover {
  text-decoration-color: var(--green);
}

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

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

.article-body li::marker {
  color: var(--green);
}

.article-body blockquote {
  margin: 28px 0;
  padding: 20px 28px;
  border-left: 3px solid var(--green);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body code {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text);
}

.article-body pre {
  margin: 28px 0;
  padding: 24px;
  background: #0d1117;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.65;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  color: #e5e5e5;
}

.article-body img {
  border-radius: var(--radius);
  margin: 36px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
}

.article-body th, .article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  font-weight: 700;
  color: var(--text);
}

/* ══════════════════════════════════════════════════
   Footer (identical to main site)
   ══════════════════════════════════════════════════ */
.footer {
  padding: 60px 32px 40px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 14px;
}

.footer-col a {
  display: block;
  padding: 8px 0;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */
/* ── Mobile nav ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 32px;
    border-bottom: 1px solid transparent;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
  }
  .nav-links.open {
    max-height: 300px;
    padding: 16px 32px;
    border-bottom-color: var(--border);
  }
  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }
  .blog-hero { padding: 120px 20px 40px; }
  .section { padding: 32px 20px 60px; }
  .article-header { padding: 120px 20px 32px; }
  .footer-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 600px) {
  .blog-hero-title { font-size: 32px; }
  .blog-hero-subtitle { font-size: 16px; }
  .article-title { font-size: 28px; }
  .article-desc { font-size: 17px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 24px; }
  .article-body h3 { font-size: 20px; }
  .post-card-title { font-size: 22px; }
  .btn-sm { padding: 8px 20px; font-size: 14px; }
}
