/* ==========================================================================
   tables.css — comparison tables, spec tables, data grids
   ========================================================================== */

.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap + .table-note {
  margin-top: var(--space-xs);
  font-size: var(--fs-micro);
  color: var(--color-secondary);
}

.table {
  width: 100%;
  min-width: 620px;
  font-size: 15px;
  line-height: 1.55;
}

.table caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-m) var(--space-l) 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-secondary);
}

.table thead th {
  background: var(--color-surface-alt);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-accent-dark);
  padding: 14px var(--space-m);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  vertical-align: middle;
}

.table tbody th {
  font-weight: 600;
  color: var(--color-text);
}

.table td,
.table tbody th {
  padding: 14px var(--space-m);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: rgba(233, 238, 233, 0.45);
}

.table--fixed {
  table-layout: fixed;
}

.table--compact td,
.table--compact th {
  padding: 10px var(--space-s);
  font-size: 14px;
}

.table--zebra tbody tr:nth-child(even) {
  background: rgba(245, 245, 240, 0.7);
}

.table td strong {
  font-weight: 650;
}

.table .cell-yes {
  color: var(--color-accent);
  font-weight: 650;
}

.table .cell-no {
  color: var(--color-secondary);
}

.table .cell-muted {
  color: var(--color-secondary);
  font-size: 14px;
}

/* Spec / definition table ------------------------------------------------ */

.spec-table {
  width: 100%;
  font-size: 15.5px;
}

.spec-table tr {
  border-bottom: 1px solid var(--color-border);
}

.spec-table tr:last-child {
  border-bottom: 0;
}

.spec-table th {
  width: 34%;
  padding: 14px 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--color-accent-dark);
  vertical-align: top;
}

.spec-table td {
  padding: 14px 0 14px var(--space-m);
  color: var(--color-secondary);
  line-height: 1.6;
  vertical-align: top;
}

/* Matrix table ----------------------------------------------------------- */

.matrix th:first-child {
  position: sticky;
  left: 0;
  background: var(--color-surface);
  z-index: 1;
}

.matrix thead th:first-child {
  background: var(--color-surface-alt);
}
