/* Header menus open centered under the menu word the mouse (or keyboard) is on, and always stay fully inside the
   window with a 12px margin (Troy, Nov 26, 2026). One file for the Northwest Realty Source and Troy Doty Homes site
   pages and for the search pages of all three sites. menu-center.js nudges a panel sideways (--mc-dx) only when
   centering would push it past the window edge. Phone menus are not touched. */

/* Northwest Realty Source: desktop menu (the phone menu is separate markup) */
nav[aria-label="Main"] .mm > .mm-p {
  left: 50%;
  right: auto;
  transform: translateX(calc(-50% + var(--mc-dx, 0px)));
  max-width: calc(100vw - 24px);
}

/* Troy Doty Homes: desktop menu from 1021px (below that it is the fold-out phone menu) */
@media (min-width: 1021px) {
  .nav .dd > .ddm {
    left: 50%;
    right: auto;
    transform: translateX(calc(-50% + var(--mc-dx, 0px)));
    max-width: calc(100vw - 24px);
  }
}

/* Portland Veteran Homes search pages (the header box): the site pages already center with their own menu script */
@media (min-width: 992px) {
  :host(.site-hdr-pvh) #pvh-menu .pvh-navlist > .dropdown > .dropdown-menu.pvh-mm {
    left: 50% !important;
    right: auto !important;
    transform: translateX(calc(-50% + var(--mc-dx, 0px)));
    max-width: calc(100vw - 24px);
  }
}
