/* Table striping for odd rows */
tr:nth-child(odd) {
  background-color: var(--il-storm-lighter-4);
}

/* This is the default wrapper for all tables */
.table-responsive-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (width <= 599px) {
  .table-responsive-wrapper {
    display: block;
    inline-size: min(100%, calc(100vw - 3.75rem));
    max-inline-size: calc(100vw - 3.75rem);
  }

  .table-responsive-wrapper > table {
    width: 100%;
    min-width: 40rem;
  }

  /* This is the stacked class for tables, class needs to be applied in ckeditor or in the html */
  table.table-stack,
  .table-stack table,
  .table-stack thead,
  .table-stack tbody,
  .table-stack th,
  .table-stack td,
  .table-stack tr {
    display: block;
  }

  .table-stack thead {
    display: none;
  }

  .table-stack tr {
    margin-bottom: 2rem;
    border: 1px solid var(--il-storm-lighter-3);
    background: white;
    overflow: hidden;
  }

  /* Remove global striping inside stacked view */
  .table-stack tr:nth-child(odd) {
    background: white;
  }

  .table-stack td {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: none; /* remove desktop borders */
    border-bottom: 1px solid var(--il-storm-lighter-3);
  }

  .table-stack td:last-child {
    border-bottom: none;
  }

  .table-stack td::before {
    content: attr(data-label);
    font-weight: bold;
    color: var(--il-blue);
    flex: 1;
    padding-right: 1rem;
  }

  .table-stack td:first-of-type {
    border-left: none;
  }

  .table-stack td:last-of-type {
    border-right: none;
  }
}