/* A table, because a table is the honest shape for this content and
   because the page needs something that is not a grid of cards here.
   It scrolls sideways on a phone rather than collapsing into cards:
   the whole point is reading the three columns against each other. */

@layer components {
  .compare {
    background: var(--color-surface);
    border-block: 1px solid var(--color-line);
  }

  .compare__title {
    margin-block-start: var(--space-xs);
    font-size: var(--step-3);
    font-weight: 700;
  }

  .compare__scroll {
    margin-block-start: var(--space-xl);
    overflow-x: auto;
  }

  /* Fixed layout: left to itself the first column takes nearly half
     the table on a wide screen and pushes the three answers into a
     huddle on the right, which is the one comparison a visitor is
     here to make. */
  .compare__table {
    inline-size: 100%;
    min-inline-size: 38rem;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: start;
  }

  .compare__table th:first-child {
    inline-size: 34%;
  }

  .compare__table th:not(:first-child) {
    inline-size: 22%;
  }

  .compare__table th,
  .compare__table td {
    padding: var(--space-s) var(--space-m);
    border-block-end: 1px solid var(--color-line);
    text-align: start;
    vertical-align: baseline;
  }

  .compare__table thead th {
    font-family: var(--font-display);
    font-size: var(--step--1);
    font-weight: 700;
    font-stretch: var(--width-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-muted);
    border-block-end-color: var(--color-ink);
  }

  .compare__table tbody th {
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 500;
  }

  .compare__table td {
    font-size: var(--step--1);
    color: var(--color-muted);
  }

  /* The Meatron column is tinted the whole way down, so the eye can
     follow one column instead of hunting for a highlighted cell. */
  .compare__table thead th:last-child,
  .compare__table .is-meatron {
    background: color-mix(in oklch, var(--color-accent) 10%, var(--color-bg));
    color: var(--color-ink);
    font-weight: 600;
  }

  .compare__note {
    max-inline-size: 66ch;
    margin-block-start: var(--space-l);
    font-size: var(--step--1);
    color: var(--color-muted);
  }
}
