/* The homepage, CMS pages and blog share this header and its responsive menu. */
body > header:has(> .nav) {
  position: relative;
  z-index: 5;
  background: var(--rs-web-header);
  color: white;
  border-bottom: 1px solid #1b4087;
}
:root header > .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  margin-inline: auto;
  gap: clamp(12px, 2vw, 32px);
}
header > .nav .brand { display: inline-flex; flex: none; }
header > .nav .brand img { display: block; width: 188px; height: auto; }
header > .nav #primary-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  margin-inline: auto;
  gap: 4px clamp(12px, 1.5vw, 24px);
}
header > .nav #primary-nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--rs-dark-copy, #d7e1ea);
  text-decoration: none;
  font-size: .91rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
header > .nav #primary-nav > a:is(:hover, :focus-visible, [aria-current]) {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: white;
}
header > .nav .nav-actions { display: flex; align-items: center; flex: none; }
:root header > .nav a.nav-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--rs-web-radius-control, 6px);
  background: var(--rs-web-cta);
  color: var(--rs-dark, #101d3b);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  text-decoration: none;
  box-shadow: var(--rs-web-shadow-cta);
}
:root header > .nav a.nav-app:hover { background: var(--rs-web-cta-hover); }
:root header > .nav :focus-visible { outline: 2px solid var(--rs-sky, #65c7ff); outline-offset: 3px; }
:root header > .nav #primary-nav .menu-login,
header > .nav .nav-toggle { display: none; }

header .site-language {
  position: relative;
  justify-self: start;
  flex: none;
}
header .site-language summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 40px;
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid #ffffff50;
  border-radius: var(--rs-web-radius-control, 6px);
  color: white;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}
header .site-language summary::-webkit-details-marker { display: none; }
header .site-language summary::after {
  content: '';
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
header .site-language[open] summary::after { transform: translateY(1px) rotate(225deg); }
header .site-language summary:hover,
header .site-language[open] summary { border-color: var(--rs-sky, #65c7ff); }
header .site-language ul {
  position: absolute;
  z-index: 2;
  inset: 100% auto auto 0;
  width: max-content;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  border: 1px solid #ffffff40;
  border-radius: var(--rs-web-radius-control, 6px);
  background: var(--rs-deep-navy, #071b3f);
  box-shadow: 0 4px 14px #071b3f33;
}
:root header > .nav #primary-nav .site-language li > * {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  color: white;
  font-size: .85rem;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
}
header .site-language li [aria-current]::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rs-accent, #ff8200);
}
:root header > .nav #primary-nav .site-language li a:hover { text-decoration: underline; }

@media (max-width: 1279px) {
  :root header > .nav {
    flex-wrap: wrap;
    gap: 12px;
    padding-block: 14px;
  }
  :root header > .nav .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 10px 12px;
    min-height: 44px;
    border: 1px solid #6e83a4;
    border-radius: var(--rs-web-radius-control, 6px);
    background: transparent;
    color: white;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
  }
  :root header > .nav #primary-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin: 0;
    padding: 8px 0 0;
    gap: 4px;
  }
  :root header > .nav .nav-toggle[aria-expanded='true'] + #primary-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 65vh;
    overflow-y: auto;
  }
  header > .nav #primary-nav > a:not(.nav-app) {
    min-height: 46px;
    padding: 10px;
    border-radius: 6px;
    background: #ffffff09;
  }
  header .site-language { align-self: start; }
  header .site-language summary { min-width: 44px; min-height: 44px; }
  header .site-language ul { position: static; }
  :root header > .nav #primary-nav .site-language li > * { min-height: 44px; }
}
@media (max-width: 760px) {
  :root header > .nav { min-height: 70px; width: calc(100% - 32px); }
  header > .nav .brand img { width: 145px; }
  :root header > .nav .nav-actions { display: none; }
  :root header > .nav #primary-nav .menu-login {
    display: inline-flex;
    grid-column: 1 / -1;
    margin-top: 8px;
    color: var(--rs-dark, #101d3b);
  }
}
