/* ──────────────────────────────────────────────────────────────────────────
   House comparison table (.cmp)

   The card-style comparison used across the /vs-* pages, extracted here so it
   lives in ONE place instead of being pasted inline into every page.

   Rendered by includes/_compare-render.php — see the `compare-shortcode` site
   block. Column count is driven by --cmp-tpl set inline on .cmp by the
   renderer (repeat() with a var() count is not reliable across engines).
   ────────────────────────────────────────────────────────────────────────── */

.cmp {
  --cmp-tpl: minmax(150px, 1.6fr) 1fr 1fr;
  max-width: 900px;
  margin: 2.5rem auto 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.cmp-scroll { overflow-x: auto; }

.cmp-head,
.cmp-row { display: grid; grid-template-columns: var(--cmp-tpl); }

.cmp-head { border-bottom: 1px solid var(--border); }
/* flex-start so a corner label sits on the same line as the column names —
   the header block is taller than the label because the featured column
   carries a CTA button. */
.cmp-corner { padding: 1.25rem 1rem; display: flex; align-items: flex-start; }
/* Some source tables name the first column ("Capability", "Task", "Feature"). */
.cmp-corner-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); padding-top: 4px;
}
.cmp-col { padding: 1.25rem 1rem 1.4rem; text-align: center; }
.cmp-col-feat { background: rgba(217,119,87,0.06); border-top: 3px solid var(--cyan); }

.cmp-plan {
  font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem;
  color: var(--text); letter-spacing: -0.01em;
}
.cmp-plan-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.cmp-cta {
  display: inline-block; margin-top: 0.8rem; padding: 7px 18px; border-radius: 8px;
  background: var(--cyan); color: #fff !important; font-size: 0.78rem; font-weight: 600;
  text-decoration: none !important; transition: background 0.2s;
}
.cmp-cta:hover { background: var(--cyan-dark); }

.cmp-group { border-bottom: 1px solid var(--border); }
.cmp-group:last-child { border-bottom: none; }

.cmp-grouphead {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.02); border: none; cursor: pointer;
  padding: 0.75rem 1.25rem; font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  text-align: left; transition: color 0.2s;
}
.cmp-grouphead:hover { color: var(--text-secondary); }
.cmp-grouphead:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.cmp-chev { width: 11px; height: 11px; transition: transform 0.25s ease; flex-shrink: 0; }
.cmp-group.collapsed .cmp-chev { transform: rotate(-90deg); }
.cmp-group.collapsed .cmp-rows { display: none; }

.cmp-row { border-top: 1px solid var(--border); }
.cmp-rows .cmp-row:first-child { border-top: none; }
.cmp-group:first-child > .cmp-rows > .cmp-row:first-child { border-top: none; }

.cmp-label {
  padding: 0.9rem 1.25rem; font-size: 0.9rem; color: var(--text);
  display: flex; align-items: center; gap: 7px; line-height: 1.4;
}
.cmp-val {
  padding: 0.9rem 1rem; text-align: center; font-size: 0.86rem; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; line-height: 1.4;
}
.cmp-val.cmp-feat { background: rgba(217,119,87,0.06); color: var(--text); font-weight: 500; }
/* A value that is a win for that column — used sparingly, including on rivals. */
.cmp-val.cmp-good { color: #4caf7d; }
.cmp-val.cmp-feat.cmp-good { color: #4caf7d; font-weight: 600; }

/* Inline code inside a cell (API method names, flags). */
.cmp-val code, .cmp-label code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px;
}

.cmp-help {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 10px; line-height: 14px; text-align: center;
  cursor: help; flex-shrink: 0; font-family: var(--font-body);
}

.cmp-foot {
  padding: 0.85rem 1.25rem; font-size: 0.78rem; color: var(--text-muted);
  border-top: 1px solid var(--border); background: rgba(255,255,255,0.02);
}

@media (max-width: 700px) {
  .cmp { --cmp-tpl: minmax(110px, 1.4fr) 1fr 1fr; }
  .cmp-label, .cmp-val { font-size: 0.78rem; padding: 0.75rem 0.55rem; }
  .cmp-corner, .cmp-col { padding: 1rem 0.55rem; }
  .cmp-plan { font-size: 0.95rem; }
  .cmp-help { display: none; }
}
/* Four or more columns get a horizontal scroll on small screens rather than
   crushing every column to an unreadable width. */
@media (max-width: 700px) {
  .cmp-scroll .cmp { min-width: 560px; }
}
