/* ============================================
   Blog articles and statistics components
   Tokens map to the site variables in /assets/global.css
   ============================================ */
:root {
  --sb-dark: var(--navy-deep);
  --sb-primary: var(--navy);
  --sb-primary-2: var(--navy-soft);
  --sb-highlight: var(--blue);
  --sb-gold: var(--gold);
  --sb-positive: var(--success);
  --sb-text: var(--ink);
  --sb-muted: var(--muted);
  --sb-on-dark: var(--white);
  --sb-surface: var(--white);
  --sb-border: var(--line);
  --sb-radius: 18px;
  --sb-shadow: var(--shadow-soft);
}

/* Article body */
.post-body { min-width: 0; }
.post-body > p, .post-body section > p { color: var(--muted); font-size: 17px; line-height: 1.75; }
.post-body section { margin-top: 64px; }
.post-body section:first-of-type { margin-top: 40px; }
.post-body h2 { margin-bottom: 18px; font-size: clamp(28px, 3.6vw, 40px); }
.post-body h3 { margin: 30px 0 12px; font-size: 22px; }
.post-body ul.post-list { padding-left: 20px; color: var(--muted); }
.post-body ul.post-list li { margin-bottom: 8px; }
.post-body a:not(.btn):not(.related-card) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:not(.btn):not(.related-card):hover { color: var(--navy); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 4px; color: #d7e6ef; font-size: 15px; font-weight: 700; }
.post-intro { font-size: clamp(18px, 2vw, 20px) !important; color: var(--ink) !important; }
.post-figure { margin: 34px 0; }
.post-figure img { height: auto; border: 1px solid var(--line); border-radius: var(--sb-radius); box-shadow: var(--sb-shadow); }
.post-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.post-note { margin: 28px 0; padding: 20px 24px; background: var(--soft); border-left: 4px solid var(--accent-text); border-radius: 12px; color: var(--ink); }
.post-note p { margin: 0; }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin: 40px 0; padding: 28px 30px; background: var(--white); border: 1px solid var(--line); border-radius: var(--sb-radius); box-shadow: var(--sb-shadow); }
.post-cta h3 { margin: 0 0 6px; font-size: 24px; }
.post-cta p { margin: 0; color: var(--muted); }
.post-cta .hero-actions { margin: 0; }
.blog-toc-link.is-active { color: var(--accent-text); font-weight: 800; }

