/* SafaSoch V13.1.4 — Mobile Programme Carousel + Accessibility Polish
   Fixes the homepage course-card squeeze caused by the generic responsive min-width reset.
   Keeps the skip link accessible but fully hidden until keyboard focus.
   Improves the mobile WhatsApp affordance without covering primary card copy. */

/* Accessibility: completely remove the skip link from the visual canvas until it is focused.
   This is deliberately stronger than the legacy transform-only hiding rule for iOS Safari. */
body.ss-brand-system .skip:not(:focus):not(:focus-visible),
body.hi-body .skip:not(:focus):not(:focus-visible){
  position:fixed!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  padding:0!important;
  margin:-1px!important;
  border:0!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
  left:-10000px!important;
  top:auto!important;
  transform:none!important;
}
body.ss-brand-system .skip:focus,
body.ss-brand-system .skip:focus-visible,
body.hi-body .skip:focus,
body.hi-body .skip:focus-visible{
  position:fixed!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  left:max(14px,env(safe-area-inset-left))!important;
  top:max(14px,env(safe-area-inset-top))!important;
  transform:none!important;
  clip:auto!important;
  clip-path:none!important;
  overflow:visible!important;
  white-space:nowrap!important;
  margin:0!important;
  padding:12px 16px!important;
  border:1px solid rgba(3,44,35,.18)!important;
  border-radius:12px!important;
  background:#e2b955!important;
  color:#032c23!important;
  font-weight:850!important;
  z-index:10000!important;
  box-shadow:0 14px 36px rgba(3,44,35,.18)!important;
}

/* Homepage course rail: one usable card + a clear preview of the next card. */
@media (max-width:760px){
  body.page-index.ss-brand-system .sshome23-course-grid{
    display:flex!important;
    grid-template-columns:none!important;
    flex-wrap:nowrap!important;
    gap:14px!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-snap-type:x mandatory!important;
    scroll-padding-inline:0!important;
    padding:0 0 14px!important;
    margin:0!important;
    scrollbar-width:none!important;
    touch-action:pan-x pan-y!important;
  }
  body.page-index.ss-brand-system .sshome23-course-grid::-webkit-scrollbar{display:none!important}

  body.page-index.ss-brand-system .sshome23-course-card,
  body.page-index.ss-brand-system .sshome23-course-card.featured{
    display:flex!important;
    flex-direction:column!important;
    flex:0 0 min(86vw,390px)!important;
    width:min(86vw,390px)!important;
    min-width:min(86vw,390px)!important;
    max-width:min(86vw,390px)!important;
    min-height:0!important;
    height:auto!important;
    grid-column:auto!important;
    grid-template-columns:none!important;
    scroll-snap-align:start!important;
    scroll-snap-stop:always!important;
    border-radius:22px!important;
  }

  body.page-index.ss-brand-system .sshome23-course-card.featured .sshome23-course-image,
  body.page-index.ss-brand-system .sshome23-course-image{
    flex:0 0 220px!important;
    width:100%!important;
    min-width:100%!important;
    height:220px!important;
    min-height:220px!important;
  }
  body.page-index.ss-brand-system .sshome23-course-body{
    flex:1 1 auto!important;
    min-width:0!important;
    min-height:250px!important;
    padding:24px 22px 22px!important;
  }
  body.page-index.ss-brand-system .sshome23-course-body h3,
  body.page-index.ss-brand-system .sshome23-course-card.featured h3{
    font-size:clamp(27px,7.5vw,32px)!important;
    line-height:1.06!important;
    margin:12px 0 14px!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  body.page-index.ss-brand-system .sshome23-course-body p{
    font-size:15px!important;
    line-height:1.56!important;
    margin-bottom:18px!important;
  }
  body.page-index.ss-brand-system .sshome23-course-body b{margin-top:auto!important}

  /* Keep the floating WA control close to the device edge and clear of core card copy. */
  body.ss-brand-system .wa{
    right:max(8px,env(safe-area-inset-right))!important;
    bottom:max(82px,calc(env(safe-area-inset-bottom) + 18px))!important;
    width:50px!important;
    height:50px!important;
    min-width:50px!important;
    border:2px solid rgba(255,255,255,.82)!important;
    box-shadow:0 10px 28px rgba(0,0,0,.18)!important;
  }
}

@media (max-width:390px){
  body.page-index.ss-brand-system .sshome23-course-card,
  body.page-index.ss-brand-system .sshome23-course-card.featured{
    flex-basis:88vw!important;
    width:88vw!important;
    min-width:88vw!important;
    max-width:88vw!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.page-index.ss-brand-system .sshome23-course-grid{scroll-behavior:auto!important}
}
