@media (max-width: 799px) {

  header {
    display: flex;
    flex-direction: column;
  }

  #mast-head {
    width: 15em;
    padding-left: 1.4em;
    /*padding-top: 1em;*/
  }

  #slnt-logo {
    display: block;
    /*
    display:inline-block;
    float:left;
    */
  }

  #slnt-prim-menu {
    display: block;
    /*
    display:inline-block;
    float:left; 
    */
  }

  #slnt-srch {
    display: block;
    /*
    display:inline-block;
    float:left; 
    */
  }

  #slnt-header {
    /*clear: both;*/
    width: 100%;
    /*height: 100px;*/
    opacity: 1.0;
    z-index: 10;
    background-color: var(--solent-blue);
  }

  main {
    clear: both;
  }

  /* credit: BBC iPlayer - well I pay my license fee to the glorious corporation. "It's Your BBC" */
  .sub-menu-container.animated {
    /*
    transition-property: top;
    -webkit-transition-property: top;
    transition-timing-function:
      ease;
    -webkit-transition-timing-function:
      ease;
    transition-duration: .5s;
    -webkit-transition-duration: .5s;
    */
    /*height: 64px; */
  }

  nav[role=navigation].animation {
    /*
    transition-property: height;
    -webkit-transition-property: height;
    transition-timing-function:
      ease;
    -webkit-transition-timing-function:
      ease;
    transition-duration: .5s;
    -webkit-transition-duration: .5s;
    */
    /*height: 64px; */
  }

  nav[role=navigation] {}

  .main-menu-item-container>li {
    display: block;
    white-space: nowrap;
    width: 150px;
  }

  .main-menu-item-container {
    display: block;
  }

  /*
  .main-menu-item-container {
    display: inline-block;
    column-count: 3;
    width: 200px;
  }

  .sub-menu-item-container {
    flex-direction: row;
    position: relative;
    height: 64px;
    columns: 6;
    width: auto;
    z-index: -2;

  }
  */

  .sub-menu-container {
    /* width: 100%; */
    /*right: 250px; */
    /*
    right: 0px;
    position: absolute;
    z-index: -2;
    */
    /*height: 100%;*/
  }

  /*
  .sub-menu-container.visible {
    visibility: visible;
    display: initial;
  }

  .sub-menu-container.hidden-2l {
    visibility: hidden;
    display: initial;

  }
    */

  .slnt-menu-main-ul {
    background: var(--solent-blue);
  }

  .sub-menu-container.visible {
    visibility: initial;
    display: block;
  }

  .sub-menu-container.hidden-2l {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
  }

  .sub-menu-item-container > li {
    padding-bottom: 5px;
  }

  /* Mobile submenu slide animation */
  .sub-menu-container {
    transition: max-height 0.5s ease, opacity 0.5s ease;
  }

  .main-menu-item-container > li {
    padding-bottom: 5px;
    width:100%;
  }

  /* Mobile submenu scroll fade indicators */
  .sub-menu-container.visible-2l {
    position: relative;
  }

  /* Top fade - uses sticky positioning to stay at top while scrolling */
  /* Only show if content overflows AND user has scrolled down */
  .sub-menu-container.visible-2l.has-overflow.scrolled-down::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 50px;
    margin-bottom: -50px;
    background: linear-gradient(
      to bottom,
      rgba(245, 243, 240, 1) 0%,
      rgba(245, 243, 240, 0.9) 20%,
      rgba(245, 243, 240, 0.5) 60%,
      rgba(245, 243, 240, 0) 100%
    );
    pointer-events: none;
    opacity: 1;
    z-index: 10;
    display: block;
  }

  /* Bottom fade - uses sticky positioning to stay at bottom while scrolling */
  /* Only show if content overflows AND user is NOT at bottom */
  .sub-menu-container.visible-2l.has-overflow:not(.scrolled-to-bottom)::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 50px;
    margin-top: -50px;
    background: linear-gradient(
      to bottom,
      rgba(245, 243, 240, 0) 0%,
      rgba(245, 243, 240, 0.5) 40%,
      rgba(245, 243, 240, 0.9) 80%,
      rgba(245, 243, 240, 1) 100%
    );
    pointer-events: none;
    opacity: 1;
    z-index: 10;
    display: block;
  }

  /* Adjust gradient colors for dark backgrounds */
  /* If your mobile menu overlay is dark, use these instead: */
  /*
  .slnt-overlay-menu-bg .sub-menu-container.visible-2l::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.95));
  }
  
  .slnt-overlay-menu-bg .sub-menu-container.visible-2l::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.95));
  }
  */

  /* Bigger mobile text (chevrons auto-scale via 1em units) */

  /* Submenu items: 80% of main menu size */

  .sub-menu-item-container a,
  .sub-menu-container a.first-link {
   /* padding-left: 0.3em; */
  }

  .sub-menu-items-outer-container {
  padding-left: 2.8em;
  padding-top: 1em;
  }

  .sub-menu-container a.first-link {
    text-decoration: none;
  }

    /* Mobile submenu text: keep dark blue */
    .sub-menu-item-container a,
    .sub-menu-container a.first-link,
    .sub-menu-container a {
        color: rgb(16, 60, 96);
    }

    /* Mobile main menu text: white on blue, matching desktop */
    .main-menu-item-wrapper > a.main_nav_link,
    .main-menu-item-wrapper > .main_nav_link > span {
        color: rgba(255, 255, 255, 0.85);
        transition: color 0.15s;
    }

    .main-menu-item-wrapper > a.main_nav_link:hover,
    .main-menu-item-wrapper:hover > .main_nav_link > span {
        color: #fff;
    }

    /* Mobile chevrons: white on blue */
    .navigation__link__down-icon {
        fill: rgba(255, 255, 255, 0.85);
        stroke: rgba(255, 255, 255, 0.85);
    }

    button.main_nav_link:hover .navigation__link__down-icon {
        fill: #fff;
        stroke: #fff;
    }

    /* Mobile search icon: white on blue */
    .search-menu-icon {
        stroke: rgba(255, 255, 255, 0.85);
    }

    button.main_nav_link:hover .search-menu-icon {
        stroke: #fff;
    }

    /* Mobile submenu background: warm grey (matching desktop) */
    .sub-menu-container.visible,
    .sub-menu-container.visible-2l {
        background-color: var(--warm-grey);
    }

  /* Move chevrons to the left via flex ordering */
  .navigation__link__down-icon {
    order: -1;
  }

  /* Swap span gap from right side to left side */
  button.main_nav_link > span {
    padding-right: 0;
    padding-left: 0.2em;
  }

  /* Home link -- add left padding so text aligns with dropdown items */
  a.main_nav_link {
    padding-left: calc(6px + 1.4em);
  }

  /* Move magnifying glass to the right of "Search" text on mobile */
  .search-menu-icon {
    order: 1;
    margin-right: 0;
    margin-left: 0.3em;
  }

  .navigation__link__down-icon {
    height: 0.8em;
  }




