/* ============================================
   Blog + statistics post components
   Tokens map to the site's own 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-positive: var(--success);
  --sb-negative: var(--gold-text);
  --sb-text: var(--ink);
  --sb-muted: var(--muted);
  --sb-on-dark: var(--white);
  --sb-surface: var(--white);
  --sb-border: var(--line);
  --sb-font-heading: var(--font);
  --sb-radius: 18px;
  --sb-shadow: var(--shadow-soft);
}

/* Article body */
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: #cfe0ec; font-size: 14px; font-weight: 700; }
.post-body { font-size: 17px; line-height: 1.75; }
.post-body > p, .post-body section > p { color: var(--ink); }
.post-body h2 { margin: 64px 0 18px; font-size: clamp(30px, 3.6vw, 40px); }
.post-body h3 { margin: 32px 0 12px; font-size: 23px; }
.post-body section:first-of-type h2 { margin-top: 24px; }
.post-body a:not(.btn) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.post-body a:not(.btn):hover { color: var(--navy); }
.post-body ul:not([class]) { padding-left: 22px; }
.post-body ul:not([class]) li { margin-bottom: 8px; }
.post-figure { margin: 36px 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; text-align: center; }
.post-note { padding: 18px 22px; background: var(--soft); border-left: 4px solid var(--navy); border-radius: 12px; color: var(--ink); font-size: 16px; }
.post-cta { margin: 56px 0 0; padding: 36px; background: linear-gradient(135deg, var(--sb-dark), var(--sb-primary-2)); border-radius: 24px; color: var(--white); }
.post-cta h2 { margin: 0 0 12px; color: var(--white); font-size: clamp(28px, 3.4vw, 38px); }
.post-cta p { color: #d6e5ef; }
.post-cta .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Hero stats */
.stats-hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 2rem 0; }
.stats-hero-card { text-align: center; padding: 1.5rem 1rem; background: linear-gradient(135deg, var(--sb-dark), var(--sb-primary-2)); border-radius: var(--sb-radius); color: var(--sb-on-dark); box-shadow: var(--sb-shadow); }
.stats-hero-card__number { font-weight: 800; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1; margin-bottom: .5rem; color: var(--sb-highlight); letter-spacing: -0.03em; }
.stats-hero-card__label { font-size: .875rem; opacity: .9; font-weight: 600; line-height: 1.4; }

/* Key takeaways */
.key-takeaways { background: var(--sb-surface); border: 2px solid var(--sb-border); border-radius: var(--sb-radius); padding: 2rem; margin: 2rem 0; }
.key-takeaways__label { font-weight: 800; font-size: 1.25rem; color: var(--sb-primary); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--sb-border); }
.key-takeaways__list { list-style: none; padding: 0; margin: 0; counter-reset: takeaway; }
.key-takeaways__list li { padding: .7rem 0 .7rem 2.2rem; position: relative; color: var(--sb-text); line-height: 1.6; border-bottom: 1px solid var(--sb-border); font-size: 16px; }
.key-takeaways__list li:last-child { border-bottom: none; }
.key-takeaways__list li::before { counter-increment: takeaway; content: counter(takeaway); position: absolute; left: 0; top: .85rem; width: 24px; height: 24px; border-radius: 50%; background: var(--sb-dark); color: var(--sb-on-dark); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* TOC */
.stats-toc { background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); padding: 1.5rem; margin: 2rem 0; }
.stats-toc__title { font-weight: 800; font-size: 1.125rem; color: var(--sb-primary); margin-bottom: 1rem; }
.stats-toc__list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.stats-toc__item { padding: .4rem 0; break-inside: avoid; }
.post-body .stats-toc__item a { font-size: .95rem; color: var(--sb-primary); text-decoration: none; font-weight: 600; display: flex; align-items: baseline; gap: .5rem; }
.stats-toc__number { font-weight: 700; font-size: .75rem; color: var(--sb-on-dark); background: var(--sb-dark); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Data table */
.data-table-wrapper { margin: 1.75rem 0; overflow-x: auto; border: 1px solid var(--sb-border); border-radius: 14px; background: var(--sb-surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.data-table th { padding: 13px 16px; background: var(--navy); color: var(--white); text-align: left; font-weight: 700; white-space: nowrap; }
.data-table td { padding: 12px 16px; border-top: 1px solid var(--sb-border); vertical-align: top; }
.data-table tbody tr:nth-child(even) td { background: #f3f8fc; }
.data-table td strong { color: var(--navy); }
.post-body .data-table a { font-weight: 600; }
.data-table caption { caption-side: bottom; padding: 10px 16px; color: var(--muted); font-size: 13px; text-align: left; }

/* Stat callout */
.stat-callout { background: linear-gradient(135deg, var(--sb-dark), var(--sb-primary-2)); border-radius: var(--sb-radius); padding: 2rem; margin: 2.25rem 0; text-align: center; color: var(--sb-on-dark); }
.stat-callout__number { font-weight: 800; font-size: clamp(2.4rem, 6vw, 4rem); color: var(--sb-highlight); line-height: 1; margin-bottom: .75rem; letter-spacing: -0.03em; }
.stat-callout__text { font-size: 1.08rem; max-width: 600px; margin: 0 auto .75rem; line-height: 1.6; }
.stat-callout__source { font-size: .875rem; opacity: .75; font-style: italic; }
.post-body .stat-callout a { color: var(--blue); }

/* Bar chart (range bars) */
.css-bar-chart, .css-donut-chart { background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); padding: 1.5rem; margin: 2rem 0; box-shadow: var(--sb-shadow); }
.css-bar-chart__title, .css-donut-chart__title { font-weight: 800; font-size: 1.1rem; color: var(--sb-primary); margin-bottom: 1.25rem; text-align: center; }
.css-bar-chart__item { display: grid; grid-template-columns: 150px 1fr; gap: .75rem; align-items: center; margin-bottom: .7rem; }
.css-bar-chart__label { font-weight: 700; font-size: .875rem; color: var(--sb-primary); text-align: right; line-height: 1.3; }
.css-bar-chart__bar-bg { position: relative; background: var(--soft); border-radius: 6px; height: 32px; }
.css-bar-chart__bar { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--sb-primary-2), var(--sb-primary)); border-radius: 6px; min-width: 8px; }
.css-bar-chart__bar--alt { background: var(--accent); }
.css-bar-chart__bar--gold { background: var(--gold); }
.css-bar-chart__value { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 8px; font-weight: 800; font-size: .85rem; color: var(--sb-primary); white-space: nowrap; }
.css-bar-chart__note { margin-top: .75rem; color: var(--muted); font-size: 13px; text-align: center; }

/* Donut */
.css-donut-chart { text-align: center; }
.css-donut-chart__visual { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto 1.25rem; display: flex; align-items: center; justify-content: center; }
.css-donut-chart__center { width: 120px; height: 120px; border-radius: 50%; background: var(--sb-surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.css-donut-chart__center-value { font-weight: 800; font-size: 1.5rem; color: var(--sb-primary); line-height: 1; }
.css-donut-chart__center-label { font-size: .75rem; color: var(--sb-muted); font-weight: 600; }
.css-donut-chart__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; }
.css-donut-chart__legend-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--sb-text); }
.css-donut-chart__swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* Comparison cards */
.yoy-compare { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin: 2rem 0; flex-wrap: wrap; }
.yoy-compare__card { text-align: center; padding: 1.5rem; border-radius: var(--sb-radius); border: 2px solid var(--sb-border); background: var(--sb-surface); min-width: 180px; flex: 1; max-width: 260px; }
.yoy-compare__card--after { border-color: var(--accent); }
.yoy-compare__year { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; color: var(--accent-text); }
.yoy-compare__value { font-weight: 800; font-size: 1.75rem; color: var(--sb-primary); line-height: 1.1; margin-bottom: .5rem; }
.yoy-compare__label { font-size: .875rem; color: var(--sb-muted); }
.yoy-compare__arrow { font-size: 1.875rem; color: var(--sb-muted); }

