/* NathanM11MC: integrated dropdowns matching the existing site-v3.css navigation.
   No inline style, remote dependencies or CSP exceptions required. */
.nm-nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* The top-level category must have exactly the same box metrics as the
   adjacent .nm-nav-link anchors defined in site-v3.css. The old dropdown
   wrapper added a 2px border and a min-height, while the button used a
   fixed 1.45 line-height. That made categories sit out of alignment. */
.nm-nav-dropdown-head {
  display: inline-flex;
  align-items: stretch;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  transition: background-color .16s, box-shadow .16s;
}
.nm-nav-dropdown .nm-nav-dropdown-head > .nm-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #dee9db;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}
/* A linked parent and its separate chevron form one visual link group. */
.nm-nav-dropdown .nm-nav-dropdown-head > .nm-nav-link:not(.nm-nav-heading) {
  padding-right: 3px;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.nm-nav-dropdown-head > .nm-nav-chevron-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 0 5px;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: transparent;
  color: #dee9db;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
/* Inset borders do not change the category's measured height/vertical
   centring, unlike the previous real border on .nm-nav-dropdown-head. */
.nm-nav-dropdown.nm-open > .nm-nav-dropdown-head,
.nm-nav-dropdown:hover > .nm-nav-dropdown-head,
.nm-nav-dropdown:focus-within > .nm-nav-dropdown-head {
  background: #173547;
  box-shadow: inset 0 0 0 1px #2f7093;
}
.nm-nav-dropdown.nm-group-active > .nm-nav-dropdown-head {
  background: #1f4e69;
  box-shadow: inset 0 0 0 1px #4cbce4, inset 0 -3px #12384a;
}
.nm-nav-dropdown .nm-nav-dropdown-head > .nm-nav-link.nm-active {
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.nm-nav-dropdown .nm-nav-dropdown-head:hover > :is(a,button),
.nm-nav-dropdown.nm-open .nm-nav-dropdown-head > :is(a,button) {
  color: #fff;
}
.nm-dropdown-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .85;
  transition: transform .15s ease;
}
.nm-nav-dropdown.nm-open .nm-dropdown-chevron,
.nm-nav-dropdown:hover .nm-dropdown-chevron,
.nm-mobile-submenu[open] > summary .nm-dropdown-chevron {
  transform: translateY(1px) rotate(225deg);
}

/* Sit directly below the parent: NO empty pointer gap between trigger and
   submenu. Reuse the site's dark spruce/grid background and square corners. */
.nm-nav-dropdown-panel {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 70;
  display: block;
  width: max-content;
  min-width: max(196px, 100%);
  max-width: min(320px, 90vw);
  max-height: 72vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid #2f7093;
  border-top: 3px solid #4cbce4;
  border-radius: 3px;
  background-color: #102219;
  background-image: linear-gradient(#24453122 1px, transparent 1px), linear-gradient(90deg, #24453122 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: 0 5px 0 #101f1640, 0 12px 28px #06140d77;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity .13s ease, transform .13s ease, visibility 0s linear .13s;
}
/* Last items may be near the edge of the screen. */
.nm-nav-links > .nm-nav-dropdown:nth-last-child(-n+2) > .nm-nav-dropdown-panel {
  left: auto;
  right: 0;
}
.nm-nav-dropdown.nm-open > .nm-nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .13s ease, transform .13s ease, visibility 0s;
}

/* CSS hover fallback: submenu opens without ANY click even if the JS was
   delayed by browser caching. Touchscreens continue using the JS toggle. */
@media (hover: hover) and (pointer: fine) {
  .nm-nav-dropdown:hover:not(.nm-escape-closed) > .nm-nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity .13s ease, transform .13s ease, visibility 0s;
  }
}

.nm-nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #dee9db;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.nm-nav-dropdown-item:hover,
.nm-nav-dropdown-item:focus-visible {
  background: #173547;
  border-color: #2f7093;
  color: #fff;
}
.nm-nav-dropdown-item.nm-active {
  background: #1f4e69;
  border-color: #4cbce4;
  color: #fff;
  box-shadow: inset 0 -3px #12384a;
}
/* The extra diagonal arrow icons contributed to the mismatched look. */
.nm-dropdown-item-arrow { display: none; }
.nm-nav-dropdown :is(a,button):focus-visible {
  outline: 2px solid #85e3ff;
  outline-offset: 2px;
}

/* Mobile retains an explicit tap-to-expand menu: hover is not meaningful. */
.nm-mobile-menu .nm-menu-panel {
  width: min(360px, 92vw);
  max-height: 78vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nm-mobile-item,
.nm-mobile-submenu > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 3px;
  color: #e9f4fb;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.nm-mobile-item:hover,
.nm-mobile-submenu > summary:hover,
.nm-mobile-submenu-items > a:hover { background: #244b60; }
.nm-mobile-submenu > summary { list-style: none; }
.nm-mobile-submenu > summary::-webkit-details-marker { display: none; }
.nm-mobile-submenu[open] > summary {
  background: #1f4e69;
  color: #fff;
}
.nm-mobile-submenu-items {
  margin: 4px 0 8px 8px;
  padding: 3px 0 4px 10px;
  border-left: 2px solid #4cbce4;
}
.nm-mobile-submenu-items > a {
  display: block;
  padding: 10px 12px;
  border-radius: 3px;
  color: #d6eaf5;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
}
.nm-mobile-submenu-items > a.nm-active,
.nm-mobile-item.nm-active {
  background: #1f4e69;
  color: #fff;
}
.nm-mobile-action {
  margin-top: 5px;
  border-top: 1px solid #42738e;
}
@media (prefers-reduced-motion: reduce) {
  .nm-nav-dropdown-panel,
  .nm-dropdown-chevron,
  .nm-nav-dropdown-item { transition: none; }
}
