/* Visual layer for the programmatic SEO pages (comparisons, guides, tools, templates).
   Built on the tokens in site.css. One memorable element: ledger lists, whose dotted leaders
   echo a bookkeeping ledger. Everything else stays quiet. */

/* ---------- Document layout ---------- */
.section.doc {
  padding: 48px 0 56px;
}
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}
.doc-grid.has-toc {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 64px;
}
.doc-main {
  max-width: 760px;
}

.doc-sec {
  margin: 0 0 44px;
  scroll-margin-top: 96px;
}
.doc-sec:last-child {
  margin-bottom: 0;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
.doc-head h2 {
  max-width: none;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.chip {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--brand);
  background: var(--mint);
  border: 1px solid var(--mint-2);
  border-radius: 12px;
}

.doc-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
}
.doc-body p {
  margin: 0 0 16px;
}
.doc-body p:last-child {
  margin-bottom: 0;
}
.doc-body strong {
  color: var(--ink);
}
.doc-body a {
  color: var(--brand);
  font-weight: 650;
}
.doc-body > * + * {
  margin-top: 16px;
}

/* ---------- Lists ---------- */
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.checks li {
  position: relative;
  padding-left: 32px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mint)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23216f57' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}
.steps li {
  position: relative;
  counter-increment: step;
  min-height: 52px;
  padding: 14px 18px 14px 66px;
  color: var(--ink);
  line-height: 1.6;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 46px;
  bottom: -15px;
  width: 2px;
  background: var(--mint-2);
}

/* The ledger: label ....... amount */
.ledger {
  margin: 0;
  padding: 8px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.ledger > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
}
.ledger dt {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
}
.ledger dt::after {
  content: "";
  flex: 1;
  min-width: 16px;
  border-bottom: 2px dotted #b4cfc1;
  transform: translateY(-4px);
}
.ledger dd {
  margin: 0;
  font-weight: 750;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger .sum {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}
.ledger .sum dt {
  font-weight: 800;
}
.ledger .sum dt::after {
  border-bottom-color: transparent;
}
.ledger .sum dd {
  font-size: 1.08em;
  color: var(--brand-d);
}

/* ---------- Section tones ---------- */
.tone-warn .doc-body {
  padding: 20px 24px;
  background: #fff8e8;
  border: 1px solid #f0dba8;
  border-left: 4px solid var(--amber);
  border-radius: var(--r-md);
}
.tone-warn .chip {
  color: #8a5b00;
  background: #fdeec8;
  border-color: #f0dba8;
}
.tone-warn .checks li::before {
  background-color: #fdeec8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5b00' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18h.01'/%3E%3C/svg%3E");
}
.tone-example .doc-body {
  padding: 22px 24px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgb(33 111 87 / 7%) 31px 32px), #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.tone-example .ledger {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* ---------- On this page ---------- */
.doc-toc {
  position: sticky;
  top: 96px;
  padding: 20px 22px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.doc-toc p {
  margin: 0 0 12px;
  font-weight: 750;
  color: var(--ink);
}
.doc-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.doc-toc a {
  display: block;
  padding: 6px 10px;
  margin: 0 -10px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}
.doc-toc a:hover {
  color: var(--brand-d);
  background: var(--mint);
}

/* ---------- Cards ---------- */
.card.has-icon {
  display: grid;
  align-content: start;
  gap: 4px;
}
.card.has-icon .chip {
  margin-bottom: 14px;
}
.card.has-icon h3 {
  margin-bottom: 6px;
}
.card.has-icon p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.card.related {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
}
.card.related h3 {
  margin: 0;
  font-size: 17px;
}
.card.related h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card.related .go {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--brand);
  background: var(--mint);
  border-radius: 50%;
  transition: transform 0.15s;
}
.card.related:hover .go {
  transform: translateX(3px);
}

/* ---------- Hero chips ---------- */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-trust svg {
  color: var(--brand-l);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .doc-grid.has-toc {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-toc {
    display: none;
  }
}
@media (max-width: 560px) {
  .section.doc {
    padding: 32px 0 40px;
  }
  .doc-body {
    font-size: 16px;
  }
  .doc-head {
    gap: 12px;
  }
  .chip {
    width: 36px;
    height: 36px;
  }
  .steps li {
    padding: 14px 14px 14px 58px;
  }
  .steps li::before {
    left: 12px;
  }
  .steps li:not(:last-child)::after {
    left: 27px;
  }
  .tone-warn .doc-body,
  .tone-example .doc-body {
    padding: 16px 16px;
  }
  .ledger {
    padding: 6px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card.related .go {
    transition: none;
  }
}
