/* Keep the shared header aligned to the visual viewport on every route,
   including pages whose vertical scrollbar narrows percentage widths. */
@media (max-width: 767px) and (orientation: portrait) {
  .nav-shell .site-header {
    width: calc(100vw - 40px) !important;
  }
}

@media (min-width: 768px) {
  .nav-shell .site-header {
    width: calc(100vw - 76px) !important;
  }
}

/* Tablet portrait: keep the visible tab labels between the two outside
   controls instead of letting IMAGES sit under the Property frame. */
@media (min-width: 768px) and (max-width: 1100px) and (orientation: portrait) {
  .nav-shell .property-tagline-links--global {
    left: 164px !important;
    right: 112px !important;
    width: auto !important;
    max-width: none !important;
    grid-template-columns: repeat(3, max-content) !important;
    justify-content: space-between !important;
    column-gap: 0 !important;
    transform: translateY(-50%) !important;
  }
}

/* iPhone landscape: reserve the left and right controls, then center the
   three page tabs in the remaining space. Match the non-home header height
   to the home header so both outside frames share one vertical center. */
@media (max-width: 932px) and (orientation: landscape) and (max-height: 520px) {
  .nav-shell--video .site-header {
    width: calc(100vw - max(40px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 24px))) !important;
  }

  .nav-shell:not(.nav-shell--video) .site-header {
    width: calc(100vw - max(32px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 20px))) !important;
    height: 28px !important;
    min-height: 28px !important;
    align-items: center !important;
  }

  .nav-shell .property-tagline-links--global {
    top: 50% !important;
    right: 136px !important;
    left: 152px !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    grid-template-columns: repeat(3, max-content) !important;
    justify-content: space-between !important;
    column-gap: 0 !important;
    transform: translateY(-50%) !important;
  }
}

/* Space page: remove the redundant section label and use its space for the
   approved summary and nine existing series cards. */
.space-page {
  padding-top: 80px !important;
}

.space-page .page-heading.review-heading {
  width: min(980px, calc(100% - 64px)) !important;
  margin: 0 auto 20px !important;
}

.space-page .page-heading.review-heading h1.sr-page-title,
.space-page .page-heading.review-heading > span {
  display: none !important;
}

.space-page .page-heading.review-heading .review-summary {
  margin: 0 !important;
}

@media (max-width: 767px) {
  .space-page {
    padding-top: 120px !important;
  }

  .space-page .page-heading.review-heading {
    width: calc(100% - 28px) !important;
    margin-bottom: 18px !important;
  }
}
