/* ============================================================
   main.css — Vibrant Spring design system
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --color-primary:       #2d8a4e;
  --color-primary-dark:  #1f6b3a;
  --color-primary-light: #4caf50;
  --color-accent:        #f9d342;
  --color-accent-light:  #ffe066;
  --color-bg:            #ffffff;
  --color-surface:       #f6fdf8;
  --color-surface-2:     #edf7f1;
  --color-border:        #c8e6d0;
  --color-text:          #1a2e1f;
  --color-text-muted:    #4a6355;
  --color-link:          #2d8a4e;
  --color-link-hover:    #1f6b3a;
  --header-height:       64px;
  --max-content-width:   1400px;
  --radius-sm:           4px;
  --radius-md:           8px;
  --radius-lg:           16px;
  --shadow-sm:           0 1px 4px rgba(45,138,78,.10);
  --shadow-md:           0 4px 16px rgba(45,138,78,.13);
  --shadow-lg:           0 8px 32px rgba(45,138,78,.16);
  --transition:          0.2s ease;
  --font-sans:           'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:           'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Anchor offset for sticky header ───────────────────────── */
:target, h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

/* ── Layout ──────────────────────────────────────────────────── */
.site-main { flex: 1; }
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--color-primary-dark); margin-bottom: 1rem; margin-top: 0; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);   color: var(--color-primary);      margin-bottom: .75rem; margin-top: 2.5rem; border-bottom: 2px solid var(--color-border); padding-bottom: .5rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--color-primary-dark); margin-bottom: .5rem;  margin-top: 2rem; }
h4 { font-size: 1.1rem;                      color: var(--color-text);         margin-bottom: .4rem;  margin-top: 1.5rem; }
p  { margin-bottom: 1.2rem; }
ul, ol { margin-bottom: 1.2rem; padding-left: 1.6rem; }
li { margin-bottom: .35rem; }
strong { color: var(--color-primary-dark); font-weight: 600; }

/* ── Links ───────────────────────────────────────────────────── */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}
a:hover { color: var(--color-link-hover); text-decoration-color: var(--color-accent); }

/* ── Inline code ──────────────────────────────────────────────── */
code:not([class]) {
  font-family: var(--font-mono);
  font-size: .875em;
  background: rgba(45, 138, 78, 0.07);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: .1em .35em;
}

/* ── Blockquote ──────────────────────────────────────────────── */
blockquote {
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Horizontal rule ──────────────────────────────────────────── */
hr { border: none; border-top: 2px solid var(--color-border); margin: 2rem 0; }

/* ── Images ───────────────────────────────────────────────────── */
img { max-width: 100%; height: auto; display: block; }

/* ── Article content ─────────────────────────────────────────── */
.article-content { max-width: 900px; }
.page-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}
@media (min-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  font-size: .85rem;
  color: var(--color-text-muted);
  padding: 1.25rem 0 .75rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { color: var(--color-border); font-size: .9em; }
.breadcrumbs .current { color: var(--color-primary-dark); font-weight: 600; }

/* ── Related content sidebar ──────────────────────────────────── */
.related-content {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}
.related-content h3 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: .5rem;
}
.related-content ul { padding: 0; list-style: none; margin: 0; }
.related-content li { margin-bottom: .5rem; }
.related-content a {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.related-content a:hover {
  background: var(--color-surface-2);
  color: var(--color-primary);
  transform: translateX(3px);
}
.related-content a.active {
  background: var(--color-surface-2);
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 1rem 0 3rem; }
  .related-content { position: static; }
}

