/* Mobile hardening for the public website.
   Desktop layout is preserved; mobile safeguards apply at 950px and below. */
/* Keep desktop selectors and widths controlled by the original stylesheets.
   Mobile safety overrides apply only at tablet/mobile viewport widths. */
@media(max-width:950px){
html,
body{
  max-width:100%;
  overflow-x:hidden;
}
.site-shell,
.public-header,
.public-main,
.public-footer,
.home-hero,
.home-layout,
.course-page,
.course-layout,
.course-hero,
.course-hero-inner,
.course-hero-copy,
.course-copy,
.booking-box,
.editorial-page,
.content-page{
  min-width:0;
  max-width:100%;
}
img,
video,
iframe,
svg{
  max-width:100%;
}
.course-copy,
.content-page,
.cart-page,
.checkout-form,
.footer-main,
.footer-bottom{
  overflow-wrap:anywhere;
}
.course-copy pre,
.content-page pre{
  max-width:100%;
  overflow-x:auto;
}
.course-copy table,
.content-page table{
  max-width:100%;
}
.button,
.checkout-form button,
.course-page button{
  max-width:100%;
  white-space:normal;
  text-align:center;
}
}

@media(max-width:950px){
  /* Desktop full-bleed hero uses 100vmax and can create a huge horizontal
     scroll area on portrait phones where vmax equals the screen height. */
  .course-hero{
    width:100%;
    clip-path:none!important;
    overflow:hidden;
  }
  .course-hero:before{
    inset:0!important;
  }
  .course-layout,
  .course-copy,
  .course-page .booking-box{
    min-width:0;
    max-width:100%;
  }
}

@media(max-width:700px){
  .header-inner{
    width:100%;
    max-width:100%;
  }
  .header-inner>nav{
    max-width:100vw;
    max-height:calc(100vh - 78px);
    overflow-y:auto;
    overflow-x:hidden;
  }

  /* On phones the course overview is clearer as a vertical list than as a
     desktop carousel and cannot enlarge the document width. */
  .carousel-wrap{
    max-width:100%;
    overflow:hidden;
  }
  .product-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:18px;
    overflow:visible;
    scroll-snap-type:none;
    padding-right:0;
    padding-left:0;
  }
  .product-card{
    width:100%;
    min-width:0;
    max-width:100%;
    flex:none;
  }
  .carousel-arrow{
    display:none!important;
  }

  .audience-grid{
    grid-template-columns:minmax(0,1fr);
  }
  .curriculum details,
  .curriculum summary,
  .course-questions{
    min-width:0;
    max-width:100%;
  }
  .curriculum summary{
    overflow-wrap:anywhere;
  }
  .course-questions>div{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
  }

  .course-page iframe[src*="player.vimeo.com"],
  .course-page .video-frame,
  .course-page .vimeo-consent{
    width:100%!important;
    max-width:100%!important;
  }

  .cart-row{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .cart-thumb{
    width:100%;
    height:140px;
  }
  .cart-row>form:last-child{
    justify-self:start;
  }
  .cart-total{
    gap:16px;
    flex-wrap:wrap;
  }
  .checkout-button{
    float:none;
    width:100%;
  }
  .summary{
    grid-template-columns:minmax(0,1fr) auto;
    gap:0 10px;
  }
  .summary dt,
  .summary dd{
    min-width:0;
    overflow-wrap:anywhere;
  }
  .checkout-form section,
  .participant-fields,
  .fields,
  .field{
    min-width:0;
    max-width:100%;
  }
  .checkout-form input,
  .checkout-form select,
  .checkout-form textarea,
  .quantity-form input{
    max-width:100%;
    font-size:16px;
  }
  .consents label{
    min-width:0;
  }

  .footer-main,
  .footer-bottom,
  .footer-bottom nav{
    max-width:100%;
  }
}

/* Balance two-line and three-line course titles within the mobile blue band.
   Vertical centering naturally gives shorter titles more top breathing room. */
@media(max-width:700px){
  .course-page .course-hero,
  .course-page .course-hero-inner,
  .course-page .course-hero-copy{
    height:auto;
    min-height:190px;
    box-sizing:border-box;
  }
  .course-page .course-hero-copy{
    display:flex;
    align-items:center;
    padding:28px 0;
  }

  /* Center the compact legal/copyright block and keep policy links readable. */
  .public-footer .footer-bottom{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:12px;
    padding:26px 20px 30px;
    text-align:center;
  }
  .public-footer .footer-bottom p{
    width:100%;
    max-width:440px;
    margin:0 auto;
    text-align:center;
    line-height:1.6;
  }
  .public-footer .footer-bottom nav{
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:8px 12px;
    width:100%;
    text-align:center;
  }
  .public-footer .footer-bottom nav span{
    display:none;
  }
  .public-footer .footer-bottom nav a{
    display:inline-block;
    line-height:1.5;
    text-align:center;
  }
}

@media(max-width:420px){
  .course-hero-copy h1{
    font-size:34px;
    overflow-wrap:anywhere;
  }
  .course-copy{
    padding-right:0;
    padding-left:0;
  }
  .booking-content{
    padding-right:18px;
    padding-left:18px;
  }
  .summary{
    grid-template-columns:minmax(0,1fr);
  }
  .summary dd{
    padding-top:0;
    text-align:left;
  }
}
