/* Long legal words must fit their text track without changing the published copy. */
.terms-and-condition :is(h2, h3, h4, h5, h6) {
  overflow-wrap: anywhere;
}

/* Keep authored masthead spacing, with a measured floor for short/zoomed viewports. */
main[data-barba="container"] :is(.faq-header, .registration-header, .speakers-header) {
  padding-top: max(calc(25 * var(--vh, 1vh)), calc(var(--site-header-offset, var(--nav-bar-height, 8rem)) + 1rem));
}

/* All seven co-host introductions must grow beyond a single short viewport. */
.partners-header.is--ogdc {
  height: auto;
  min-height: 100svh;
  padding-top: max(calc(25 * var(--vh, 1vh)), calc(var(--site-header-offset, var(--nav-bar-height, 8rem)) + 1rem));
  padding-bottom: clamp(3rem, 8vw, 8rem);
}

/* Authentic co-host marks occupy their own track rather than covering the introduction. */
.partners-header.is--ogdc > .container {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.partners-header.is--ogdc :is(.awards-header__row-title, .awards-header__row-text) { grid-column: 1; }
.partners-header.is--ogdc .awards-header__row-image { grid-column: 2; grid-row: 1 / span 2; padding-top: 0; }
.partners-header.is--ogdc .awards-header-image.is--partner { position: relative; inset: auto; width: min(100%, 20rem); }
.partners-header.is--ogdc .awards-header-image__before { padding-top: 0; }
.partners-header.is--ogdc .awards-header-image__img { position: relative; width: 100%; max-height: 18rem; height: auto; object-fit: contain; }
@media (max-width: 991px) {
  .partners-header.is--ogdc > .container { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .partners-header.is--ogdc .awards-header__row-image { grid-column: 1; grid-row: auto; }
}

.cpec-interest-page .main-wrap {
  padding-top: var(--site-header-offset, var(--nav-bar-height, 8rem));
}

html[data-header-mode="static"] main[data-barba="container"] :is(.faq-header, .registration-header, .speakers-header) {
  padding-top: calc(25 * var(--vh, 1vh));
}

html[data-header-mode="static"] .partners-header.is--ogdc {
  padding-top: calc(25 * var(--vh, 1vh));
}

html[data-header-mode="static"] .cpec-interest-page .main-wrap {
  padding-top: 0;
}

/* The header can wrap; a fixed subtraction cannot describe its available body space. */
.roster-preview-dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: min(82svh, 820px);
}

.roster-preview-dialog__head {
  flex-shrink: 0;
}

.roster-preview-dialog__head > div {
  min-width: 0;
}

.roster-preview-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* Keep the biography text track shrinkable without changing the factual photo. */
.schedule-bio__body > * {
  min-width: 0;
}

.schedule-bio__body > div {
  overflow-wrap: anywhere;
}

.schedule-bio {
  overflow: auto;
  overscroll-behavior: contain;
}

/* Desktop captions can exceed the lightbox's existing viewport cap as well. */
.archive-lightbox__inner {
  overflow: auto;
  overscroll-behavior: contain;
}

.planner-filters {
  max-width: calc(100vw - 40px);
}

/* At narrow widths/short heights an open filter belongs in the scrolling page. */
@media (max-width: 767px), (max-height: 620px) {
  .programme-tools {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .programme-filter[open] {
    flex-basis: 100%;
  }

  .programme-filter[open] .planner-filters {
    position: static;
    width: 100%;
    max-width: none;
  }
}

@media (max-height: 620px) {
  /* The six category controls should scroll with the FAQ at high zoom/landscape. */
  .faq-content__sticky {
    position: relative;
    top: 0;
  }
}

@media (max-height: 500px) {
  /* A very tall header must remain reachable too; scroll the whole native dialog. */
  .roster-preview-dialog[open] {
    display: block;
    max-height: calc(100svh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .roster-preview-dialog__body {
    overflow: visible;
  }
}
