/* Appearance > Menus integration. Scope deliberately limited to menu markup. */
.bdh-footer-links .bdh-footer-menu,
.bdh-footer-links .bdh-footer-menu .sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bdh-footer-links .bdh-footer-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bdh-footer-links .bdh-footer-menu .sub-menu {
  padding-left: 12px;
}

/* Nested header menu items remain accessible by mouse and keyboard. */
@media (min-width: 1025px) {
  .bdh-nav .bdh-menu li.menu-item-has-children { position: relative; }
  .bdh-nav .bdh-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 130;
    min-width: 200px;
    max-width: 320px;
    list-style: none;
    margin: 0;
    padding: 9px;
    border: 1px solid var(--bdh-border, #eadde2);
    border-radius: 12px;
    background: var(--bdh-header-bg, #fff);
    box-shadow: 0 12px 30px rgba(45, 20, 29, .12);
  }
  .bdh-nav .bdh-menu li.menu-item-has-children:hover > .sub-menu,
  .bdh-nav .bdh-menu li.menu-item-has-children:focus-within > .sub-menu { display: block; }
  .bdh-nav .bdh-menu .sub-menu a {
    padding: 9px 12px !important;
    white-space: normal;
    line-height: 1.5;
  }
  .bdh-nav .bdh-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
  }
}

/* The existing mobile hamburger panel continues to own the navigation.
   Nested links are shown indented instead of being hidden behind hover. */
@media (max-width: 1024px) {
  .bdh-nav .bdh-menu .sub-menu {
    display: grid;
    gap: 5px;
    position: static;
    list-style: none;
    margin: 5px 0 7px 14px;
    padding: 0 0 0 10px;
    border-left: 2px solid var(--bdh-border, #eadde2);
  }
  .bdh-nav .bdh-menu .sub-menu li { margin: 0; }
}

/* v22: Homepage mobile menu contrast fix.
 * The homepage header uses white text over its maroon hero. When the
 * hamburger opens, that same white-text override used to make some links
 * invisible against the white mobile menu cards. Keep desktop untouched. */
@media (max-width: 1024px) {
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li > a,
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li > a:visited {
    color: #35282d !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }

  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li > a:hover,
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li > a:focus-visible,
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li.current-menu-item > a,
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li.current_page_item > a,
  body.bdh-theme .bdh-header .bdh-nav.is-open .bdh-menu li > a.is-current {
    color: var(--bdh-primary, #8b1538) !important;
    background: #f9edf2 !important;
  }
}
