/* ─────────────────────────────────────────────────────────────────
   block-compare-table — feature comparison matrix
   T5 redesign 2026-05-06: sticky thead, mobile-sticky first column,
   highlighted-column emphasis, scroll-hint affordance.
   ───────────────────────────────────────────────────────────────── */

.block-compare-table { position: relative; font-family: var(--ds-font-body); }

.block-compare-table .compare-table-shell {
  position: relative;
  background: var(--scheme-card-bg);
  border: 1px solid var(--scheme-rule);
  border-radius: var(--ds-radius);
  overflow: hidden;
  box-shadow: var(--ds-shadow-md);
}

.block-compare-table .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

.block-compare-table .table-compare {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-body);
  color: var(--scheme-card-fg);
}

/* ── Sticky header ───────────────────────────────────────────
   SENIOR-T7 2026-05-07: Anton-uppercase thead replaced with humanist
   sans bold sentence-case (≥18px). Older readers struggle with all-caps
   condensed display faces inside data tables. */
.block-compare-table .table-compare thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ds-paper, #faf6ec);
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: var(--ds-space-4) var(--ds-space-5);
  border-bottom: 2px solid var(--ds-ink);
  color: var(--ds-ink);
  vertical-align: middle;
  text-align: center;
}

.block-compare-table .compare-table-head-feature {
  position: sticky;
  left: 0;
  z-index: 6 !important;
  text-align: left;
}

.block-compare-table .compare-table-head-product { position: relative; }

.block-compare-table .compare-table-head-product.is-highlighted {
  background: var(--ds-cta) !important;
  color: var(--scheme-fg, #fff);
  border-bottom-color: var(--ds-cta);
}

/* SENIOR-T7 2026-05-07: pill bumped from 9px to 12px so older readers
   actually see the "Most booked" cue. Padding bumped accordingly.
   P-A11Y-2 2026-05-08: previously bg=--ds-ink + color=var(--scheme-fg,#fff);
   --scheme-fg resolves to --ds-ink in light schemes → ink-on-ink (1.00:1,
   invisible). Switched to ds-cta orange + literal #fff for AA-passing
   high-signal "MOST BOOKED" badge (~4.59:1 against orange, AAA against ink). */
.block-compare-table .compare-table-head-pill {
  position: absolute;
  top: var(--ds-space-2);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ds-cta);
  color: #fff !important;
  font-family: var(--ds-font-body);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--ds-radius-pill);
  font-weight: 700;
}

.block-compare-table .compare-table-head-product-label {
  display: inline-block;
  padding-top: var(--ds-space-3);
}

.block-compare-table .compare-table-head-product:not(.is-highlighted) .compare-table-head-pill { display: none; }

/* ── Body ──────────────────────────────────────────────────── */
/* F3 2026-05-08: A4 measured tbody cells at 1.09:1 (#0e0f0c on
   #0e0f0c) — the var(--scheme-card-fg) and var(--scheme-card-bg)
   pair was collapsing to ink-on-ink under one of the section
   schemes (likely .scheme-ink / .scheme-steel inheritance bleed).
   Pin the cells to explicit ink-on-paper tokens so the body text
   is unambiguously legible at 19.32:1 on light schemes — the
   dark-scheme override below restores white-on-ink. */