/* Hero stats */
.stats-hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 34px 0; }
.stats-hero-card { padding: 24px 16px; text-align: center; color: var(--sb-on-dark); background: linear-gradient(135deg, var(--sb-dark), var(--sb-primary-2)); border-radius: var(--sb-radius); box-shadow: var(--sb-shadow); }
.stats-hero-card__number { margin-bottom: 8px; color: var(--sb-highlight); font-size: clamp(21px, 2.2vw, 27px); white-space: nowrap; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stats-hero-card__label { color: #d7e6ef; font-size: 14px; font-weight: 600; line-height: 1.35; }

/* Key takeaways */
.key-takeaways { margin: 34px 0; padding: 28px; background: var(--white); border: 2px solid var(--sb-border); border-radius: var(--sb-radius); }
.key-takeaways__label { margin-bottom: 14px; padding-bottom: 12px; color: var(--sb-dark); border-bottom: 2px solid var(--sb-border); font-size: 21px; font-weight: 800; }
.key-takeaways__list { margin: 0; padding: 0; list-style: none; counter-reset: takeaway; }
.key-takeaways__list li { position: relative; padding: 11px 0 11px 36px; color: var(--sb-text); line-height: 1.6; border-bottom: 1px solid var(--sb-border); }
.key-takeaways__list li:last-child { border-bottom: 0; }
.key-takeaways__list li::before { position: absolute; top: 13px; left: 0; display: flex; width: 24px; height: 24px; align-items: center; justify-content: center; color: var(--sb-on-dark); background: var(--sb-dark); border-radius: 50%; font-size: 12px; font-weight: 800; content: counter(takeaway); counter-increment: takeaway; }

/* Data tables */
.data-table-wrapper { margin: 26px 0; overflow-x: auto; background: var(--white); border: 1px solid var(--sb-border); border-radius: 14px; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.data-table th { padding: 13px 16px; color: var(--white); background: var(--navy); font-weight: 800; text-align: left; }
.data-table td { padding: 12px 16px; color: var(--ink); border-top: 1px solid var(--sb-border); vertical-align: top; }
.data-table tbody tr:nth-child(even) td { background: #f3f8fc; }
.data-table caption { padding: 12px 16px; color: var(--muted); font-size: 14px; text-align: left; caption-side: bottom; }

/* Stat callout */
.stat-callout { margin: 34px 0; padding: 30px; text-align: center; color: var(--sb-on-dark); background: linear-gradient(135deg, var(--sb-dark), var(--sb-primary-2)); border-radius: var(--sb-radius); }
.stat-callout__number { margin-bottom: 10px; color: var(--sb-gold); font-size: clamp(38px, 6vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-callout__text { max-width: 620px; margin: 0 auto 10px; color: #e3eef6; font-size: 18px; line-height: 1.55; }
.stat-callout__source { color: #c6d9e6; font-size: 14px; font-style: italic; }
.stat-callout__source a { color: #e3eef6 !important; }

/* Horizontal bar chart */
.css-bar-chart { margin: 30px 0; padding: 24px; background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); box-shadow: var(--sb-shadow); }
.css-bar-chart__title { margin-bottom: 18px; color: var(--sb-dark); font-size: 18px; font-weight: 800; text-align: center; }
.css-bar-chart__item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 10px; }
.css-bar-chart__label { color: var(--sb-dark); font-size: 14px; font-weight: 700; text-align: right; }
.css-bar-chart__bar-bg { position: relative; height: 32px; overflow: hidden; background: #e9eff4; border-radius: 6px; }
.css-bar-chart__bar { position: absolute; top: 0; bottom: 0; display: flex; min-width: 8px; align-items: center; justify-content: flex-end; padding-right: 10px; background: linear-gradient(90deg, var(--sb-primary), var(--sb-primary-2)); border-radius: 6px; }
.css-bar-chart__bar--gold { background: var(--sb-gold); }
.css-bar-chart__value { color: var(--sb-on-dark); font-size: 13px; font-weight: 800; white-space: nowrap; }
.css-bar-chart__bar--gold .css-bar-chart__value { color: var(--sb-dark); }
.css-bar-chart__note { margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

/* Comparison cards */
.yoy-compare { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; margin: 30px 0; }
.yoy-compare__card { flex: 1; min-width: 180px; max-width: 280px; padding: 22px; text-align: center; background: var(--white); border: 2px solid var(--sb-border); border-radius: var(--sb-radius); }
.yoy-compare__card--after { border-color: var(--sb-gold); }
.yoy-compare__year { margin-bottom: 8px; color: var(--accent-text); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.yoy-compare__value { margin-bottom: 8px; color: var(--sb-dark); font-size: 30px; font-weight: 800; line-height: 1; }
.yoy-compare__label { color: var(--sb-muted); font-size: 14px; }
.yoy-compare__arrow { color: var(--sb-muted); font-size: 30px; }

/* Methodology */
.methodology { margin: 56px 0 0; padding: 28px; background: var(--white); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); }
.methodology__sources { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 24px; }
.methodology__sources li { padding: 5px 0; font-size: 14px; break-inside: avoid; }

/* Blog index */
.blog-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; color: var(--accent-text); font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.blog-card-image img { aspect-ratio: 1200 / 630; height: auto; }
.blog-card .text-link { color: var(--navy); font-weight: 800; }

@media (max-width: 1020px) {
  .stats-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .css-bar-chart__item { grid-template-columns: 96px minmax(0, 1fr); }
  .methodology__sources { columns: 1; }
  .yoy-compare { flex-direction: column; }
  .yoy-compare__arrow { transform: rotate(90deg); }
  .key-takeaways, .methodology { padding: 22px 18px; }
}

/* Seasonal pest matrix tags */
.pest-matrix td:last-child { min-width: 260px; }
.pest-tag { display: inline-block; margin: 2px 5px 2px 0; padding: 3px 10px; color: var(--navy); background: var(--soft); border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.pest-tag--active { color: var(--white); background: var(--accent-text); }
.pest-tag--peak { color: var(--navy-deep); background: var(--gold); }