/* Methodology */
.methodology { background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); padding: 2rem; margin: 2.5rem 0; }
.post-body .methodology h2 { margin: 0 0 1rem; font-size: 1.6rem; }
.methodology__text { font-size: .95rem; color: var(--sb-muted); margin-bottom: 1rem; line-height: 1.6; }
.methodology__sources { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.methodology__sources li { font-size: .875rem; color: var(--sb-text); padding: .3rem 0; 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; text-transform: uppercase; letter-spacing: .06em; }
.blog-card .text-link { color: var(--navy); font-weight: 800; }
.blog-card .blog-card-image img { height: auto; aspect-ratio: 1200 / 630; }

/* 12-month pest pressure matrix (seasonal calendar posts) */
.pest-matrix { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 3px; font-size: 13px; line-height: 1.3; }
.pest-matrix th, .pest-matrix td { padding: 8px 4px; text-align: center; border-radius: 6px; }
.pest-matrix thead th { background: var(--navy); color: var(--white); font-weight: 800; }
.pest-matrix th[scope="row"] { min-width: 150px; padding: 8px 10px; background: var(--soft); color: var(--navy); font-weight: 800; text-align: left; }
.pest-matrix tr.pm-climate td { background: #f3f8fc; color: var(--ink); font-weight: 700; }
.pest-matrix tr.pm-climate th[scope="row"] { background: #f3f8fc; color: var(--muted); }
.pest-matrix .pm-0 { background: #f3f8fc; color: var(--muted); }
.pest-matrix .pm-1 { background: var(--blue); color: var(--navy); font-weight: 700; }
.pest-matrix .pm-2 { background: var(--accent); color: var(--navy-deep); font-weight: 800; }
.pest-matrix .pm-3 { background: var(--navy-soft); color: var(--white); font-weight: 800; }
.pest-matrix caption { caption-side: bottom; padding: 10px 12px; color: var(--muted); font-size: 13px; text-align: left; }
.pm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 1rem; font-size: 14px; color: var(--muted); }
.pm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pm-legend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }

/* Responsive */
@media (max-width: 900px) {
  .stats-hero-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .post-body { font-size: 16px; }
  .css-bar-chart__item { grid-template-columns: 100px 1fr; }
  .stats-toc__list, .methodology__sources { columns: 1; }
  .yoy-compare { flex-direction: column; }
  .yoy-compare__card { max-width: none; width: 100%; }
  .yoy-compare__arrow { transform: rotate(90deg); }
  .key-takeaways, .methodology { padding: 1.4rem; }
  .post-cta { padding: 26px; }
}
@media (max-width: 480px) {
  .stats-hero-grid { grid-template-columns: 1fr; }
  .css-bar-chart__item { grid-template-columns: 82px 1fr; }
}
