/* ==========================================================================
   COMPARE — dedicated styling for the /compare hub and the "PaellaDoc vs X"
   articles (layout: compare). Loaded only on /compare URLs.
   Two parts: (1) article prose widened + comparison-table styling for the
   markdown tables inside each vs-article; (2) the .cmp-* hub components.
   ========================================================================== */

/* ── (1) vs-article body (layout: compare) ──────────────────────────────── */

/* Widen the reading column to match the 880px hero/featured image. The blog
   post measure (680px) is too narrow for side-by-side comparison content. */
.tp-post--compare .tp-prose { max-width: 880px; }

/* Markdown comparison tables → attractive, on-brand. PaellaDoc is always the
   last column, so it gets a warm tint. */
.tp-post--compare .tp-prose table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 36px 0;
  font-family: var(--tp-mono);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--tp-rule);
  border-radius: 14px;
  overflow: hidden;
}
.tp-post--compare .tp-prose thead th {
  text-align: left;
  padding: 13px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--tp-mute);
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--tp-rule);
}
.tp-post--compare .tp-prose thead th:last-child {
  color: var(--tp-ink);
  background: var(--tp-terracota);
}
.tp-post--compare .tp-prose tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--tp-rule-soft);
  vertical-align: middle;
}
.tp-post--compare .tp-prose tbody tr:last-child td { border-bottom: none; }
.tp-post--compare .tp-prose tbody td:first-child { font-weight: 600; color: var(--tp-ink); }
.tp-post--compare .tp-prose tbody td:last-child { background: rgba(217, 72, 15, 0.10); }
.tp-post--compare .tp-prose tbody tr:hover td { background: var(--tp-rule-faint); }
.tp-post--compare .tp-prose tbody tr:hover td:last-child { background: rgba(217, 72, 15, 0.16); }

@media (max-width: 720px) {
  .tp-post--compare .tp-prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tp-post--compare .tp-prose thead th, .tp-post--compare .tp-prose tbody td { white-space: nowrap; }
}

/* Back-to-hub strip */
.tp-compare-back {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--tp-gutter);
}
.tp-compare-back a {
  font-family: var(--tp-mono);
  font-size: 13px;
  color: var(--tp-terracota);
}

/* ── (2) /compare hub components ─────────────────────────────────────────── */

/* Readable measure for the hub. compare.css loads only on /compare URLs, so
   these constraints don't leak to other essay pages. The container is wide
   enough to show the full 6-column table; running text is capped to a
   comfortable line length and left-aligned with the table's left edge. */
body.home-tp .tp-essay { max-width: 1160px; margin-inline: auto; }
body.home-tp .tp-essay-head { max-width: 820px; margin: 0 0 64px; }
body.home-tp .tp-essay-body--wide { max-width: 1160px; }
.tp-essay-body--wide > p,
.tp-essay-body--wide > h2,
.tp-essay-body--wide > .cmp-gate,
.tp-essay-body--wide > .cmp-faq { max-width: 820px; }
.tp-essay-body--wide > .cmp-table-wrap,
.tp-essay-body--wide > .cmp-grid { max-width: 100%; }

/* Fixed layout so every column shows: narrow first column, equal data columns. */
.cmp-table { min-width: 720px; table-layout: fixed; }
.cmp-table th:first-child, .cmp-table td:first-child { width: 25%; }


.cmp-lead { color: var(--tp-fg-muted); font-size: var(--tp-body-md); line-height: 1.55; }
.cmp-lead strong { color: var(--tp-fg-bone); }
.cmp-lead .warm { color: var(--tp-accent-warm); }

.cmp-table-wrap { overflow-x: auto; margin: 8px 0 12px; -webkit-overflow-scrolling: touch; border: 1px solid var(--tp-rule); border-radius: 14px; }
.cmp-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: var(--tp-body-sm); color: var(--tp-fg-bone); }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--tp-rule-soft); }
.cmp-table thead th { font-family: var(--tp-font-mono); font-size: var(--tp-label); letter-spacing: 1.5px; text-transform: uppercase; color: var(--tp-fg-muted); font-weight: 600; background: var(--tp-bg-elevated); position: sticky; top: 0; }
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table .cmp-row-label { font-weight: 600; color: var(--tp-fg-bone); line-height: 1.3; }
.cmp-table .cmp-pd { background: var(--tp-accent-warm-faint); }
.cmp-table thead .cmp-pd { color: var(--tp-fg-bone); background: var(--tp-accent-warm); }
.cmp-table tbody tr:hover td { background: var(--tp-bg-hover); }
.cmp-table tbody tr:hover td.cmp-pd { background: var(--tp-accent-warm-tint); }
.cmp-yes { color: var(--tp-state-ok); font-weight: 700; }
.cmp-no { color: var(--tp-fg-faint); }
.cmp-na { color: var(--tp-fg-faint); }
.cmp-pd-yes { color: var(--tp-accent-warm); font-weight: 700; }

.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 14px; margin: 8px 0 4px; }
.cmp-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; border: 1px solid var(--tp-rule); border-radius: 14px; background: var(--tp-bg-card); text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.cmp-card:hover { transform: translateY(-3px); border-color: var(--tp-accent-warm); box-shadow: 0 10px 40px var(--tp-accent-warm-glow); }
.cmp-card-tag { font-family: var(--tp-font-mono); font-size: var(--tp-label); letter-spacing: 1.5px; text-transform: uppercase; color: var(--tp-fg-faint); }
.cmp-card--runs .cmp-card-tag { color: var(--tp-accent-highlight); }
.cmp-card-vs { font-size: var(--tp-body-md); font-weight: 700; color: var(--tp-fg-bone); margin: 0; }
.cmp-card-vs .warm { color: var(--tp-accent-warm); }
.cmp-card-note { font-size: var(--tp-body-sm); color: var(--tp-fg-muted); line-height: 1.5; margin: 0; }
.cmp-card-go { margin-top: auto; font-family: var(--tp-font-mono); font-size: var(--tp-body-xs); color: var(--tp-accent-warm); }

.cmp-gate { border-left: 3px solid var(--tp-accent-warm); background: var(--tp-accent-warm-faint); border-radius: 0 12px 12px 0; padding: 18px 22px; margin: 4px 0 8px; }
.cmp-gate ul { margin: 0; padding-left: 18px; }
.cmp-gate li { margin: 0 0 8px; color: var(--tp-fg-muted); font-size: var(--tp-body-sm); line-height: 1.5; }
.cmp-gate li:last-child { margin-bottom: 0; }
.cmp-gate strong { color: var(--tp-fg-bone); }

.cmp-faq dt { font-weight: 700; color: var(--tp-fg-bone); margin-top: 18px; }
.cmp-faq dd { margin: 6px 0 0; color: var(--tp-fg-muted); font-size: var(--tp-body-sm); line-height: 1.55; }

/* Forum discussion CTA inside vs-articles */
.tp-post--compare .tp-prose .compare-discuss { margin: 44px 0 8px; padding: 18px 22px; border-left: 3px solid var(--tp-terracota); background: rgba(217, 72, 15, 0.08); border-radius: 0 12px 12px 0; font-size: 15px; line-height: 1.55; }
.tp-post--compare .tp-prose .compare-discuss strong { color: var(--tp-ink); }
.tp-post--compare .tp-prose .compare-discuss a { color: var(--tp-terracota); font-weight: 600; }
