/* ============================================
   Tables — clean comparison/grid recipe.

   White card container w/ subtle 1px borders + 12px radius
   (clipped via overflow:hidden so inner cell borders don't bleed
   past the corners). Vertical borders between columns + horizontal
   borders between rows. No saturated color blocks — clean
   typography + neutral greys do the work.

   Variants:
     .gs-wgs-table--matrix      N-col category grid. Column headers
                                are conceptual labels (Governance,
                                Cost, etc).
     .gs-wgs-table--engagement  First col = uppercase row labels
                                (<th scope="row">); other cols =
                                comparison modes with header icons.

   Mobile (≤767px): aggressive type + padding shrink so the table
   fits horizontally without scrolling and without converting to
   cards. Text wraps, cells get taller, columns get narrower.
   Header icons hide on phones — scarce horizontal space, labels
   are enough.

   `border-collapse: separate; border-spacing: 0;` is REQUIRED for
   `border-radius` to apply to the outer card. With `collapse`, the
   cell borders extend to the edge and square off the corners.

   `tr > * + *` covers all sibling pairs (td+td, th+td, td+th) —
   the engagement table needs th→td too since its first column is
   `<th scope="row">`.
   ============================================ */

.gs-wgs-table-wrap {
  margin-top: 3rem;
  max-width: var(--content-frame);
  margin-left: auto;
  margin-right: auto;
}

.gs-wgs-table-wrap__title {
  font-size: var(--text-h4);
  color: var(--color-fg);
  margin: 0 0 1rem;
  text-align: center;
}

.gs-wgs-table {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.gs-wgs-table th,
.gs-wgs-table td {
  padding: 1.25rem 1.5rem;
  vertical-align: top;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
}

.gs-wgs-table tr > * + * {
  border-left: 1px solid var(--color-border);
}

/* Last row has no bottom rule — the card's outer border closes it. */
.gs-wgs-table tbody tr:last-child th,
.gs-wgs-table tbody tr:last-child td {
  border-bottom: 0;
}

.gs-wgs-table thead th {
  font-weight: var(--weight-bold);
  background: transparent;
}

/* ─── matrix variant ─────────────────────── */

.gs-wgs-table--matrix thead th {
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  color: var(--color-fg);
}

.gs-wgs-table--matrix td {
  font-size: 0.8125rem;
}

/* ─── engagement variant ─────────────────── */

.gs-wgs-table--engagement thead th {
  font-size: 1rem;
  font-weight: var(--weight-semibold);
}

/* Column-header icon — small, inline, vivid blue. Sizing lives
   on the class itself (not a child SVG selector) because Lucide
   swaps the i element for an svg that carries this class directly. */
.gs-wgs-table__col-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: -4px;
  margin-right: 0.5rem;
  color: var(--color-accent);
  width: 18px;
  height: 18px;
}

/* Row labels (left col, engagement) — uppercase 12px bold. */
.gs-wgs-table--engagement tbody th {
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-fg);
  width: 18%;
}

/* Footer callout — white card w/ vivid blue border. Static, no
   hover — informational, not interactive. Icon sits in a light-
   blue rounded square. */
.gs-wgs-table-wrap__footer {
  margin: 0.75rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  color: var(--color-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.gs-wgs-table-wrap__footer-iconbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #e8f4ff;
  border-radius: 8px;
  flex-shrink: 0;
}

.gs-wgs-table-wrap__footer-icon {
  color: var(--color-accent);
  width: 16px;
  height: 16px;
}

/* ============================================
   Mobile / tablet — shrink so the table fits horizontally
   ============================================ */

@media (max-width: 767px) {
  .gs-wgs-table th,
  .gs-wgs-table td {
    padding: 0.625rem 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.4;
  }
  .gs-wgs-table--matrix thead th {
    font-size: 0.75rem;
  }
  .gs-wgs-table--matrix td {
    font-size: 0.6875rem;
  }
  .gs-wgs-table--engagement thead th {
    font-size: 0.8125rem;
  }
  .gs-wgs-table--engagement tbody th {
    font-size: 0.625rem;
    width: 22%;
  }
  /* Hide column-header icons on phones — labels are enough, the
     icons take scarce horizontal space. */
  .gs-wgs-table__col-icon {
    display: none;
  }
  .gs-wgs-table-wrap__footer {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
  }
}