/*

https://stackoverflow.com/questions/79791175/how-to-stop-tap-highlight-blink-on-sub-menu-items-and-only-have-it-for-top-menu

*/

/* Remove pointer events from the LI containers so they don't get tap highlights */
/*
.main-menu-item-container > li {
    pointer-events: none;
}
*/
/* Re-enable pointer events on the interactive children */
/*
.main-menu-item-container > li > button.main_nav_link {
    pointer-events: auto;
}
*/

/* Ensure the entire submenu and its contents are interactive */
/*
.sub-menu-container,
.sub-menu-container * {
    pointer-events: auto;
}
*/

/* Burger menu - adjusted for solent blue background */

.slnt-togl-expand {
  color: rgba(255, 255, 255, 0.85);
  transition: all .5s ease-in-out;
  display: inline-block;
  text-decoration: none;
  position: absolute;
  right: 50px;
  top: 2.3em;
  text-align: center;
}

.slnt-togl-expand:hover {
  color: #fff;
}

.slnt-togl-expand .menu-icon {
  display: inline-block;
  position: relative;
  height: 24px;
  width: 30px;
  transition: all .3s ease-in-out;
}

.slnt-togl-expand .menu-icon:hover {
  cursor: pointer;
}

.slnt-togl-expand .menu-icon span {
  background: rgba(255, 255, 255, 0.85);
  display: block;
  height: 4px;
  width: 30px;
  position: absolute;
  transition: all .3s ease-in-out;
}

.slnt-togl-expand .menu-icon span.top {
  top: 0;
}

.slnt-togl-expand .menu-icon span.middle {
  top: 10px;
}

.slnt-togl-expand .menu-icon span.bottom {
  top: 20px;
}

.slnt-togl-expand .menu-text {
  color: rgba(255, 255, 255, 0.85);
  transition: all .3s ease-in-out;
}

.slnt-togl-expand .menu-text .icon-burger {
  display: block;
}

.slnt-togl-expand .menu-text .icon-close {
  display: none;
}

/* Hover states */
.slnt-togl-expand:hover .menu-icon span {
  background: #fff;
}

.slnt-togl-expand:hover .menu-text {
  color: #fff;
}

/* Open state */
.slnt-togl-expand.slnt-togl-expand--open .menu-icon span {
  background: rgba(255, 255, 255, 0.85);
}

.slnt-togl-expand.slnt-togl-expand--open .menu-icon span.top {
  top: 10px;
  transform: rotate(45deg);
}

.slnt-togl-expand.slnt-togl-expand--open .menu-icon span.middle {
  opacity: 0;
}

.slnt-togl-expand.slnt-togl-expand--open .menu-icon span.bottom {
  top: 10px;
  transform: rotate(-45deg);
}

.slnt-togl-expand.slnt-togl-expand--open .menu-text {
  color: rgba(255, 255, 255, 0.85);
}

.slnt-togl-expand.slnt-togl-expand--open .menu-text .icon-burger {
  display: none;
}

.slnt-togl-expand.slnt-togl-expand--open .menu-text .icon-close {
  display: block;
}

.slnt-togl-expand.slnt-togl-expand--open:hover .menu-icon span {
  background: #fff;
}

.slnt-togl-expand.slnt-togl-expand--open:hover .menu-text {
  color: #fff;
}

/* Overlay - when menu is open */
.slnt-overlay-menu-bg {
  background-color: var(--solent-blue);
  transition: all .5s ease-in-out;
  z-index: 100;
  height: 100vh;
  overflow: hidden;
}

.slnt-overlay-hdr-hgt-togl-expand-mob-menu {
  height: 100vh;
}

.slnt-hdr-hgt-init {
  height: auto;
}

/* Force scrollbar to be visible on mobile */
.sub-menu-container::-webkit-scrollbar {
  width: 8px;
}

.sub-menu-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sub-menu-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.sub-menu-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}





/* Mobile submenu indentation - beneath main items, slightly more to the right */

  ul.sub-menu-item-container {
    /* padding-left: 2em; */
  }

  .sub-menu-container > a.first-link {
    padding-inline-start: 2em;
  }

  .navigation__link__down-icon {
    height: 0.8em;
    width: 1em;
  }



  .sub-menu-item-container {
      columns: 1;
  }
}