/* Mobile public pages share one gutter and viewport-wide horizontal shelves. */
@media (max-width:991.98px) {
  :root { --ta-mobile-gutter:14px; }

  body #masthead #nav-main { padding-inline:0; }
  body #masthead #nav-main>.container {
    width:100%;
    padding-inline:var(--ta-mobile-gutter);
  }
  body #masthead .nav-toggler {
    touch-action:manipulation;
    transition:background-color .12s ease,transform .12s ease;
  }
  body #masthead .nav-toggler:active { transform:scale(.96); }
  body #masthead .nav-toggler svg line {
    transition:transform .13s cubic-bezier(.2,.7,.2,1),opacity .08s linear;
  }
  body>#offcanvas-navbar { transition:opacity .14s ease-out,visibility .14s; }
  body>#offcanvas-navbar .offcanvas-body {
    transform:translateY(-6px);
    transition:transform .14s cubic-bezier(.2,.7,.2,1);
  }
  body>#offcanvas-navbar:is(.show,.showing) .offcanvas-body { transform:translateY(0); }
  body>#offcanvas-navbar.hiding .offcanvas-body { transform:translateY(-6px); }
  body>#offcanvas-navbar .ta-menu-view {
    transition:transform .17s cubic-bezier(.2,.7,.2,1),opacity .13s ease;
  }
}

@media (max-width:767.98px) {
  /* The header's spacer is the only offset above the homepage hero. */
  body #masthead #nav-main>.container { max-width:none; }
  body.home #page #content.ta-fp-content { margin-top:0!important; }
  body.home #content.ta-fp-content>#primary>.container,
  body.home :is(.ta-fp-community-container,.ta-fp-testimonials-container,.ta-fp-premium-container).container {
    width:100%;
    max-width:none;
    padding-inline:var(--ta-mobile-gutter)!important;
  }
  body .teachacademy-store-single { width:100%; max-width:none; padding-inline:var(--ta-mobile-gutter); }
  body.single-product .single-product-container { padding-inline:0!important; }
  body.single-product .single-product-container>.container { padding-inline:var(--ta-mobile-gutter)!important; }

  body.home .ta-home-hero__community { padding:12px var(--ta-mobile-gutter); }
  body.home .ta-home-hero__stats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    flex:1 1 100%;
    gap:0;
    width:100%;
    padding:10px 4px;
    border:1px solid #dce6df;
    border-radius:12px;
    background:#ffffffbf;
    text-align:center;
  }
  body.home .ta-home-hero__stats>div { align-items:center; justify-content:center; min-width:0; padding-inline:4px; }
  body.home .ta-home-hero__stats>div+div { border-inline-start:1px solid #e2e9e3; }
  body.home .ta-home-hero__stats dd { font-size:18px; line-height:1.35; }
  body.home .ta-home-hero__stats dt { font-size:10px; line-height:1.4; }

  body .ta-explore-hero__stats {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:0;
    width:100%;
    margin-top:14px;
    padding:9px 4px;
    border:1px solid #dce6df;
    border-radius:11px;
    background:#f8faf7;
    text-align:center;
  }
  body .ta-explore-hero__stats>:is(span,a) { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px; min-width:0; min-height:34px; padding:3px 6px; color:#63786a; line-height:1.5; text-decoration:none; }
  body .ta-explore-hero__stats>*+* { border-inline-start:1px solid #e2e9e3; }

  /* These are horizontal tracks; the normal two-column product grids stay intact. */
  body.home .ta-fp-primary-content #main .ta-fp-feed>.ta-fp-module { overflow:visible; }
  body #page :is(.ta-fp-categories,.ta-popular-subcats,.ta-fp-review-board__track,.ta-premium-creators-grid),
  body #page .ta-fp-creator-strip,
  body #page .ta-category-stream__products,
  body #page .ta-shop-monthly-top .ta-shop-monthly-top__list,
  body #page .teachacademy-store-single .ta-store-leaderboard-products>.products,
  body.single-product #page .ta-product-carousel.is-carousel>.products {
    box-sizing:border-box;
    width:100vw!important;
    min-width:0!important;
    max-width:none!important;
    margin-inline:calc(50% - 50vw)!important;
    padding-inline:var(--ta-mobile-gutter)!important;
    scroll-padding-inline:var(--ta-mobile-gutter);
    scroll-snap-type:none!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
  }
  body .teachacademy-store-single .ta-store-leaderboard-products>.products>* { scroll-snap-align:none; }
  body.single-product .ta-product-carousel.is-carousel>.products { grid-auto-columns:calc((100vw - 2 * var(--ta-mobile-gutter) - 12px)/2); }
}

@media (prefers-reduced-motion:reduce) {
  body #masthead .nav-toggler,
  body #masthead .nav-toggler svg line,
  body>#offcanvas-navbar,
  body>#offcanvas-navbar .offcanvas-body,
  body>#offcanvas-navbar .ta-menu-view { transition:none; }
}
