/* Page boundaries are shared; components own their internal grid and vertical spacing. */
:root {
  --ch-page-width: 82rem;
  --ch-page-gutter: clamp(1rem, 3vw, 2.5rem);
}
@media screen {
  body .ch-page-frame,
  body.public-mode .ch-page-frame,
  body.public-mode .site-breadcrumb,
  body #publicChrome .site-header-inner {
    box-sizing: border-box;
    width: 100% !important;
    max-width: var(--ch-page-width) !important;
    margin-inline: auto !important;
    padding-inline: var(--ch-page-gutter) !important;
    min-width: 0;
  }
  /* The login form has a painted outer card. Align the card itself to the gutter. */
  body.public-mode .ch-page-card-frame,
  body.public-mode :is(.shop-hero, .teacher-page-hero, .account-banner) {
    box-sizing: border-box;
    width: min(calc(100% - 2 * var(--ch-page-gutter)), calc(var(--ch-page-width) - 2 * var(--ch-page-gutter))) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }
  /* The homepage already has a frame inside the SPA content area. */
  body.home-mode #page.page {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
  }
  body.public-mode .online-hero::before {
    left: calc(-1 * var(--ch-page-gutter) - max(0px, (100vw - var(--ch-page-width)) / 2));
  }
  body.public-mode :is(.teacher-page-hero,.account-banner) {
    padding-inline: var(--ch-page-gutter);
  }
  body.public-mode .shop-hero { padding-inline: 0; }
  .dashboard-shell .panel-topbar {
    padding-inline: max(var(--ch-page-gutter), calc((100% - var(--ch-page-width)) / 2 + var(--ch-page-gutter)));
  }
  .offline-course-page { padding-block: 1.5rem 4rem; }
  .offline-course-page .section-box { overflow-x:auto; }
}
