/* /test — vertical hero + next block, no horizontal track */

body.jsWrapper {
  /* from-960 makes body a row flex; stretch was forcing .container to 100vh */
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  /* Avoid fighting with JS scrollTo({ behavior: "smooth" }) — was overshooting */
  scroll-behavior: auto;
}

body.jsWrapper .container {
  display: block !important;
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 100svh;
  overflow: visible !important;
  align-self: stretch;
}

/* Full-viewport sections on large screens; unlock on smaller to avoid clipping */
body.jsWrapper .mainSection.titleScreen {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100svh !important;
  min-height: 100svh !important;
  max-height: 100svh;
  box-sizing: border-box;
}

body.jsWrapper .titleScreen:before {
  display: none;
}

body.jsWrapper .progressBar,
body.jsWrapper .titleScreen .footerPart {
  display: none !important;
}

body.jsWrapper .mainSection.testQlist,
body.jsWrapper .mainSection.testHow,
body.jsWrapper .mainSection.testManifesto,
body.jsWrapper .mainSection.ql-reviews,
body.jsWrapper .mainSection.faq {
  flex: none !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.jsWrapper .mainSection.testManifesto,
body.jsWrapper .mainSection.ql-reviews,
body.jsWrapper .mainSection.faq {
  display: block !important;
  min-height: 0 !important;
}

/* Tablet + phone: keep first screen fullscreen; qlist follows content */
@media screen and (max-width: 1280px) {
  body.jsWrapper .mainSection.testQlist {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* Phone + tablet: first screen stays fullscreen; other sections follow content */
@media screen and (max-width: 959px) {
  body.jsWrapper {
    padding-left: 0;
  }

  body.jsWrapper .container {
    min-height: 0;
  }

  body.jsWrapper .mainSection.titleScreen {
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: 100svh !important;
  }

  /* When an anketa is selected (desktop), allow the first screen to grow/scroll */
  body.jsWrapper .mainSection.titleScreen:has(.titlePart.is-detail) {
    height: auto !important;
    min-height: 100svh !important;
    max-height: none !important;
  }

  body.jsWrapper .mainSection.testQlist,
  body.jsWrapper .mainSection.testHow {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* Short laptop viewports: don’t clip the first frame */
@media screen and (max-height: 800px) and (min-width: 960px) {
  body.jsWrapper .mainSection.titleScreen {
    height: auto !important;
    min-height: 100svh !important;
    max-height: none !important;
  }
}
