/* =========================================================
   Tables — Global
   ========================================================= */

.table-wrapper {
  width: 100%;
  margin-bottom: 2rem;
  margin-top: 1rem;
  background: var(--_theme---background);
  border: 1px solid var(--_theme---border);
  border-radius: 1rem;
  overflow: hidden;
}

@media (max-width: 767px) {
  .table-wrapper {
    overflow-x: auto;
    border-radius: 0.75rem;
  }
}

.data-table {
  width: 100%;
  min-width: 40rem;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--_theme---text);
  font-size: 0.9375rem;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .data-table {
    min-width: 20rem;
  }
}

th,
td {
  border: 0;
  padding: 0.875rem 1.25rem;
  text-align: left;
  vertical-align: top;
}

th *,
td * {
  text-align: left;
}

td {
  white-space: normal;
  word-wrap: break-word;
}

/* Inverted header — dark text color used as background */
thead th {
  background: var(--_theme---text);
  color: var(--_theme---background);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1.25rem;
}

tbody tr {
  transition: background-color 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

tbody tr + tr td {
  border-top: 1px solid var(--_theme---border);
}

tbody tr:hover {
  background: color-mix(in oklab, var(--_theme---text) 5%, transparent);
}

tbody td:first-child {
  font-weight: 600;

  width: 1%;
}

/* Code chips */
.data-table code {
  display: inline-block;
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.3125rem 0.5rem;
  margin: 0.125rem 0.25rem 0.125rem 0;
  background: var(--_theme---background);
  border: 1px solid var(--_theme---border);
  border-radius: 0.375rem;
  color: var(--_theme---text);
  white-space: nowrap;
}

.data-table code + code {
  margin-left: 0.125rem;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  padding: 1.125rem 1.25rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--_theme---text);
}

.data-table a:focus-visible,
.data-table code:focus-visible,
.data-table tbody tr:focus-within {
  outline: 2px solid var(--_theme---text);
  outline-offset: 2px;
}

/* Modifier — zebra */
.data-table.zebra tbody tr:nth-child(even) td {
  background: color-mix(in oklab, var(--_theme---text) 4%, transparent);
}

/* Modifier — compact */
.data-table.compact th,
.data-table.compact td {
  padding: 0.5625rem 0.875rem;
}
.data-table.compact code {
  font-size: 0.71875rem;
  padding: 0.1875rem 0.375rem;
}

/* Modifier — pricing */
.data-table.pricing tbody tr:nth-child(odd) td {
  background: color-mix(in oklab, var(--_theme---text) 4%, transparent);
}
