/* Tables: table, thead, tbody, tfoot, tr, th, td, table.striped */

thead,
tfoot {
  & th,
  & td {
    --pico-font-weight: 500;
  }
}

/* Quiet column labels */
thead :where(th, td) {
  --pico-color: var(--pico-muted-color);
  font-size: 0.875em;
}

:where(table) {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  text-indent: 0;
}

th,
td {
  padding: calc(var(--pico-spacing) * 0.625) var(--pico-spacing);
  border-bottom: var(--pico-border-width) solid var(--pico-table-border-color);
  background-color: var(--pico-background-color);
  color: var(--pico-color);
  font-weight: var(--pico-font-weight);
  text-align: start;
}

td {
  font-variant-numeric: tabular-nums;
}

/* Cells in a card take the card surface, not the page color */
article :where(th, td) {
  background-color: transparent;
}

tfoot th,
tfoot td {
  border-top: var(--pico-border-width) solid var(--pico-table-border-color);
  border-bottom: 0;
}

table.striped {
  & tbody tr:nth-child(odd) {
    & th,
    & td {
      background-color: var(--pico-table-row-stripped-background-color);
    }
  }
}
