/* ---- Table block ---- */

.wp-block-table {
  table {
    margin: 0 auto;
  }

  th,
  td {
    padding: 0.5em;
  }

  figcaption {
    margin-top: 0.5em;
    margin-bottom: 1em;
  }
}

.mxs-light-bg .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background-color: rgba(0, 0, 0, 0.0625);
}

/* Contrast colors */
.wp-block-table {
  .mxs-light-theme-bg &,
  .mxs-dark-theme-bg .mxs-light-bg & {
    table {
      background-color: var(--black-6pcnt);
      border: 1px solid var(--black-12pcnt);
      color: var(--dark-gray);
    }

    thead {
      border-bottom: 2px solid var(--black-12pcnt);
    }

    th,
    td {
      border-color: var(--medium-gray);
    }

    tfoot {
      border-top: 2px solid var(--black-12pcnt);
    }
  }

  .mxs-dark-theme-bg &,
  .mxs-light-theme-bg .mxs-dark-bg & {
    table {
      background-color: var(--white-6pcnt);
      border: 1px solid var(--white-12pcnt);
      color: var(--almost-white);
    }

    thead {
      border-bottom: 2px solid var(--white-12pcnt);
    }

    th,
    td {
      border-color: var(--white-12pcnt);
    }

    tfoot {
      border-top: 2px solid var(--white-12pcnt);
    }
  }
}

.wp-block-table.is-style-stripes {
  table {
    background-color: transparent;
  }

  .mxs-dark-theme-bg &,
  .mxs-light-theme-bg .mxs-dark-bg & {
    border-bottom-color: var(--white-12pcnt);

    tbody tr:nth-child(odd) {
      background-color: var(--white-6pcnt);
    }
  }

  .mxs-light-theme-bg &,
  .mxs-dark-theme-bg .mxs-light-bg & {
    border-bottom-color: var(--black-6pcnt);

    tbody tr:nth-child(odd) {
      background-color: var(--black-6pcnt);
    }
  }
}
