/* header.css - topbar, masthead, primary navigation */

.topbar {
  background: var(--blue-dark);
  color: #cfdcee;
  font-size: var(--fs-micro);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
}

.topbar__contact,
.topbar__social {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
}

.topbar__contact a,
.topbar__social a { color: #cfdcee; }
.topbar__contact a:hover,
.topbar__social a:hover { color: var(--white); text-decoration: none; }

.topbar__social { gap: 14px; }
.topbar__social svg { display: block; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.masthead.is-stuck { box-shadow: var(--shadow); }

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 68px;
  padding-block: 9px;
}

.brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Fixed box, not a fixed width. The supplied logo is 122 x 46, so this
   renders it at close to native size and stays sharp. object-fit keeps a
   larger replacement file correct without touching this rule. */
.brand img {
  width: 132px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

.brand:hover { text-decoration: none; }

.primary-nav { margin-left: auto; }

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.primary-nav__item { position: relative; }

.primary-nav__link {
  display: block;
  padding: 10px 11px;
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: var(--w-ui);
  letter-spacing: .01em;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}

.primary-nav__link:hover,
.primary-nav__link.is-active {
  color: var(--green-dark);
  background: var(--green-soft);
  text-decoration: none;
}

.has-children > .primary-nav__link { padding-right: 22px; }

.submenu-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.submenu-toggle::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s var(--ease);
}

.submenu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 268px;
  margin: 0;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}

.has-children:hover > .submenu,
.has-children:focus-within > .submenu,
.has-children.is-open > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu a {
  display: block;
  padding: 8px 12px;
  font-size: var(--fs-small);
  color: var(--ink);
  border-radius: 6px;
}
.submenu a:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
  text-decoration: none;
}

.masthead__cta { flex-shrink: 0; }

.navtoggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 9px 14px;
  background: var(--green);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: var(--w-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.navtoggle__bars,
.navtoggle__bars::before,
.navtoggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.navtoggle__bars { position: relative; }
.navtoggle__bars::before,
.navtoggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.navtoggle__bars::before { top: -6px; }
.navtoggle__bars::after  { top: 6px; }
