/* P008: Size public mega dropdowns to the actual number of links.
   Content and visuals are preserved. Desktop only; mobile retains the accordion. */
@media (min-width:1181px) {
  /* One or two links: use a genuinely compact panel, not the 1060-1200px default. */
  body.school-site-body .site-header .site-nav > .nav-group.p408-mega-group.p008-mega-compact > .nav-dropdown.p408-mega {
    width:min(680px,calc(100vw - 32px))!important;
    grid-template-columns:minmax(0,1fr) 210px!important;
    max-height:min(74vh,540px)!important;
  }
  /* Three or four links: moderate panel with a narrower feature image. */
  body.school-site-body .site-header .site-nav > .nav-group.p408-mega-group.p008-mega-medium > .nav-dropdown.p408-mega {
    width:min(860px,calc(100vw - 32px))!important;
    grid-template-columns:minmax(0,1fr) 240px!important;
    max-height:min(76vh,600px)!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-content {
    padding:19px 22px 17px!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-medium .p408-mega-content {
    padding:22px 24px 19px!important;
  }
  /* Keep a true vertical list in compact menus regardless of old grid rules. */
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-links {
    display:flex!important;flex-direction:column!important;gap:0!important;
    align-items:stretch!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-links > .p408-mega-item {
    width:100%!important;max-width:100%!important;min-height:60px!important;
    grid-column:auto!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-feature,
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-medium .p408-mega-feature {
    min-height:0!important;padding:13px!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-feature > img {
    height:135px!important;width:100%!important;object-fit:cover!important;
  }
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-medium .p408-mega-feature > img {
    height:165px!important;width:100%!important;object-fit:cover!important;
  }
  /* Hide bottom dead space on sparse panels but keep every link that already exists. */
  body.school-site-body .site-header .site-nav > .nav-group.p008-mega-compact .p408-mega-bottom {
    margin-top:8px!important;padding-top:6px!important;
  }
}
