/* Each header zone owns its space; navigation never uses viewport offsets. */
.site-header > .masthead {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 224px;
  column-gap: 40px;
  align-items: center;
  width: min(1360px, calc(100% - 80px));
  margin-inline: auto;
  height: 100px;
}
.site-header > .masthead > .brand {
  display: flex;
  margin: 0;
  width: 174px;
}
.site-header > .masthead > .brand img {
  display: block;
  width: 174px;
  height: 55px;
  object-fit: contain;
  filter: none;
}
.site-header > .masthead > .brand .brand-logo-white { display: none; }
.home-header:not(.expanded):not(.scrolled) > .masthead > .brand .brand-logo-color { display: none; }
.home-header:not(.expanded):not(.scrolled) > .masthead > .brand .brand-logo-white { display: block; }
.site-header > .masthead > nav {
  position: static;
  inset: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 90px;
  min-width: 0;
  margin: 0;
}
.site-header > .masthead > nav > .nav-link {
  flex: 0 0 auto;
  font-size: 17px;
  white-space: nowrap;
  padding: 0;
}
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}
.site-header .header-tools > .language-inline {
  margin: 0;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 12px;
}
.site-header .header-tools > .icon-button {
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  padding: 4px;
}
.site-header .mega-inner {
  width: min(850px, calc(100% - 80px));
  margin-inline: auto;
}
@media (max-width: 1100px) {
  .site-header > .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
    height: 76px;
    width: calc(100% - 40px);
  }
  .site-header > .masthead > nav { display: none; }
  .site-header > .masthead > .brand,
  .site-header > .masthead > .brand img { width: 130px; }
  .site-header > .masthead > .brand img { height: 44px; }
  .site-header .mega, .site-header .search-panel { top: 76px; }
  .site-header .mega-inner {
    width: calc(100% - 40px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
  .site-header .mega-column strong { display: block; }
}
@media (max-width: 480px) {
  .site-header > .masthead { column-gap: 12px; }
  .site-header > .masthead > .brand,
  .site-header > .masthead > .brand img { width: 102px; }
  .header-tools { gap: 8px; }
  .site-header .header-tools > .language-inline { gap: 6px; font-size: 11px; }
  .site-header .header-tools > .icon-button { flex-basis: 24px; width: 24px; min-width: 24px; }
}
/* Desktop uses the primary navigation; keep the compact-screen menu accessible. */
@media (min-width: 1101px) {
  .site-header .header-tools > .menu-toggle { display: none; }
}

/* Language disclosure stays anchored to its button at every screen width. */
.language-picker { position: relative; flex: 0 0 auto; }
.site-header .language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 4px;
  background: transparent;
  color: inherit;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.site-header .language-toggle:hover { background: transparent; transform: none; }
.language-toggle:focus-visible, .language-options a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.language-caret { transition: transform .2s ease; }
.language-toggle[aria-expanded="true"] .language-caret { transform: rotate(180deg); }
.language-options {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  width: 176px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #333;
  box-shadow: 0 12px 32px #0002;
  animation: language-slide-down .2s ease-out;
}
.language-options[hidden] { display: none; }
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
}
.language-options a:hover { background: #f4f5f6; }
.language-options a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.language-options a[aria-current="page"]::after { content: "\2713"; }
@keyframes language-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
  .site-header .language-toggle { gap: 5px; font-size: 12px; }
  .language-globe { width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .language-options { animation: none; }
  .language-caret { transition: none; }
}

/* Match each desktop submenu to its parent label, retaining the 90px gaps. */
@media (min-width: 1101px) {
  .site-header .mega-inner {
    width: var(--menu-width);
    max-width: none;
    grid-template-columns: var(--menu-columns);
    column-gap: var(--menu-gap, 90px);
    margin-inline: auto;
  }
  .site-header .mega-column {
    width: calc(100% + 70px);
    justify-self: center;
    align-items: center;
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
  }
  .site-header .mega-column a {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}


/* Eight language choices stay reachable on small screens. */
.language-options{right:auto;inset-inline-end:0;width:200px;max-height:calc(100dvh - 120px);overflow-y:auto;overscroll-behavior:contain}
.language-options a{gap:12px}
.language-toggle{direction:ltr}
