/* Stellar Sleep — header nav additions (hand-maintained, no Webflow dependency).
   Loaded after the Webflow stylesheets so these rules win the cascade.
   Behaviour: css/stellar-nav.css + js/stellar-nav.js only. Nothing here relies on
   webflow.js — hover opening is pure CSS, so the menu still works if JS fails. */

.nav-dropdown {
  position: relative;
  z-index: 900;
  display: inline-block;
}

/* The toggle is a real <button> for keyboard + screen-reader support, so the
   browser's default button chrome has to be stripped back to nav-link styling.
   Colour/size come from .nav-link (and .text-color-black on light headers). */
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* font-family only: buttons fall back to the UA font (Arial) and would not
     inherit Cabin. Do NOT add font-size/font-weight/line-height/color here —
     this file loads after the site CSS, so those would override .nav-link and
     the toggle would stop matching its sibling links. line-height: inherit in
     particular gave the button the body's 1.5 (24px) against .nav-link's 19px,
     which dropped the label below the other nav items. */
  font-family: inherit;
}

.nav-dropdown-caret {
  width: 0.625rem;
  height: 0.625rem;
  flex: none;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-list {
  display: none;
  min-width: 13rem;
  padding: 0.5rem;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(31, 45, 40, 0.14);
}

.nav-dropdown-link {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: 7px;
  color: #1f2d28;
  font-family: Cabin, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible {
  background-color: #f1f6ee;
  color: #1f2d28;
}

.nav-dropdown-link.is-current {
  font-weight: 700;
  color: #1f2d28;
}

/* Toggle marks the active section when the current page lives inside Company. */
.nav-dropdown-toggle.is-current {
  font-weight: 700;
}

/* ---- Desktop: floating panel, opens on hover / focus / click ---- */
@media screen and (min-width: 992px) {
  .nav-dropdown-list {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
  }

  /* Invisible bridge across the gap between toggle and panel so moving the
     pointer down does not break :hover and snap the menu shut. Done with a
     pseudo-element rather than top padding on the panel itself: box-shadow
     follows the border box, so a padded box would draw a halo around the
     transparent strip. */
  .nav-dropdown-list::before {
    content: "";
    position: absolute;
    top: -0.75rem;
    left: 0;
    right: 0;
    height: 0.75rem;
  }

  /* :hover is the no-JS fallback for mouse users; .is-open covers click and
     keyboard. Deliberately no :focus-within — it would keep the panel visible
     after Escape (which returns focus to the toggle) and strand the user. */
  .nav-dropdown:hover .nav-dropdown-list,
  .nav-dropdown.is-open .nav-dropdown-list {
    display: block;
  }
}

/* ---- Mobile (<=991px): navbar collapses to the white hamburger card.
   No hover; tap to expand, and the panel sits in normal flow so it pushes the
   menu open instead of overlaying it. Colours match the mobile .nav-link rule. ---- */
@media screen and (max-width: 991px) {
  .nav-dropdown {
    width: 100%;
    text-align: center;
  }

  .nav-dropdown-toggle {
    justify-content: center;
    width: 100%;
    font-size: 19px;
  }

  .nav-dropdown.is-open .nav-dropdown-list {
    display: block;
  }

  .nav-dropdown-list {
    position: static;
    min-width: 0;
    width: 100%;
    padding: 0.25rem 0;
    background-color: #0000;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown-link {
    padding: 0.5rem 0;
    color: #6b6b6b;
    font-size: 17px;
    text-align: center;
    white-space: normal;
  }

  .nav-dropdown-link:hover,
  .nav-dropdown-link:focus-visible {
    background-color: #0000;
    color: #000;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-caret,
  .nav-dropdown-link {
    transition: none;
  }
}
