/* =============================================================================
   article.css - migrated blog articles, calculators and the /blog index.
   Loaded after site.css on those pages only. Uses site.css tokens.
   ============================================================================= */

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

/* ---------- Article hero ---------- */

.hero .eyebrow a { color: var(--sky); text-decoration: none; }
.hero .eyebrow a:hover { text-decoration: underline; }
.article-meta { margin-top: 16px; }

/* ---------- Prose column (max 760px, 18px / 1.6) ---------- */

.prose--article { font-size: 18px; line-height: 1.6; color: var(--body); }
.prose--article > h2 { font-size: clamp(26px, 2.4vw, 30px); }
.prose--article > h3 { font-size: clamp(20px, 1.8vw, 22px); }
.prose--article h4, .prose--article h5 { font-size: 18px; line-height: 1.4; color: var(--navy); }
.prose--article > h2, .prose--article > h3 { scroll-margin-top: 96px; }
.prose--article strong { color: var(--navy); }
.prose--article ul { list-style: disc; }
.prose--article ol { list-style: decimal; }
.prose--article li > ul, .prose--article li > ol { margin-top: 0.5em; }
.prose--article li::marker { color: var(--muted); }
.prose--article code {
  padding: 2px 6px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--navy);
}

.prose--article blockquote {
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--sky);
  color: var(--navy);
}
.prose--article blockquote > * + * { margin-top: 0.8em; }

.prose--article figure { margin-top: 1.6em; margin-bottom: 1.6em; }
.prose--article figure img { width: 100%; height: auto; border-radius: var(--radius); }
.prose--article figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}
.prose--article figcaption p { max-width: none; }
.prose--article .article-figure { margin-top: 0; }

/* Tables scroll inside their own region so the page never overflows */
.table-scroll {
  margin-top: 1.4em;
  margin-bottom: 1.4em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-scroll:focus-visible { outline-offset: 0; }
.table-scroll table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}
.table-scroll th, .table-scroll td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table-scroll th { background: var(--cream); color: var(--navy); font-weight: 600; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }

/* ---------- Author box ---------- */

.author-box {
  max-width: var(--prose);
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.author-box__name { font-weight: 700; color: var(--navy); }

/* ---------- /blog index ---------- */

.post-list { list-style: none; margin: 0; padding: 0; max-width: var(--prose); }
.post-list > li { padding-block: 28px; border-top: 1px solid var(--line); }
.post-list > li:first-child { border-top: 0; padding-top: 0; }
.post-list h2 { font-size: clamp(20px, 2vw, 24px); line-height: 1.3; letter-spacing: -0.2px; }
.post-list h2 a { color: var(--navy); text-decoration: none; }
.post-list h2 a:hover { color: #0369A1; text-decoration: underline; }
.post-list__date { margin-top: 6px; }
.post-list__excerpt { margin-top: 10px; }

/* ---------- Calculators ---------- */

.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 24px; }
@media (min-width: 900px) {
  .tool-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
}
.tool-card { padding: 24px; }
@media (min-width: 640px) { .tool-card { padding: 32px; } }
.tool-card > h2, .tool-results > h2 { font-size: 24px; margin-bottom: 4px; }
.tool-card .form-field:last-of-type { margin-bottom: 0; }
.tool-card h2 + * , .tool-results h2 + * { margin-top: 16px; }
.tool-card h3 { margin-top: 28px; font-size: 20px; }
.tool-card h3 + .form-field, .tool-card h3 + * { margin-top: 12px; }

.tool-fields { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 20px; }
@media (min-width: 640px) { .tool-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.stat__label { font-size: var(--fs-small); line-height: 1.4; color: var(--muted); }
.stat__value {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat__value--good { color: var(--ok-text); }
.stat__value--bad { color: var(--err); }

.tool-note {
  margin-top: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.tool-note h3 { font-size: 18px; margin-bottom: 8px; }
.tool-note ul { padding-left: 1.3em; list-style: disc; }
.tool-note li + li { margin-top: 6px; }
.tool-note p { max-width: none; }
.tool-note--good { background: var(--ok-bg); border-color: #86EFAC; color: var(--ok-text); }
.tool-note--good h3 { color: var(--ok-text); }
.tool-note--warn { background: #FEF3C7; border-color: #FCD34D; color: #78350F; }
.tool-note--warn h3 { color: #78350F; }

.tool-actions { margin-top: 24px; }
.tool-errors { margin-top: 16px; }

.result-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.result-table-wrap:focus-visible { outline-offset: 0; }
.result-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.result-table caption { padding: 12px 14px; text-align: left; font-weight: 600; color: var(--navy); }
.result-table th, .result-table td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.result-table thead th { background: var(--cream); color: var(--navy); font-weight: 600; }
.result-table td.num, .result-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.sort-btn::after { content: "\2195"; color: var(--muted); font-weight: 400; }
th[aria-sort="ascending"] .sort-btn::after { content: "\2191"; color: #0369A1; }
th[aria-sort="descending"] .sort-btn::after { content: "\2193"; color: #0369A1; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent;
}
.badge--hot { background: var(--err-bg); color: var(--err-text); border-color: #FCA5A5; }
.badge--warm { background: #FEF3C7; color: #78350F; border-color: #FCD34D; }
.badge--cold { background: #E0F2FE; color: #0C4A6E; border-color: #7DD3FC; }
.badge--bad { background: var(--err-bg); color: var(--err-text); border-color: #FCA5A5; }
.badge--ok { background: var(--ok-bg); color: var(--ok-text); border-color: #86EFAC; }

.lead-block .tool-fields { padding-bottom: 8px; }

fieldset.lead-block, fieldset.period-block { margin: 0; padding: 0; border: 0; min-width: 0; }
.period-block + .period-block { margin-top: 8px; }
#lead-form, #pipe-form { margin-top: 24px; }
.tool-results:empty { display: none; }
.tool-results:not(:empty) { margin-top: 32px; }
.tool-results:focus { outline: none; }
.tool-card .accordion { margin-top: 16px; max-width: none; }
.tool-card .fine-print { max-width: none; }
.result-table--compact { min-width: 0; font-size: 15px; }
.result-table--compact th, .result-table--compact td { padding: 10px 8px; }
.result-table--compact .badge { display: block; width: fit-content; margin-top: 4px; margin-left: auto; font-size: 12.5px; padding: 0 8px; }

/* Heading-order fixes: intro headings promoted h3 -> h2 keep their original h3 appearance. */
.prose--article > h2.h3-style { font-size: clamp(20px, 1.8vw, 22px); line-height: 1.3; letter-spacing: normal; margin-top: 1.6em; }
/* Legacy editor marker formerly an h6; paragraph with matching appearance so it no longer breaks heading order. */
.prose--article > p.prose-marker { font-size: 0.67em; line-height: 1.6; font-weight: 700; margin: 1em 0 2.33em; }
