/* Comparison cluster (/vs/*) + company pages (/about/, /press/, /support/).
   Loaded via `extraCss` on four templates. Tokens only — no literal colours,
   no @import, no external requests, light-only (main.css declares the scheme).

   Naming: .vs-* = comparison pages, .co-* = company pages. Everything else is
   reused from main.css (.card, .chip, .btn, .badges, .app-cta, .breadcrumbs). */

/* ========================================================================
   1. Shared page furniture
   ======================================================================== */

.vs-page,
.co-page {
  max-width: 60rem;
  margin-inline: auto;
}

.vs-header,
.co-header {
  margin-bottom: 32px;
}

.vs-header h1,
.co-header h1 {
  margin-bottom: .4em;
}

/* The verdict/lede is the answer-first block: larger than body, ink-coloured,
   and short enough to stay in the first screenful on a 360px phone. */
.vs-verdict,
.co-lede {
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 42rem;
}

.vs-page section,
.co-page section {
  margin-top: 48px;
}

.vs-page section:first-of-type,
.co-page section:first-of-type {
  margin-top: 32px;
}

.vs-page h2,
.co-page h2 {
  margin-top: 0;
}

/* ========================================================================
   2. Comparison matrix
   ======================================================================== */

.vs-matrix-card {
  scroll-margin-top: 80px;
}

/* Wide tables scroll inside their own box; the page body never scrolls
   sideways. Keyboard-reachable so the scroll region is not a mouse trap. */
.vs-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vs-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  min-width: 34rem;
}

.vs-matrix-duo {
  min-width: 30rem;
}

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

.vs-matrix thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  border-bottom-width: 2px;
}

.vs-matrix tbody th {
  color: var(--ink);
  font-weight: 600;
  width: 11rem;
}

.vs-matrix tbody tr:last-child :is(th, td) {
  border-bottom: none;
}

/* Our column is tinted, not shouted. */
.vs-matrix .vs-col-us {
  background: var(--leaf-tint);
  color: var(--ink);
}

.vs-matrix thead .vs-col-us {
  color: var(--accent-deep);
}

.vs-matrix-duo tbody .vs-col-us {
  width: 40%;
}

/* A cell where the competitor genuinely wins. The mark is a leaf rule, never a
   colour-only signal — the wording in the cell carries the meaning on its own. */
.vs-matrix .vs-win {
  box-shadow: inset 3px 0 0 var(--leaf);
  color: var(--ink);
  font-weight: 500;
}

.vs-cell-link {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.vs-table-note {
  font-size: .8125rem;
  color: var(--text-muted);
  max-width: 46rem;
  margin-top: 16px;
}

.vs-matrix-card .vs-table-note:first-of-type {
  margin-top: 0;
  margin-bottom: 16px;
}

/* ========================================================================
   3. Comparison prose blocks
   ======================================================================== */

.vs-short ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.vs-short li {
  position: relative;
  padding-left: 26px;
  max-width: 46rem;
}

.vs-short li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 10px;
  height: 10px;
  border-radius: var(--r-round);
  background: var(--leaf);
}

/* Conceding section — visually distinct so a skim-reader cannot miss that we
   put their wins above ours. */
.vs-concede {
  border-left: 3px solid var(--leaf);
  padding-left: 20px;
}

.vs-concede h2 {
  color: var(--accent-deep);
}

.vs-diff + .vs-diff {
  margin-top: 28px;
}

.vs-diff h3 {
  margin-bottom: .35em;
}

.vs-who-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.vs-who-col h3 {
  margin-top: 0;
}

.vs-who-col ul {
  margin: 0;
  padding-left: 1.1em;
}

.vs-who-col li + li {
  margin-top: .5em;
}

.vs-who-us {
  border-color: var(--leaf);
  background: var(--surface);
}

.vs-closing {
  margin-top: 24px;
  max-width: 46rem;
}

.vs-method p {
  max-width: 46rem;
  font-size: .9375rem;
}

.vs-disclaimer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
  color: var(--text);
  max-width: 46rem;
}

/* ========================================================================
   4. Comparison cards (hub grid + "other comparisons" rail)
   ======================================================================== */

.vs-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.vs-card {
  display: grid;
  gap: 6px;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  padding: 20px;
  text-decoration: none;
  transition: box-shadow 150ms var(--ease), transform 150ms var(--ease);
}

.vs-card:hover {
  box-shadow: var(--shadow-m);
  transform: translateY(-2px);
}

.vs-card-kicker {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.vs-card-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}

.vs-card-line {
  font-size: .875rem;
  color: var(--text);
}

/* ========================================================================
   5. Company pages — about
   ======================================================================== */

.co-body p,
.co-usage li,
.co-review p,
.co-legal p {
  max-width: 42rem;
}

.co-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.co-fact {
  display: grid;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  padding: 20px;
}

/* Large display numerals are the one place --leaf is allowed to carry glyphs
   (design_visual §1.1: ≥32px bold only). */
.co-fact-v {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--leaf);
  font-variant-numeric: tabular-nums;
}

.co-fact-l {
  font-size: .8125rem;
  color: var(--text-muted);
}

.co-beliefs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.co-belief h3 {
  margin-top: 0;
}

.co-belief p {
  margin-bottom: 0;
}

.co-maker p:last-child {
  margin-bottom: 0;
}