.block-compare-table .table-compare tbody th {
  position: sticky;
  left: 0;
  background: var(--scheme-card-bg, #fff);
  z-index: 2;
  font-weight: 600;
  font-size: var(--ds-fs-body);
  color: var(--ds-ink);
  padding: var(--ds-space-4) var(--ds-space-5);
  border-bottom: 1px solid var(--scheme-rule);
  border-right: 1px solid var(--scheme-rule);
  text-align: left;
  vertical-align: middle;
  min-width: 220px;
}

.block-compare-table .table-compare tbody td {
  padding: var(--ds-space-4) var(--ds-space-3);
  border-bottom: 1px solid var(--scheme-rule);
  vertical-align: middle;
  font-size: var(--ds-fs-body);
  color: var(--ds-ink);
  background: var(--scheme-card-bg, #fff);
  text-align: center;
  min-width: 120px;
}

/* F3 2026-05-08: dark-scheme restoration — when the block sits on
   .scheme-ink or .scheme-steel, flip cell text to white so we don't
   regress the inverted surfaces. */
.scheme-ink .block-compare-table .table-compare tbody th,
.scheme-ink .block-compare-table .table-compare tbody td,
.scheme-steel .block-compare-table .table-compare tbody th,
.scheme-steel .block-compare-table .table-compare tbody td,
.ds-scheme-ink .block-compare-table .table-compare tbody th,
.ds-scheme-ink .block-compare-table .table-compare tbody td,
.ds-scheme-steel .block-compare-table .table-compare tbody th,
.ds-scheme-steel .block-compare-table .table-compare tbody td {
  color: #fff;
  background: var(--scheme-card-bg);
}

.block-compare-table .table-compare tbody tr:last-child th,
.block-compare-table .table-compare tbody tr:last-child td {
  border-bottom: none;
}

/* Zebra row backgrounds also apply to sticky <th> so the stripe is preserved */
.block-compare-table .table-compare tbody tr:nth-child(even) th {
  background: color-mix(in srgb, var(--ds-paper, #faf6ec) 60%, var(--scheme-card-bg) 40%);
}
.block-compare-table .table-compare tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--ds-paper, #faf6ec) 30%, var(--scheme-card-bg) 70%);
}

.block-compare-table .compare-table-cell.is-highlighted {
  background: color-mix(in srgb, var(--ds-cta) 6%, var(--scheme-card-bg) 94%) !important;
}
.block-compare-table .table-compare tbody tr:nth-child(even) .compare-table-cell.is-highlighted {
  background: color-mix(in srgb, var(--ds-cta) 12%, var(--scheme-card-bg) 88%) !important;
}

/* ── Check / X icons ───────────────────────────────────────────────
   FIX-T5 2026-05-06 — single-render fix.
   theme.min.css defines a global `.t-icon::before` that paints the
   feather SVG (check-circle / x-circle) via `mask-image` using
   `background-color: currentColor`. Previously this module ALSO drew
   a second checkmark via `::after` border-rotate, producing TWO
   stacked icons. We now keep ONLY the theme's `::before` SVG and use
   the parent `.t-icon` element solely as the coloured chip backdrop.
   The empty `<span>` markup is unchanged.
   ───────────────────────────────────────────────────────────────── */
.block-compare-table .t-icon {
  width: 24px;
  height: 24px;
  /* keep theme display:inline-flex + border-radius:50% from theme.min.css */
  vertical-align: middle;
  color: var(--scheme-fg, #fff);            /* SVG-mask paint colour (currentColor) */
}

.block-compare-table .t-check-circle { background: var(--ds-trust); }

.block-compare-table .t-x-circle {
  background: var(--scheme-fg-mute);
  opacity: 0.5;
}

.block-compare-table .compare-table-cell.is-highlighted .t-check-circle { background: var(--ds-cta); }

/* ── Modern stroke-only check / em-dash mark (W9-A13 2026-05-07) ───
   Replaces the chip-backdrop t-icon paint for the comparison cells.
   Inline SVG in the Twig template uses `currentColor`, so the colour
   is driven entirely from these scoped rules. The legacy `.t-icon`
   rules above are kept as a fallback for any cell whose markup hasn't
   been migrated yet (Wave-6 single-paint guard).
   ───────────────────────────────────────────────────────────────── */
.block-compare-table .ct-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
  vertical-align: middle;
}
.block-compare-table .ct-mark--yes { color: var(--ds-trust); }
.block-compare-table .compare-table-cell.is-highlighted .ct-mark--yes { color: var(--ds-cta); }
.block-compare-table .ct-mark--no {
  color: var(--scheme-fg-mute);
  opacity: 0.55;
  font-size: 22px;
  font-weight: 500;
}
@media (prefers-reduced-motion: no-preference) {
  .block-compare-table .ct-mark--yes svg {
    transition: transform var(--ds-duration-fast) var(--ds-ease);
  }
  .block-compare-table .compare-table-cell:hover .ct-mark--yes svg {
    transform: scale(1.08);
  }
}

/* ── Scroll hint (mobile) ────────────────────────────────────
   SENIOR-T7 2026-05-07: hint text bumped to body-sm (16px) sentence-case.
   Mono+uppercase+14px was unreadable for older eyes. */
.block-compare-table .compare-table-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  padding: 12px var(--ds-space-3);
  background: var(--ds-ink);
  color: var(--scheme-fg, #fff);
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-body-sm, 1rem);
  letter-spacing: 0.02em;
  font-weight: 600;
  text-transform: none;
}

@media (min-width: 769px) {
  .block-compare-table .compare-table-scroll-hint { display: none !important; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* SWEEP-B2 2026-05-08: column headers were dropping to 16px (--ds-fs-body-sm)
     on mobile, undershooting the AARP-aligned ≥18px floor for header text on
     comparison tables. Split the override so <th> stays at 1.125rem (18px)
     bold sentence-case while body cells <td> stay at 16px (still ≥16px floor
     for cell text). The horizontal-scroll affordance is unaffected — min-widths
     below force the table to overflow at 375 (90×3 + 160 = 430 > 375). */
  .block-compare-table .table-compare thead th,
  .block-compare-table .table-compare tbody th {
    padding: var(--ds-space-3);
    font-size: var(--ds-fs-body);
    min-height: 44px; /* mobile-44 */
  }
  .block-compare-table .table-compare tbody td {
    padding: var(--ds-space-3);
    font-size: var(--ds-fs-body-sm);
    min-height: 44px; /* mobile-44 */
  }
  .block-compare-table .table-compare tbody th { min-width: 160px; }
  .block-compare-table .table-compare tbody td { min-width: 90px; }
  /* SENIOR-T7: pill stays ≥11px even on mobile — was 8px which fails
     legibility for older readers. */
  .block-compare-table .compare-table-head-pill { font-size: 11px; }
}

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