/* ==========================================================================
   Component · Comparison
   One fixed set of axes for every product, so the table is read as evidence
   rather than as a sales sheet.
   ========================================================================== */

.cmp-cards {
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.75rem;
}

.cmp-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
}

.cmp-card__title {
  font-size: var(--text-label);
  line-height: 1.25;
}

.cmp-card__title a:hover {
  color: var(--color-accent);
}

.cmp-card__body {
  margin-top: 0.7rem;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.cmp-card__link {
  margin-top: 1rem;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-accent);
}

.cmp-summary {
  max-width: 72ch;
  font-size: var(--text-sub);
  color: var(--color-text-secondary);
  line-height: 1.5;
  text-wrap: pretty;
}

/* ---- The two verdict columns --------------------------------------------- */

.verdicts {
  margin-block: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0.75rem;
}

.verdict {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
}

/* The competitor's column is not visually demoted. A comparison that makes its
   "they do better" list look like a warning label is not a comparison. */
.verdict--us {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
}

.verdict__title {
  font-size: var(--text-label);
  line-height: 1.25;
}

.verdict__list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.verdict__list li {
  position: relative;
  padding-inline-start: 1.1rem;
}

.verdict__list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.verdict--us .verdict__list li::before {
  background: var(--color-accent);
}

/* ---- The matrix ---------------------------------------------------------- */

.cmp-table-wrap {
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  overflow-x: auto;
  /* Stops this scroller's layout overflow from reaching the page canvas.
     Without it Chrome grows the initial containing block to the table's full
     width, and a position: fixed nav sizing against `100%` is then wider than
     the screen and centred on the wrong midpoint. `overflow: auto` alone does
     not prevent that; `contain: paint` does. */
  contain: paint;
}

.cmp-table {
  width: 100%;
  /* separate, not collapse: Chrome does not honour `position: sticky` on a
     table cell inside a collapsed-border table, so the pinned first column
     simply scrolled away. With zero spacing and borders only on one edge, it
     renders identically. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-caption);
}

.cmp-table th,
.cmp-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-hairline);
  text-align: start;
}

.cmp-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-weight: 600;
  border-bottom-color: var(--color-border-strong);
  white-space: nowrap;
}

/* AnyTV is the second column and is marked as ours — being explicit about
   whose page this is beats pretending to be a neutral review site. */
.cmp-table thead th:nth-child(2),
.cmp-table td:nth-child(2) {
  background: color-mix(in srgb, var(--color-accent) 6%, transparent);
}

.cmp-table tbody th {
  font-weight: 400;
  color: var(--color-text-secondary);
}

.cmp-table td {
  text-align: center;
}

.cmp-table__group th {
  padding-top: 1.6rem;
  color: var(--color-text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom-color: var(--color-border);
}

.cmp {
  display: inline-block;
}

.cmp--yes {
  width: 17px;
  height: 17px;
  color: var(--color-accent);
}

.cmp--yes svg {
  width: 100%;
  height: 100%;
}

.cmp--no {
  color: var(--color-text-tertiary);
}

.cmp--unknown {
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-tertiary);
  font-size: 0.6875rem;
  line-height: 16px;
  cursor: help;
}

.cmp--text {
  color: var(--color-text-primary);
}

.cmp-note,
.cmp-source {
  margin-top: 1.5rem;
  max-width: 80ch;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  line-height: 1.55;
}

.cmp-source a {
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.cmp-others {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-hairline);
}

.cmp-others h2 {
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-text-tertiary);
}

.cmp-others ul {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cmp-others a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  transition: border-color var(--duration-fast) var(--ease-gentle), color var(--duration-fast) var(--ease-gentle);
}

.cmp-others a:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

/* The matrix is the one table on the site that genuinely needs to scroll on a
   phone: stacking five products per row would be unreadable. The first column
   pins so a row never loses its label. */
@media (max-width: 52em) {
  .cmp-table th:first-child,
  .cmp-table tbody th {
    position: sticky;
    inset-inline-start: 0;
    background: var(--color-bg);
    /* Narrower on a phone. At 11rem the five columns made the table wide
       enough to inflate the page canvas, which a fixed-position nav then sized
       itself against. */
    min-width: min(9rem, 42vw);
  }

  .cmp-table th,
  .cmp-table td {
    padding-inline: 0.7rem;
  }

  /* A group heading spans every column, so pinning it to the left edge means
     nothing. Needs to out-specify the `.cmp-table tbody th` rule above it. */
  .cmp-table tbody tr.cmp-table__group th {
    position: static;
  }
}
