.content-table-block {
  --content-table-border-color: color-mix(
    in srgb,
    var(--color-dark-base) 8%,
    transparent
  );

  width: 100%;
  max-width: 100%;
}

.content-table-block:not(:first-child) {
  margin-top: var(--spacing-block-medium);
}

.content-table-block:not(:last-child) {
  margin-bottom: var(--spacing-block-medium);
}

.content-table__caption {
  padding: 0;
  margin: 0 0 0.625rem;
  color: var(--color-muted);
  font-weight: 500;
  line-height: 1.4;
}

.content-table-frame {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--content-table-border-color);
  border-radius: 0.375rem;
  background: var(--color-light-base);
}

.content-table {
  --content-table-cell-padding: 0.5rem 0.75rem;

  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--color-text);
}

.content-table__semantic-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.content-table :is(thead, tbody, tfoot) {
  display: block;
}

.content-table tr {
  display: flex;
  flex-wrap: wrap;
  background: var(--color-light-base);
}

.content-table > tr:not(:last-child),
.content-table > :is(thead, tbody, tfoot):not(:last-child) > tr:last-child,
.content-table > :is(thead, tbody, tfoot) > tr:not(:last-child) {
  border-bottom: 1px solid var(--content-table-border-color);
}

.content-table :is(th, td) {
  display: block;
  min-width: 0;
  border: 0;
  flex: 1 1 8rem;
  overflow-wrap: anywhere;
  text-align: start;
  vertical-align: middle;
}

.content-table tr > :is(th, td) + :is(th, td) {
  border-inline-start: 0;
}

.content-table th {
  padding: var(--content-table-cell-padding);
  background: var(--color-primary-surface);
  color: var(--color-muted);
  font-weight: 500;
  line-height: 1.4;
}

.content-table td {
  padding: var(--content-table-cell-padding);
  background: var(--color-light-base);
  line-height: 1.4;
}

.content-table :is(img, svg, video, iframe) {
  max-width: 100%;
  height: auto;
}

.content-table :is(pre, code) {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.content-table--has-column-headers thead,
.content-table--has-column-headers .content-table__header-row {
  height: 0;
  margin: 0;
  overflow: hidden;
}

.content-table--has-column-headers .content-table__header-row {
  border: 0;
}

.content-table--has-column-headers .content-table__header-row th {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.content-table--has-column-headers tbody tr,
.content-table--has-column-headers tfoot tr {
  display: block;
}

.content-table--has-column-headers :is(tbody, tfoot) :is(th, td) {
  width: 100%;
}

.content-table--has-column-headers :is(tbody, tfoot) td + td {
  border-top: 0;
  border-inline-start: 0;
}

.content-table--has-column-headers tr > :is(th, td) + :is(th, td) {
  border-inline-start: 0;
}

.content-table td.content-table__cell--empty {
  display: none;
}

.content-table--has-column-headers td {
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 0.5rem;
}

.content-table td[data-label]:not([data-label=''])::before {
  font-weight: 700;
  content: attr(data-label) ': ';
}

@media (min-width: 740px) {
  .content-table {
    --content-table-cell-padding: 0.75rem 1rem;
  }

  .content-table--has-column-headers thead,
  .content-table--has-column-headers .content-table__header-row {
    height: auto;
    margin: 0;
    overflow: visible;
  }

  .content-table--has-column-headers .content-table__header-row {
    border-bottom: 1px solid var(--content-table-border-color);
  }

  .content-table--has-column-headers .content-table__header-row th {
    position: static;
    width: auto;
    height: auto;
    padding: var(--content-table-cell-padding);
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .content-table--has-column-headers :is(tbody, tfoot) tr {
    display: flex;
  }

  .content-table--has-column-headers :is(tbody, tfoot) :is(th, td) {
    width: auto;
  }

  .content-table--has-column-headers :is(tbody, tfoot) td + td {
    border-top: 0;
    border-inline-start: 1px solid var(--content-table-border-color);
  }

  .content-table tr > :is(th, td) + :is(th, td) {
    border-inline-start: 1px solid var(--content-table-border-color);
  }

  .content-table :is(th, td) {
    flex-basis: 6rem;
  }

  .content-table th {
    padding: var(--content-table-cell-padding);
  }

  .content-table td {
    padding: var(--content-table-cell-padding);
  }

  .content-table td.content-table__cell--empty {
    display: block;
  }

  .content-table
    td:is(
      :has(> img:only-child),
      :has(> p:only-child > img:only-child),
      :has(> figure:only-child > img:only-child)
    ) {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
  }

  .content-table td[data-label]:not([data-label=''])::before {
    content: none;
  }
}

@media (min-width: 1200px) {
  .content-table {
    display: table;
    table-layout: fixed;
  }

  .content-table thead {
    display: table-header-group;
  }

  .content-table tbody {
    display: table-row-group;
  }

  .content-table tfoot {
    display: table-footer-group;
  }

  .content-table tr,
  .content-table--has-column-headers :is(tbody, tfoot) tr,
  .content-table--has-column-headers .content-table__header-row {
    display: table-row;
    border: 0;
  }

  .content-table :is(th, td),
  .content-table--has-column-headers :is(tbody, tfoot) :is(th, td) {
    display: table-cell;
    width: auto;
    border-bottom: 1px solid var(--content-table-border-color);
  }

  .content-table tr > :is(th, td) + :is(th, td),
  .content-table--has-column-headers :is(tbody, tfoot) td + td {
    border-inline-start: 1px solid var(--content-table-border-color);
  }

  .content-table > tr:last-child > :is(th, td),
  .content-table > :last-child > tr:last-child > :is(th, td) {
    border-bottom: 0;
  }

  .content-table td.content-table__cell--empty {
    display: table-cell;
  }

  .content-table
    td:is(
      :has(> img:only-child),
      :has(> p:only-child > img:only-child),
      :has(> figure:only-child > img:only-child)
    ) {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
  }
}