.co-maker .btn {
  margin-top: 8px;
}

.co-note {
  font-size: .8125rem;
  color: var(--text-muted);
}

.co-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

/* ========================================================================
   6. Company pages — press
   ======================================================================== */

.co-boiler-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.co-boiler-grid h3 {
  margin-top: 0;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Boilerplate is meant to be selected and pasted, so it reads as a quotable
   block rather than as body copy. */
.co-quote {
  color: var(--ink);
  margin-bottom: 0;
  max-width: none;
  user-select: all;
}

.co-facts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  min-width: 24rem;
}

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

.co-facts-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .8125rem;
  width: 12rem;
}

.co-facts-table td {
  color: var(--ink);
}

.co-facts-table tr:last-child :is(th, td) {
  border-bottom: none;
}

.co-facts-table code {
  font-size: .875rem;
  background: var(--surface-alt);
  border-radius: var(--r-s);
  padding: 1px 6px;
}

.badges-left {
  justify-content: flex-start;
  margin-bottom: 0;
}

.co-shots {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.co-shot {
  display: grid;
  gap: 8px;
}

.co-shot img {
  width: 100%;
  height: auto;
  border-radius: var(--r-l);
  box-shadow: var(--shadow-m);
  background: var(--surface-alt);
}

.co-shot-caption {
  font-size: .8125rem;
  color: var(--text);
}

.co-icon-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.co-icon {
  border-radius: var(--r-l);
  box-shadow: var(--shadow-s);
}

.co-icon-row p {
  margin-bottom: 0;
  font-size: .875rem;
  color: var(--text);
}

/* ========================================================================
   7. Company pages — support / FAQ
   ======================================================================== */

.co-faq {
  display: grid;
  gap: 12px;
  max-width: 46rem;
}

.co-faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  padding: 4px 20px;
}

.co-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 28px 14px 0;
  position: relative;
  font-weight: 600;
  color: var(--ink);
}

.co-faq-item summary::-webkit-details-marker {
  display: none;
}

/* CSS-only chevron: two borders rotated. No icon font, no SVG request. */
.co-faq-item summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 1.35em;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
  transition: transform 150ms var(--ease);
}

.co-faq-item[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}

.co-faq-item p {
  margin: 0 0 16px;
  max-width: none;
}

.co-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-weight: 500;
}

/* ========================================================================
   8. Breakpoints
   ======================================================================== */

@media (min-width: 700px) {
  .vs-who-grid,
  .co-boiler-grid {
    grid-template-columns: 1fr 1fr;
  }

  .co-beliefs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .vs-matrix {
    font-size: 1rem;
  }
}

/* de/fr/nl run 30–35% longer than en; CJK rows are short but dense. Both keep
   the first matrix column from collapsing to one word per line. */
.lang-de .vs-matrix tbody th,
.lang-fr .vs-matrix tbody th,
.lang-nl .vs-matrix tbody th,
.lang-de .co-facts-table th,
.lang-fr .co-facts-table th,
.lang-nl .co-facts-table th {
  width: 13rem;
}

.lang-ja .co-facts-table th,
.lang-ko .co-facts-table th,
.lang-zh .co-facts-table th {
  width: 10rem;
}

/* CJK body copy is set at 1.9 line-height sitewide; the tightened lede would
   otherwise crowd the glyphs. */
.lang-ja .co-lede,
.lang-ko .co-lede,
.lang-zh .co-lede {
  line-height: 1.8;
}

@media print {
  .vs-cards,
  .co-shots,
  .co-links,
  .co-actions {
    display: none !important;
  }

  .vs-matrix-wrap {
    overflow: visible;
  }

  .vs-matrix .vs-col-us {
    background: none;
    box-shadow: inset 3px 0 0 currentColor;
  }
}

/* Hub-only "what we found" block: same measure as the methodology prose. */
.vs-findings p {
  max-width: 46rem;
}

/* Below 700px the two-column matrix hid the competitor column entirely and cut
   the Teafinity column mid-word. Stack each row into a labelled card instead;
   the source stays a real <table> so the semantics and the desktop layout are
   untouched. */
@media (max-width: 700px) {
  .vs-matrix-wrap:has(.vs-matrix) { overflow-x: visible; }
  .vs-matrix, .vs-matrix-duo { min-width: 0; width: 100%; display: block; }
  .vs-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .vs-matrix tbody, .vs-matrix tr, .vs-matrix :is(th, td) { display: block; width: auto; }
  .vs-matrix tr {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-m); padding: 14px 16px; margin-bottom: 12px;
  }
  .vs-matrix tbody :is(th, td) { border: none; padding: 0; }
  /* .vs-matrix-duo tbody .vs-col-us sets width:40% for the desktop two-column
     layout and out-specifies the generic width:auto above, which kept the
     tinted cell at column width and wrapped its text into a narrow ribbon. */
  .vs-matrix-duo tbody .vs-col-us, .vs-matrix tbody .vs-col-us { width: auto; }
  .vs-matrix tbody .vs-col-us { background: none; box-shadow: inset 3px 0 0 var(--leaf); padding-left: 12px; }
  .vs-matrix tbody th { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
  .vs-matrix tbody td { padding-top: 8px; }
  .vs-matrix tbody td::before {
    content: attr(data-col);
    display: block; font-size: .75rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 2px;
  }
}
