/*!
 * Nav dropdown support — adds submenu behaviour to the existing header nav.
 * Purely functional/structural: reuses the header's current colours, fonts and
 * spacing tokens (--bc-*), no restyle of the header itself.
 */
.bc-nav__item--dropdown {
  position: relative;
}
.bc-nav__item--dropdown > .bc-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.bc-nav__item--dropdown > .bc-nav__link::after {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.bc-nav__submenu {
  list-style: none;
  margin: 0;
  padding: var(--bc-space-2);
  display: none;
  flex-direction: column;
  gap: 0.1rem;
}

.bc-nav__submenu-link {
  display: block;
  padding: var(--bc-space-2) var(--bc-space-3);
  border-radius: var(--bc-radius-sm);
  font-family: var(--bc-font-body);
  font-weight: 500;
  font-size: var(--bc-fs-sm);
  color: var(--bc-primary);
  text-decoration: none;
  white-space: nowrap;
}
.bc-nav__submenu-link:hover,
.bc-nav__submenu-link:focus-visible {
  background: var(--bc-primary-light);
  color: var(--bc-primary-dark);
}

/* Desktop: hover/focus reveal as a floating panel under the parent item */
@media (min-width: 861px) {
  .bc-nav__item--dropdown > .bc-nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--bc-white);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow);
    z-index: 50;
    max-height: 70vh;
    overflow-y: auto;
  }
  .bc-nav__item--dropdown:hover > .bc-nav__submenu,
  .bc-nav__item--dropdown:focus-within > .bc-nav__submenu {
    display: flex;
  }
  /* Services Areas has 28 items — let it wrap into columns so it doesn't run off-screen.
     Selectors here are deliberately more specific than the base .bc-nav__submenu rule
     above (3 class-weight vs 2) so these values win outright rather than depending on
     source order. */
  .bc-nav__item--dropdown > .bc-nav__submenu.bc-nav__submenu--wide {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    width: 560px;
    min-width: 560px;
    max-width: 90vw;
  }
  .bc-nav__item--dropdown:hover > .bc-nav__submenu.bc-nav__submenu--wide,
  .bc-nav__item--dropdown:focus-within > .bc-nav__submenu.bc-nav__submenu--wide {
    display: flex;
  }
  .bc-nav__submenu--wide .bc-nav__submenu-link {
    flex: 1 1 50%;
    min-width: 0;
    white-space: normal;
  }
}

/* Mobile/tablet: no hover, so the submenu is simply always expanded (nested indented
   list) inside the already-expanded mobile menu — no extra tap-to-toggle JS needed. */
@media (max-width: 860px) {
  .bc-nav__submenu {
    display: flex;
    padding-left: var(--bc-space-4);
    border-left: 2px solid var(--bc-border);
    margin-left: var(--bc-space-2);
    margin-top: var(--bc-space-1);
    margin-bottom: var(--bc-space-2);
  }
  .bc-nav__item--dropdown > .bc-nav__link::after {
    display: none;
  }
}
