/* Keep carousel width aligned exactly with the section container */
#browse-subject .subject-carousel-fullwidth{
  width:100% !important;
  max-width:1180px !important;
  margin:18px auto 0 !important;
  padding:0 !important;
  overflow:hidden;
}

/* Move both navigation buttons to the TOP-RIGHT */
#browse-subject .subject-carousel-side-controls{
  position:relative !important;
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center;
  gap:8px !important;
  width:100% !important;
  margin:0 0 12px 0 !important;
  padding:0 !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  transform:none !important;
  pointer-events:auto !important;
}

#browse-subject .subject-carousel-side-controls .subject-carousel-btn{
  position:relative !important;
  width:40px !important;
  height:40px !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  transform:none !important;
}

/* Remove the bottom progress bar and scroll-help text */
#browse-subject .subject-carousel-footer{
  display:none !important;
}

/* Exactly 4 subject cells visible across the section width */
#browse-subject .subject-carousel-track{
  display:grid !important;
  grid-auto-flow:column !important;
  grid-template-rows:repeat(3,84px) !important;
  grid-auto-columns:calc((100% - 42px) / 4) !important;
  gap:14px !important;
  width:100% !important;
  box-sizing:border-box !important;
  padding:4px 0 10px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
}

#browse-subject .subject-visual-card{
  width:100% !important;
  max-width:none !important;
  height:84px !important;
  min-height:84px !important;
  box-sizing:border-box !important;
  margin:0 !important;
  flex:none !important;
  scroll-snap-align:start;
}

/* Tablet: exactly 2 cards visible */
@media(max-width:900px){
  #browse-subject .subject-carousel-fullwidth{
    width:calc(100% - 40px) !important;
  }

  #browse-subject .subject-carousel-track{
    grid-auto-columns:calc((100% - 14px) / 2) !important;
  }
}

/* Mobile: exactly 1 card visible */
@media(max-width:580px){
  #browse-subject .subject-carousel-fullwidth{
    width:calc(100% - 24px) !important;
  }

  #browse-subject .subject-carousel-track{
    grid-auto-columns:100% !important;
  }

  #browse-subject .subject-carousel-side-controls .subject-carousel-btn{
    width:36px !important;
    height:36px !important;
  }
}
