/* The comparison pages (src/compare.mjs, public/compare.js). Loaded on those
   pages only, after styles.css: the breadcrumbs, the hairline lists
   (.why-list), the FAQ, the chips and the call to action are the site's
   own; this file adds the two columns of the short answer, the comparison
   tables (one card per row on a phone), the checklist and the prompt. */

.compare-wrap {
  max-width: 1000px;
}

.compare-page .section-intro {
  max-width: 68ch;
}

.compare-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0 0;
  font-size: 0.94rem;
}

.compare-toc a {
  color: var(--ink-2);
}

.compare-toc a:hover {
  color: var(--accent);
}

.compare-block {
  margin-top: clamp(48px, 7vw, 80px);
  scroll-margin-top: 88px;
}

.compare-block > h2:first-child {
  margin-top: 0;
}

/* The short answer: a general chatbot, then this service. */
.compare-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--s-5) clamp(24px, 4vw, 56px);
  margin-top: var(--s-5);
}

.compare-col {
  border-top: 1px solid var(--line-strong);
  padding-top: var(--s-4);
}

.compare-col.is-ours {
  border-top-color: var(--accent);
}

.compare-col h3 {
  margin: 0 0 var(--s-3);
}

.compare-kind {
  margin: var(--s-2) 0 0;
}

/* The tables. */
.compare-table-wrap {
  margin: var(--s-5) 0 var(--s-3);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  line-height: 1.5;
}

.compare-table caption {
  text-align: left;
  font: 600 0.74rem/1.5 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: var(--s-2);
}

.compare-table th,
.compare-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.compare-table thead th {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom-color: var(--line-strong);
}

.compare-table tbody th {
  font-weight: 600;
  width: 22%;
}

.compare-table .is-ours {
  background: var(--accent-soft);
}

.compare-table thead .is-ours {
  color: var(--ink);
}

/* On a phone every row is a card: the row's name, then each cell under its
   column's name (data-label). */
@media (max-width: 760px) {
  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
    width: auto;
  }

  /* A block table would otherwise wrap its caption in a narrow anonymous table. */
  .compare-table caption {
    display: block;
    width: 100%;
  }

  .compare-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    margin-bottom: var(--s-3);
    overflow: hidden;
  }

  .compare-table tbody th {
    width: auto;
    font-size: 1.02rem;
    border-bottom-color: var(--line-strong);
  }

  .compare-table td {
    border-bottom: 1px solid var(--line);
  }

  .compare-table td:last-child {
    border-bottom: 0;
  }

  .compare-table td::before {
    content: attr(data-label);
    display: block;
    font: 600 0.72rem/1.5 var(--sans);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 2px;
  }
}

/* The checklist and the prompt. */
.compare-prose {
  max-width: 72ch;
}

.compare-checklist {
  padding-left: 1.4em;
}

.compare-checklist li {
  margin-bottom: 0.7em;
  padding-left: 0.2em;
}

.compare-prompt {
  margin: var(--s-3) 0 var(--s-5);
}

.compare-prompt pre {
  margin: 0 0 var(--s-3);
  padding: var(--s-4) clamp(16px, 3vw, 24px);
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font: 0.94rem/1.65 var(--sans);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compare-note {
  margin-top: var(--s-5);
  max-width: 72ch;
}

.compare-more {
  margin-top: var(--s-3);
}

@media print {
  .compare-toc,
  .compare-prompt .actions,
  .cta-band {
    display: none;
  }
}
