/* Solo Built Tools — plain static CSS, no framework.
   Breakpoints checked by static review: 375px (small phone), 768px (tablet), 1280px (desktop).
   Base font >= 16px; tap targets >= 44px; pricing tables reflow to stacked blocks under 640px
   instead of relying on horizontal scrolling (site-build-spec-v1.md §5). */

:root {
  --ink: #1a1d21;
  --muted: #5a6270;
  --accent: #0b5cad;
  --accent-dark: #084a8a;
  --bg: #ffffff;
  --panel: #f4f6f8;
  --line: #d8dde3;
  --warn-bg: #fdf6e3;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--accent); }
a:hover, a:focus { color: var(--accent-dark); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }

main { padding: 28px 0 48px; }
article { max-width: 760px; }
article.wide { max-width: 100%; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 36px 0 10px; }
h3 { font-size: 1.15rem; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 1.4em; }
li { margin-bottom: 6px; }
.lede { font-size: 1.125rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- components ---------- */
.disclosure, .method-note {
  background: var(--warn-bg);
  border: 1px solid #eadfae;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 18px;
  font-size: 0.9375rem;
}
.method-note { background: var(--panel); border-color: var(--line); }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 20px 0; }
.card {
  border: 1px solid var(--line); border-radius: 10px; padding: 18px;
  background: var(--bg);
}
.card h3 { margin-top: 0; }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* Affiliate CTA buttons: same look in tables and at article end (spec §5). */
.aff-btn {
  display: inline-block;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 12px 20px; border-radius: 8px; font-weight: 600;
  min-height: 44px; line-height: 1.2;
}
.aff-btn:hover, .aff-btn:focus { background: var(--accent-dark); color: #fff; }
.aff-placeholder {
  display: inline-block; border: 2px dashed var(--muted); color: var(--muted);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; background: #fff;
}

/* ---------- tables ---------- */
.table-wrap { margin: 16px 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
th, td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
thead th { background: var(--panel); }
tbody th { background: #fafbfc; font-weight: 600; }

/* ---------- patterns adopted from top comparison sites (design-reference-v1.md) ---------- */
/* Byline + checked date directly under the title (pattern: ToolsGavel "Last verified",
   AudienceBench checked-date line, Zapier year-tagged titles). */
.byline { color: var(--muted); font-size: 0.9375rem; margin: -4px 0 18px; }
.byline strong { color: var(--ink); }

/* Quick picks verdict box right after the method note (pattern: AudienceBench "Quick picks",
   Zapier "at a glance" intro). Our own wording; figures repeat the article's checked data. */
.verdict-box {
  border: 2px solid var(--accent); border-radius: 10px; padding: 16px 18px; margin: 0 0 22px;
  background: #f2f7fc;
}
.verdict-box h2 { margin: 0 0 8px; font-size: 1.2rem; }
.verdict-box ul { margin-bottom: 10px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 6px; }
.cta-row .sep { color: var(--muted); }

/* On-page table of contents (pattern: Zapier "Table of contents"). */
.toc {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 14px 18px; margin: 0 0 22px; font-size: 0.9375rem;
}
.toc h2 { font-size: 1rem; margin: 0 0 6px; }
.toc ol { margin: 0; }
.toc li { margin-bottom: 3px; }

/* Zebra striping for comparison tables (pattern: Fit Small Business / First Reviewers tables). */
table tbody tr:nth-child(even) td { background: #fafbfc; }
table tbody tr:nth-child(even) th { background: #f1f4f7; }

/* "Best for" tag on cards and picks (pattern: Fit Small Business / First Reviewers labels). */
.best-for {
  display: inline-block; font-size: 0.8125rem; font-weight: 700; color: var(--accent-dark);
  background: #e8f1fa; border-radius: 999px; padding: 2px 10px; margin-bottom: 8px;
}

/* Thumbnail-style hero image at the top of every article (template A-9).
   Source PNGs are 1280x720 (16:9) in assets/heroes/. */
.article-hero { margin: 0 0 20px; }
.article-hero img { display: block; width: 100%; height: auto; border-radius: 10px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 26px 0 40px; }
.site-footer .wrap { display: block; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.footer-nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.footer-nav a:hover { text-decoration: underline; color: var(--accent); }

/* ---------- consent banner (Consent Mode v2, spec §4) ---------- */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #14181d; color: #f2f4f6; padding: 16px 20px;
  display: none;
}
.consent-banner.is-visible { display: block; }
.consent-banner .inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.consent-banner p { margin: 0; flex: 1 1 320px; font-size: 0.9375rem; }
.consent-banner a { color: #9ec7ee; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
  padding: 12px 18px; min-height: 44px; border: 1px solid transparent;
}
.consent-accept { background: var(--accent); color: #fff; }
.consent-decline { background: transparent; color: #f2f4f6; border-color: #6b7684; }

/* ---------- responsive ---------- */
/* 768px and up (tablet / small desktop) */
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2.4rem; }
}

/* 1280px desktop: container already capped at 1080px; extra breathing room */
@media (min-width: 1280px) {
  main { padding-top: 36px; }
}

/* Under 640px (covers the 375px check width): pricing/comparison tables stack. */
@media (max-width: 639px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  table.stack, table.stack thead, table.stack tbody, table.stack tr, table.stack th, table.stack td {
    display: block; width: 100%;
  }
  table.stack thead { position: absolute; left: -9999px; top: -9999px; }
  table.stack tr { border: 1px solid var(--line); margin-bottom: 12px; }
  table.stack th, table.stack td { border: none; border-bottom: 1px solid var(--line); }
  table.stack tr > *:last-child { border-bottom: none; }
  table.stack td::before, table.stack tbody th::before {
    content: attr(data-label); display: block; font-weight: 700; color: var(--muted);
    font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 2px;
  }
}
