/* Shared by the front end and block editor. The figure qualifier beats core defaults regardless of load order. */
figure.wp-block-table {
  --table-border: #dce3ea;
  --table-stripe: #f3f6fa;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

figure.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: clamp(14px, 0.8333vw, 16px);
  line-height: 1.6;
}

figure.wp-block-table :is(th, td) {
  padding: clamp(12px, 0.9375vw, 18px) clamp(14px, 1.25vw, 24px);
  border-width: 1px;
  border-style: solid;
  vertical-align: top;
}

figure.wp-block-table th {
  font-weight: 600;
  text-align: start;
}

figure.wp-block-table :is(th, td).has-text-align-center { text-align: center; }
figure.wp-block-table :is(th, td).has-text-align-right { text-align: right; }

figure.wp-block-table thead {
  border-bottom: 3px solid var(--wp--preset--color--gold, #af8c55);
}

figure.wp-block-table table:not(.has-background) thead {
  background: var(--wp--preset--color--blue, #083d77);
}

figure.wp-block-table:not(.has-text-color) table:not(.has-text-color):not(.has-background) thead {
  color: #fff;
}

figure.wp-block-table tfoot {
  border-top: 2px solid var(--table-border);
  font-weight: 600;
}

figure.wp-block-table table:not(.has-background) tfoot {
  background: var(--table-stripe);
}

figure.wp-block-table.is-style-stripes {
  border-bottom: 0;
}

figure.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background-color: var(--table-stripe);
}

figure.wp-block-table :where(table:not(.has-border-color):not([style*="border"])) :is(th, td),
figure.wp-block-table.is-style-stripes :where(table:not(.has-border-color):not([style*="border"])) :is(th, td) {
  border-color: var(--table-border);
}

figure.wp-block-table table.has-fixed-layout :is(th, td) {
  overflow-wrap: anywhere;
}

figure.wp-block-table a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

figure.wp-block-table thead a { color: inherit; }

figure.wp-block-table figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  text-align: start;
}
