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

:root {
  --green:      #1a6b3c;
  --green-light:#e8f5ee;
  --green-mid:  #2e8b57;
  --text:       #1a1a2e;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --bg:         #f9fafb;
  --white:      #ffffff;
  --radius:     6px;
  --max-w:      1100px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

.home-layout,
.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2rem 0;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--green);
  color: var(--white);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}
.logo-text-wrap { display: flex; flex-direction: column; }
.logo-text { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.logo-sub  { font-size: 0.72rem; opacity: 0.8; }

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.site-nav a:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.nav-start {
  background: rgba(255,255,255,0.2);
  font-weight: 600;
  border-radius: var(--radius);
}
.nav-start:hover { background: rgba(255,255,255,0.35) !important; }
.nav-search { font-size: 1rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}

/* ── Home Hero ────────────────────────────────────────────────────────────── */
.home-hero {
  background: var(--green-light);
  border: 1px solid #c6e6d5;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.home-hero__text { display: flex; flex-direction: column; gap: 0.1rem; }
.home-hero__text strong { color: #14532d; font-size: 1rem; }
.home-hero__text span { color: #1a6b3c; font-size: 0.87rem; opacity: 0.85; }
.home-hero__ctas { display: flex; gap: 0.6rem; flex-shrink: 0; }
.hero-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.hero-btn--primary { background: var(--green); color: #fff; }
.hero-btn--primary:hover { background: var(--green-mid); text-decoration: none; }
.hero-btn--secondary { background: #fff; color: var(--green); border: 1.5px solid var(--green-mid); }
.hero-btn--secondary:hover { background: var(--green-light); text-decoration: none; }

/* ── Post Grid (home) ─────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.post-card-img-wrap { display: block; aspect-ratio: 16/9; overflow: hidden; }
.post-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.post-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.post-card-labels { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.post-card-title { font-size: 0.97rem; font-weight: 600; line-height: 1.4; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--green); text-decoration: none; }
.post-card-excerpt { font-size: 0.85rem; color: var(--muted); flex: 1; }
.post-card-meta { font-size: 0.78rem; color: var(--muted); margin-top: auto; }

/* Featured (first) post card */
.post-card--featured { grid-column: 1 / -1; }
.post-card--featured .post-card-title { font-size: 1.2rem; }
.post-card--featured .post-card-excerpt { font-size: 0.93rem; }
.post-card--featured .post-card-body { padding: 1.25rem 1.5rem; }
.post-card--featured .post-card-img-wrap { aspect-ratio: 21/9; }

/* ── Post ─────────────────────────────────────────────────────────────────── */
.post {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.post-hero { margin: -2rem -2rem 1.5rem; }
.post-hero img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }

.post-header { margin-bottom: 1.5rem; }
.post-labels { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.post-title { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.post-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.post-meta a { color: var(--muted); }

.post-body { line-height: 1.8; }
.post-body p { margin-bottom: 1rem; }
.post-body h2 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.post-body h3 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.4rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-body li { margin-bottom: 0.3rem; }
.post-body a { color: var(--green); }
.post-body blockquote {
  border-left: 4px solid var(--green);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: var(--green-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.post-footer { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.post-labels-footer { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.post-disclaimer { font-size: 0.8rem; color: var(--muted); font-style: italic; }

/* ── Label Pills ──────────────────────────────────────────────────────────── */
.label-pill {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  text-decoration: none;
}
a.label-pill:hover { background: var(--green); color: #fff; }
.label-pill--sm { font-size: 0.7rem; }

/* ── News topic filter bar ────────────────────────────────────────────────── */
.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 1rem 0 1.1rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.news-filter-pill {
  display: inline-block;
  padding: 0.38rem 1rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border: 1.5px solid #d1d5db;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.news-filter-pill:hover {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green-mid);
}
.news-filter-pill.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 1px 4px rgba(26,107,60,0.25);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.widget-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green-light);
}
.sidebar-widget p { font-size: 0.87rem; color: var(--muted); line-height: 1.6; }

.sidebar-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.sidebar-links a { font-size: 0.87rem; color: var(--green); }

/* Popular Pages widget */
.pop-pages { list-style: none; display: flex; flex-direction: column; }
.pop-pages li a {
  display: block;
  padding: 0.38rem 0;
  font-size: 0.86rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  text-decoration: none;
}
.pop-pages li:last-child a { border-bottom: none; }
.pop-pages li a:hover { color: var(--green); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pagination-btn {
  background: var(--green);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.pagination-btn:hover { background: var(--green-mid); text-decoration: none; }
.pagination-info { font-size: 0.85rem; color: var(--muted); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
}
.footer-inner { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-legal { max-width: 700px; line-height: 1.6; }
.footer-links a { color: rgba(255,255,255,0.6); margin-right: 1rem; }
.footer-copy { opacity: 0.5; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .home-layout, .post-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .post-grid { grid-template-columns: 1fr; }
  .post-hero { margin: -1.5rem -1.5rem 1.25rem; }
  .home-hero { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .home-hero__ctas { flex-wrap: wrap; }
  .post { padding: 1.5rem; }
  .post-title { font-size: 1.35rem; }
  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--green); padding: 0.75rem 1.25rem; }
  .nav-toggle { display: block; }
  .site-header { position: relative; }
}

/* ── Category pages ──────────────────────────────────────────────────────── */
.category-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--green);
}
.no-posts { color: var(--muted); font-style: italic; }

/* ── Static page layout ───────────────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2rem 0;
}
.page-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  line-height: 1.75;
}
.page-content h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 1rem; }
.page-content h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--border); margin-bottom: 0.75rem; }
.page-content h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.4rem; margin-bottom: 0.5rem; }
.page-content p  { margin-bottom: 0.9rem; }
.page-content ul, .page-content ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.page-content li { margin: 0.35rem 0; }
.page-content a  { color: var(--green); }
.page-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.page-content th, .page-content td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.page-content th { font-weight: 600; font-size: 0.9rem; color: var(--muted); }

/* ── Guide / content page shared classes ─────────────────────────────────── */
.gp, .cp, .mh, .hub, .calc-wrap { max-width: 100%; }

.box, .callout, .calc-box, .calc-callout {
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem;
  margin: 1.1rem 0;
  border-left: 4px solid var(--green);
  background: var(--green-light);
}
.box.blue,  .callout.blue,  .calc-callout.blue  { background: #eff6ff; border-color: #3b82f6; }
.box.green, .callout.green, .calc-callout.green { background: var(--green-light); border-color: var(--green); }
.box.amber, .callout.amber, .calc-callout.amber { background: #fffbeb; border-color: #f59e0b; }
.box.red,   .callout.red                        { background: #fef2f2; border-color: #ef4444; }

.cards, .grid, .calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  background: var(--white);
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.card a, a.card { color: var(--green); font-weight: 600; text-decoration: none; display: block; }
a.card { color: inherit; }
a.card strong { color: var(--green); display: block; margin-bottom: 0.25rem; }
a.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); text-decoration: none; }
.card p { margin: 0.25rem 0 0; font-size: 0.87rem; color: var(--muted); }
.card .tag, .card .badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin-bottom: 0.35rem; background: var(--green-light); color: var(--green); }
.card .icon { font-size: 1.5rem; margin-bottom: 0.35rem; }

.card.blue   { border-top: 3px solid #3b82f6; }
.card.green  { border-top: 3px solid var(--green); }
.card.amber  { border-top: 3px solid #f59e0b; }
.card.red    { border-top: 3px solid #ef4444; }
.card.purple { border-top: 3px solid #8b5cf6; }
.card.teal   { border-top: 3px solid #0d9488; }

.tag.blue   { background: #eff6ff; color: #3b82f6; }
.tag.green  { background: var(--green-light); color: var(--green); }
.tag.purple { background: #f5f3ff; color: #7c3aed; }
.tag.teal   { background: #f0fdfa; color: #0d9488; }

/* Steps (numbered) */
.steps { counter-reset: steps; }
.step  { counter-increment: steps; display: flex; gap: 1rem; margin: 0.9rem 0; }
.step::before {
  content: counter(steps);
  min-width: 2rem; height: 2rem;
  background: var(--green); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; font-size: 0.9rem;
}

/* Mental health crisis box */
.crisis {
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  font-size: 1rem;
  line-height: 1.7;
}

/* ── Calculator styles ────────────────────────────────────────────────────── */
.calc-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.calc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.calc-field label { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.calc-field input, .calc-field select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  width: 100%;
}
.calc-field input:focus, .calc-field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,60,.1);
}
.calc-btn {
  margin-top: 1rem;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.calc-btn:hover { background: var(--green-mid); }

.calc-result {
  display: none;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.calc-result h3 { font-size: 1rem; font-weight: 700; padding: 0.75rem 1rem; background: var(--bg); border-bottom: 1px solid var(--border); margin: 0; }
.result-row { display: flex; justify-content: space-between; padding: 0.5rem 1rem; font-size: 0.92rem; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: none; }
.result-row.total { font-weight: 700; background: var(--green-light); }
.result-row.green { background: var(--green-light); color: var(--green); }
.result-row.red   { color: #ef4444; }
.result-row.amber { color: #b45309; background: #fffbeb; }

.calc-note { font-size: 0.8rem; color: var(--muted); padding: 0.75rem 1rem; border-top: 1px solid var(--border); margin: 0; font-style: italic; }
.calc-box  { background: var(--bg); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0; font-size: 0.92rem; border: 1px solid var(--border); }

@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-content { padding: 1.25rem; }
  .cards, .grid { grid-template-columns: 1fr 1fr; }
  .calc-grid    { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cards, .grid { grid-template-columns: 1fr; }
}
