/*
 * Compatibility layer for pages that still render Newspaper/WPBakery markup.
 * It maps the existing td-container onto the KNDSB Client-First site grid.
 * Clean Gutenberg templates never receive the body class used below.
 */
.kndsb-newspaper-legacy .td-main-content-wrap {
  box-sizing: border-box;
  padding-bottom: var(--kndsb-section-medium);
  padding-top: var(--kndsb-section-medium);
  width: 100%;
}

.kndsb-newspaper-legacy .td-main-content-wrap > .td-container {
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  max-width: calc(var(--kndsb-container-main) + var(--kndsb-page-gutter) + var(--kndsb-page-gutter));
  padding-left: var(--kndsb-page-gutter);
  padding-right: var(--kndsb-page-gutter);
  width: 100%;
}

.kndsb-newspaper-legacy .td-main-content-wrap > .td-container > :first-child {
  margin-top: 0;
}

.kndsb-newspaper-legacy .td-main-content-wrap > .td-container > :last-child {
  margin-bottom: 0;
}

/*
 * Newspaper applies its own borders and header decoration to generic tables.
 * Gutenberg tables are owned by the KNDSB table component, so neutralize the
 * legacy decoration here. The KNDSB table component owns the cell borders
 * and the orange header rule directly, without a pseudo-element.
 */
.wp-block-table table {
  box-shadow: none;
}

.wp-block-table thead::before,
.wp-block-table thead::after,
.wp-block-table thead tr::before,
.wp-block-table thead tr::after,
.wp-block-table thead th::before,
.wp-block-table thead th::after {
  content: none;
  display: none;
}

@media (max-width: 767px) {
  .kndsb-newspaper-legacy .td-main-content-wrap {
    padding-bottom: var(--kndsb-section-small);
    padding-top: var(--kndsb-section-small);
  }
}
