/* Place Keeper comparison pages — additions to site.css.
   Same rules as the rest of the marketing site: no border radius, no box
   shadows, structure from 2px rules and flat bands, single breakpoint at 700px.
   Loaded only by docs/compare/**. Generated markup lives in
   scripts/landing/build-comparison-pages.mjs. */

/* ---------- hero ---------- */

/* Breadcrumb, not a kicker: it is the only way back up to the hub from a
   comparison that was landed on directly from search. */
.cmp-crumb {
  padding: 26px 60px 0;
}

.cmp-crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cmp-crumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

.cmp-crumb a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  /* --green-light is only 1.85:1 on paper, which is no underline at all. */
  text-decoration-color: currentColor;
}

.cmp-crumb a:hover {
  color: var(--green);
}

.cmp-crumb [aria-current="page"] {
  color: var(--ink);
}

.cmp-hero {
  padding: 22px 60px 56px;
  max-width: 920px;
}

.cmp-hero h1 {
  margin: 0 0 20px;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Capped in ch, not px: this is the paragraph that decides whether the page
   gets read, and 920px of 19px text runs to about 97 characters a line. */
.cmp-hero .hero__sub {
  margin: 0 0 28px;
  max-width: 66ch;
  font-size: 19px;
  line-height: 1.6;
  color: var(--body-2);
  text-wrap: pretty;
}

.cmp-hero .hero__fine {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--muted-2);
}

/* ---------- side-by-side table ---------- */

.cmp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The bands run full-bleed, so without a cap the comparison cells reach ~120
   characters a line on a wide monitor. */
.cmp-table-wrap {
  overflow-x: auto;
  max-width: 1120px;
  background: var(--panel);
  border: 2px solid var(--ink);
}

.cmp-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  text-align: left;
}

.cmp-table thead th {
  padding: 18px 22px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cmp-table thead th.cmp-table__pk {
  background: var(--green);
}

.cmp-table tbody th {
  width: 22%;
  padding: 18px 22px;
  vertical-align: top;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.cmp-table tbody td {
  width: 39%;
  padding: 18px 22px;
  vertical-align: top;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  /* Prices sit in these cells and should line up down the column. */
  font-variant-numeric: tabular-nums;
}

.cmp-table tbody td.cmp-table__pk {
  background: #f1f7f1;
  color: var(--ink-2);
}

.cmp-table tbody tr + tr th,
.cmp-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}

/* ---------- which one fits you ---------- */

/* These rows carry a single line each, with no <strong> heading above, so the
   offset site.css adds for the second line is not wanted here. */
#fit .rule-row span {
  margin-top: 0;
  color: var(--ink-2);
}

#fit .grid-2,
#questions .grid-2 {
  max-width: 1120px;
}

/* ---------- index cards ---------- */

/* Ten comparisons divide evenly two-up, so no card is ever left stretching
   across a row on its own. The 2px gap over a --line backdrop draws the grid
   rules, keeping the structure in hairlines rather than boxes. */
.cmp-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  max-width: 1180px;
  background: var(--line);
  border: 2px solid var(--ink);
}

.cmp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.cmp-card:hover {
  background: var(--paper-soft);
}

/* Separated from the summary by size, weight and tracking rather than by a
   lighter grey: --muted-2 drops to 4.24:1 against the card's hover fill. */
.cmp-card__cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cmp-card h2,
.cmp-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.cmp-card__sum {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.cmp-card__go {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.cmp-card__go .ms {
  font-size: 18px;
}

/* The one authored moment on these pages: the arrow leans toward the page it
   opens. Everything else stays still. */
@media (prefers-reduced-motion: no-preference) {
  .cmp-card {
    transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .cmp-card__go .ms {
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .cmp-card:hover .cmp-card__go .ms,
  .cmp-card:focus-visible .cmp-card__go .ms {
    transform: translateX(5px);
  }
}

/* ---------- attribution note ---------- */

.cmp-note {
  padding: 34px 60px 56px;
}

/* --muted-3 reaches only 3.78:1 on --paper, so the attribution that carries the
   dated competitor claims takes --muted (5.83:1). */
.cmp-note p {
  margin: 0 0 10px;
  max-width: 78ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.cmp-note a {
  color: var(--green);
  font-weight: 600;
}

@media (max-width: 700px) {
  /* A three-column comparison cannot hold its shape on a phone, and side
     scrolling hides the column the page exists to show. Restack each row as a
     labelled block instead. */
  .cmp-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

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

  .cmp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .cmp-table tbody tr {
    margin-bottom: 18px;
    border: 2px solid var(--ink);
    background: var(--panel);
  }

  .cmp-table tbody tr:last-child {
    margin-bottom: 0;
  }

  /* Sentence case here: these row headings run to 32 characters ("Finding the
     HVAC receipt in 2031"), and all-caps at that length slows reading. */
  .cmp-table tbody th {
    padding: 13px 18px;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
  }

  .cmp-table tbody td {
    padding: 14px 18px 16px;
    font-size: 16px;
  }

  .cmp-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .cmp-table tbody td.cmp-table__pk::before {
    color: var(--green);
  }

  .cmp-table tbody tr + tr th,
  .cmp-table tbody tr + tr td {
    border-top: 0;
  }

  .cmp-table tbody td + td {
    border-top: 1px solid var(--line);
  }

  .cmp-crumb {
    padding: 18px 18px 0;
  }

  .cmp-hero {
    padding: 14px 18px 28px;
  }

  .cmp-hero h1 {
    font-size: 31px;
  }

  .cmp-hero .hero__sub {
    font-size: 17px;
  }

  .cmp-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .cmp-note {
    padding: 24px 18px 40px;
  }
}
