/* Middlemore 2025: mobile menu (approved by Tam 04/12/2026).
   Only below WordPress's 600px navigation breakpoint; the desktop menu is unchanged.
   Works with assets/mobile-menu.js (logo bar, current-page marker, Contact button class). */
/* The logo bar only belongs in the open mobile overlay; never show it in the desktop menu. */
.mm-header .mm-menu-brand { display: none !important; }

@media (max-width: 599px) {
  /* --- Closed header: 48x48 hamburger tap target --- */
  .mm-header .wp-block-navigation__responsive-container-open {
    width: 48px; height: 48px; margin: -12px -12px -12px 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; color: #0b3d66;
  }
  .mm-header .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
  .mm-header .wp-block-navigation__responsive-container-open:active { background: #eef4fa; }
  .mm-header .wp-block-navigation__responsive-container-open:focus:not(:focus-visible) { outline: none; }
  .mm-header .wp-block-navigation__responsive-container-open:focus-visible { outline: 3px solid #82b81b; outline-offset: -3px; }

  /* --- Overlay panel + slide-in --- */
  .mm-header .wp-block-navigation__responsive-container.is-menu-open {
    padding: 0 !important;
    background: #fff !important; color: #0b3d66 !important;
    animation: mm-menu-slide-in .28s cubic-bezier(.2,.8,.2,1) both !important;
    box-shadow: -8px 0 32px rgba(11,61,102,.18);
  }
  @keyframes mm-menu-slide-in { from { transform: translateX(100%); opacity: .6; } to { transform: none; opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .mm-header .wp-block-navigation__responsive-container.is-menu-open { animation: none !important; }
  }
  .mm-header .is-menu-open .wp-block-navigation__responsive-close,
  .mm-header .is-menu-open .wp-block-navigation__responsive-dialog { max-width: none; width: 100%; min-height: 100%; }
  .mm-header .is-menu-open .wp-block-navigation__responsive-dialog {
    display: flex; flex-direction: column; position: relative;
    padding: 0 0 calc(24px + env(safe-area-inset-bottom));
  }

  /* --- Logo bar at top --- */
  .mm-header .is-menu-open .mm-menu-brand { display: flex !important; }
  .mm-menu-brand {
    display: flex; align-items: center; gap: 12px;
    height: 72px; padding: 0 76px 0 20px !important; box-sizing: border-box; width: 100%;
    border-bottom: 1px solid #e3e9ef !important; text-decoration: none;
  }
  .mm-header .wp-block-navigation a.mm-menu-brand:hover { border-bottom-color: #e3e9ef !important; }
  .mm-menu-brand img { width: 64px; height: auto; display: block; }
  .mm-menu-brand strong { font-size: 1.15rem; font-weight: 700; color: #0b3d66; line-height: 1.1; }
  .mm-menu-brand small  { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #4a6d1c; }

  /* --- Big close button, top right --- */
  .mm-header .is-menu-open .wp-block-navigation__responsive-container-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 48px; height: 48px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #eef4fa; color: #0b3d66;
  }
  .mm-header .is-menu-open .wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; fill: currentColor; }
  .mm-header .is-menu-open .wp-block-navigation__responsive-container-close:active { background: #dbe7f2; }

  /* --- Item list: full-width 56px rows with dividers --- */
  .mm-header .is-menu-open .wp-block-navigation__responsive-container-content {
    padding: 0 !important; margin-top: 0 !important; align-items: stretch !important; flex: 1;
  }
  .mm-header .is-menu-open .wp-block-navigation__container {
    gap: 0 !important; width: 100%; align-items: stretch !important; padding: 0 !important;
  }
  .mm-header .is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid #e3e9ef; }
  .mm-header .is-menu-open .wp-block-navigation-item__content {
    display: flex !important; align-items: center; justify-content: space-between;
    min-height: 56px; padding: 0 20px !important; box-sizing: border-box; width: 100%;
    font-size: 1.125rem; font-weight: 600; color: #0b3d66 !important; text-decoration: none;
    border-left: 4px solid transparent; border-bottom: 0 !important;
  }
  .mm-header .is-menu-open .wp-block-navigation-item__content::after {
    content: ""; width: 8px; height: 8px; margin-left: 12px; flex: none;
    border-right: 2px solid #8aa3b8; border-top: 2px solid #8aa3b8; transform: rotate(45deg);
  }
  .mm-header .is-menu-open .wp-block-navigation-item__content:active { background: #f3f7fb; }
  .mm-header .is-menu-open .wp-block-navigation-item__content:focus-visible { outline: 3px solid #82b81b; outline-offset: -3px; }
  .mm-header .is-menu-open .wp-block-navigation-item__content:focus:not(:focus-visible) { outline: none; }

  /* --- Current page highlight --- */
  .mm-header .is-menu-open .wp-block-navigation-item__content[aria-current="page"],
  .mm-header .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
    background: #eef4fa; border-left-color: #82b81b; color: #0b3d66 !important; font-weight: 700;
  }

  /* --- Contact + Facebook: full-width buttons at the bottom --- */
  .mm-header .is-menu-open .mm-nav-contact,
  .mm-header .is-menu-open .mm-nav-fb { border-bottom: 0; padding: 0 20px; box-sizing: border-box; }
  .mm-header .is-menu-open .mm-nav-contact { margin-top: 28px; }
  .mm-header .is-menu-open .mm-nav-fb { margin-top: 12px; }
  .mm-header .is-menu-open .mm-nav-contact > .wp-block-navigation-item__content,
  .mm-header .is-menu-open .mm-nav-fb > .wp-block-navigation-item__content {
    justify-content: center; gap: 10px; min-height: 52px; border: 0; border-radius: 999px;
    font-size: 1.05rem; font-weight: 700;
  }
  .mm-header .is-menu-open .mm-nav-contact > .wp-block-navigation-item__content::after,
  .mm-header .is-menu-open .mm-nav-fb > .wp-block-navigation-item__content::after { display: none; }
  .mm-header .is-menu-open .mm-nav-contact > .wp-block-navigation-item__content {
    background: #0b3d66 !important; color: #fff !important;
  }
  .mm-header .is-menu-open .mm-nav-fb > .wp-block-navigation-item__content {
    background: #fff !important; color: #015998 !important; box-shadow: inset 0 0 0 2px #015998;
    padding: 0 20px !important;
  }
  .mm-header .is-menu-open .mm-nav-contact > .wp-block-navigation-item__content::before {
    content: "✉"; font-size: 1.1em; line-height: 1;
  }
  .mm-header .is-menu-open .mm-nav-fb > .wp-block-navigation-item__content::before {
    content: "f"; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; background: #015998; color: #fff;
    font: 700 15px/1 Arial, sans-serif;
  }
}
