/* Match the legacy desktop width through 1440px; retain the wide layout above it. */
:root {
  --etest-content-max-width: 1440px;
}
@media (max-width: 1440px) {
  :root {
    --etest-content-max-width: 1080px;
  }
}
@media (min-width: 768px) and (max-width: 1440px) {
  .c-partner-section .c-partner-section__container {
    width: calc(100% - 48px);
    max-width: var(--etest-content-max-width);
    margin-inline: auto;
  }
}

/* One design pixel follows the laptop container; existing mobile rules retain 1px. */
.etest-modern-page { --etest-section-unit: 1px; }
.etest-modern-page :is(.c-roadmap-section, .c-partner-section, .c-news-section, .c-form-section, .c-feature-section, .c-route-section, .c-reason-section, .free-test-section, .c-schedule-section) {
  font-size: calc(16 * var(--etest-section-unit));
}
@media (min-width: 1024px) and (max-width: 1440px) {
  .etest-modern-page {
    --etest-section-unit: min(.75px, calc((100vw - 48px) / 1440));
  }
  .etest-teachers .etest-teachers__navigation svg,
  .etest-teachers .etest-teachers__link svg,
  .etest-testimonial .etest-testimonial__navigation svg,
  .c-news-section .c-news-section__swiper-navigation svg {
    width: calc(24 * var(--etest-section-unit));
    height: calc(24 * var(--etest-section-unit));
  }
  .etest-faq .etest-faq__chevron svg {
    width: calc(18 * var(--etest-section-unit));
    height: calc(10 * var(--etest-section-unit));
  }
}
/* Editor content uses rem sizes, so scale its typography within compact modern pages too. */
@media (min-width: 1024px) and (max-width: 1440px) {
  .etest-modern-page .c-content { font-size: calc(16 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > p:not(:first-child) { margin-block-start: calc(12 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h2 { font-size: calc(24 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h3 { font-size: calc(20 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h4 { font-size: calc(18 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h2:not(:first-child) { margin-block-start: calc(24 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h3:not(:first-child) { margin-block-start: calc(20 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > h4:not(:first-child) { margin-block-start: calc(18 * var(--etest-section-unit)); }
  .etest-modern-page .c-content > :is(ul, ol) {
    margin-inline-start: calc(24 * var(--etest-section-unit));
    margin-block-start: calc(8 * var(--etest-section-unit));
  }
}

/* Course sections use the same compact desktop design unit as the modern home. */
@media (min-width: 1024px) and (max-width: 1440px) {
  .etest-modern-page .free-test-section { width: calc(100% - 48px); }
  .c-reason-section .c-reason-section__swiper-navigation svg,
  .c-route-section svg[width="24"][height="24"],
  .free-test-section .free-test-section-button-link > img {
    width: calc(24 * var(--etest-section-unit));
    height: calc(24 * var(--etest-section-unit));
  }
  .c-route-section svg[width="40"][height="40"] {
    width: calc(40 * var(--etest-section-unit));
    height: calc(40 * var(--etest-section-unit));
  }
}
@media (min-width: 1024px) and (max-width: 1440px) {
  .c-schedule-section .c-schedule-section__toggle-show-less-text-container p {
    font-size: calc(16 * var(--etest-section-unit));
    line-height: 1.5;
  }
}
