.block-text {
  padding: 40px 0;

  @media (min-width: 768px) {
    padding: 60px 0;
  }

  &.two-col {
    .redactor {
      columns: 2;
      column-gap: 30px;
    }
  }

  &.intro-text {
    .redactor {
      p {
        font-size: var(--font-size-regular-medium);
      }
    }
  }

  /* Tables need the full width on mobile */
  &.two-col .redactor:has(.table-scroll) {
    @media (max-width: 767.98px) {
      columns: auto;
    }
  }

  /* A scroll container cannot be split over two columns */
  &.two-col .redactor .table-scroll-viewport {
    @media (min-width: 768px) {
      overflow-x: visible;
    }
  }

  .redactor {
    .table-scroll-viewport {
      max-width: 100%;
      overflow-x: auto;
    }

    .table-scroll-hint,
    .table-scroll-bar {
      display: none;
    }

    @media (max-width: 767.98px) {
      .table-scroll-ready .table-scroll-viewport {
        /* Replaced by .table-scroll-bar, which stays visible on iOS too */
        scrollbar-width: none;

        &::-webkit-scrollbar {
          display: none;
        }
      }

      .table-scroll-viewport {
        border-radius: 10px;

        /* Safari before 17.2 needs the & before element selectors */
        & table {
          display: table;
          width: max-content;
          min-width: 100%;
          overflow: visible;
          overflow-wrap: normal;
          white-space: normal;

          & td {
            max-width: 260px;
          }
        }
      }

      /* Without scripts nothing can measure the table: always show the hint */
      @media (scripting: none) {
        .table-scroll-hint[hidden] {
          display: block;
          margin-bottom: 12px;
          font-size: var(--font-size-small);
        }
      }

      .table-scroll-hint:not([hidden]) {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
        font-size: var(--font-size-small);

        &::before {
          /* \FE0E keeps iOS from showing an emoji, older Safari does not know the alt text syntax */
          content: "\2194\FE0E";
          content: "\2194\FE0E" / "";
          font-size: 1.4em;
          line-height: 1;
        }
      }

      .table-scroll-bar:not([hidden]) {
        display: block;
        position: relative;
        height: 8px;
        margin-top: 10px;
        border: 1px solid var(--color-purple);
        border-radius: 4px;
        background-color: var(--color-white);
        cursor: pointer;
        touch-action: none;

        /* Larger area to grab */
        &::after {
          content: "";
          position: absolute;
          inset: -9px 0;
        }
      }

      .table-scroll-thumb {
        height: 100%;
        border-radius: 3px;
        background-color: var(--color-purple);
      }
    }

    /* Row headers look like the other cells, an empty corner like the header row */
    .table-original,
    .table-plain {
      thead .table-corner {
        padding: 25px 30px;
        border-top-left-radius: 10px;
      }

      tbody th[scope="row"] {
        padding: 25px 30px;
        border-bottom: 1px solid #cbbbdc;
        font-weight: inherit;
        text-align: left;
      }

      tbody tr:last-child th[scope="row"] {
        border-bottom: none;
        border-bottom-left-radius: 10px;
      }
    }

    /* Row headers stay in view while scrolling */
    @media (max-width: 767.98px) {
      .table-plain:has(.table-corner) {
        border-collapse: separate;
        border-spacing: 0;

        thead .table-corner,
        tbody th[scope="row"] {
          position: sticky;
          left: 0;
          z-index: 1;
          max-width: 155px;
          padding: 25px 10px;
          overflow-wrap: anywhere;
          -webkit-hyphens: auto;
          hyphens: auto;
        }

        thead .table-corner {
          background-color: var(--color-purple);
        }

        tbody th[scope="row"] {
          background-color: var(--color-light);
          border-right: 1px solid #cbbbdc;
          border-radius: 0;
          vertical-align: top;
        }

        thead .table-corner + th,
        tbody th[scope="row"] + td {
          padding-left: 30px;
        }
      }
    }

    .table-transposed {
      /* Collapsed borders do not move along with sticky cells */
      border-collapse: separate;
      border-spacing: 0;
      white-space: normal;

      tbody {
        tr {
          th[scope="row"],
          .table-corner {
            position: sticky;
            left: 0;
            z-index: 1;
            min-width: 90px;
            max-width: 155px;
            padding: 25px 10px;
            font-size: var(--font-size-small);
            border-bottom: 1px solid #cbbbdc;
            border-radius: 0;
            background-color: var(--color-purple);
            color: var(--color-white);
            text-align: left;
            vertical-align: top;
            overflow-wrap: anywhere;
            -webkit-hyphens: auto;
            hyphens: auto;
          }

          td,
          th[scope="col"] {
            min-width: 180px;
            border-radius: 0;
          }

          th[scope="col"] {
            max-width: 260px;
            padding: 25px 30px 25px 0;
            border-bottom: 1px solid #cbbbdc;
            font-weight: inherit;
            text-align: left;
          }

          td:first-child:not(.table-corner) {
            padding-left: 0;
          }

          td:last-child {
            padding-right: 30px;
          }

          th[scope="row"] + td,
          .table-corner + td,
          .table-corner + th {
            padding-left: 30px;
          }

          &:last-child {
            th[scope="row"] {
              border-bottom: none;
            }
          }
        }
      }
    }

    @media (max-width: 767.98px) {
      .table-original {
        display: none;
      }
    }

    @media (min-width: 768px) {
      .table-scroll-transposed {
        display: none;
      }
    }
  }
}
