/* Tablas (§6.20): sin bordes de celda, cabecera caps oro con regla, hover cálido; patrón stacked móvil con [data-th]. */

table {
  width: 100%;
  margin-block: 0 var(--space-6);
  border-collapse: collapse;
  font-size: var(--fs-body);
  font-variant-numeric: lining-nums;
}

caption {
  margin-block-end: var(--space-3);
  text-align: start;
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--div-ink-soft);
}

th {
  font-family: var(--ff-display);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: var(--ls-caps-2);
  text-transform: uppercase;
  text-align: start;
  color: var(--div-accent-strong);
}

thead th,
thead td {
  padding: var(--space-3) var(--space-4);
  border-block-end: 1px solid var(--div-line-strong);
}

tbody th,
tbody td,
tfoot th,
tfoot td {
  padding: var(--space-4);
  border-block-end: 1px solid var(--div-line);
  vertical-align: top;
}

tbody tr {
  transition: background-color var(--dur-fast) var(--ease-out);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--div-accent) 6%, transparent);
}

/* Números a la derecha. */
th.is-numeric,
td.is-numeric {
  text-align: end;
}

/* ——— Patrón stacked (opt-in .c-table--stacked; cada td lleva data-th) ——— */

@media (max-width: 639.98px) {
  .c-table--stacked thead {
    position: absolute;
    overflow: hidden;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    white-space: nowrap;
  }

  .c-table--stacked,
  .c-table--stacked tbody,
  .c-table--stacked tfoot,
  .c-table--stacked tr {
    display: block;
  }

  .c-table--stacked tr {
    padding-block: var(--space-4);
    border-block-end: 1px solid var(--div-line);
  }

  .c-table--stacked tbody th,
  .c-table--stacked tbody td,
  .c-table--stacked tfoot th,
  .c-table--stacked tfoot td {
    display: grid;
    grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-1) 0;
    border: 0;
    text-align: start;
  }

  .c-table--stacked td::before,
  .c-table--stacked tbody th::before {
    content: attr(data-th);
    font-family: var(--ff-display);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: var(--ls-caps-2);
    text-transform: uppercase;
    color: var(--div-ink-soft);
  }

  .c-table--stacked .is-numeric {
    text-align: start;
  }
}
