/* ==========================================================================
   Header
   Self-contained: no url() and no variables from other files, so the styles
   can be moved inline into any page. Icons live in the markup as <img>.
   ========================================================================== */

/* the header stays on top while the page scrolls;
   anchors (#…) stop below it thanks to scroll-padding-top */
html {
  scroll-padding-top: 48px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #06483a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  color: #ffffff;
  font-family: var(--font-main, "Inter", system-ui, sans-serif);
}

.header *,
.header *::before,
.header *::after {
  box-sizing: border-box;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1632px;
  min-height: 48px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 2000px) {
  .header {
    box-shadow: none;
  }

  .header::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 50%;
    width: 96vw;
    transform: translateX(-50%);
    background: #06483a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    pointer-events: none;
  }

  .header__inner {
    position: relative;
  }
}

/* Logo
   ========================================================================== */

.header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.header__logo-img {
  display: block;
  flex: none;
  width: 25px;
  height: 25px;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
}

.brand-wordmark strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Language switcher
   ========================================================================== */

.lang {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}

.lang__toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.lang__toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.lang__flag {
  display: block;
  flex: none;
  width: 18px;
  height: auto;
}

.lang__chevron {
  display: block;
  flex: none;
  width: 14px;
  height: 14px;
  margin-inline-start: 3px;
  transition: transform 0.2s ease;
}

.lang__toggle[aria-expanded="true"] .lang__chevron {
  transform: rotate(180deg);
}

.lang__list {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  width: 158px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  /* more languages than fit: the list scrolls. It shows eight and a half
     items (40px each) at most, so the half-hidden one hints at the rest,
     and never runs below the screen (48px header + 16px gap) */
  max-height: min(340px, calc(100vh - 64px));
  max-height: min(340px, calc(100dvh - 64px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  /* closed: faded out and out of reach (visibility keeps the links away from
     Tab and clicks); visibility switches after the fade so it can play */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.25s, opacity 0.25s, visibility 0s 0.25s;
}

.lang__list.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.25s, opacity 0.25s;
}

/* until the first opening: the flag images are not loaded with the page */
.lang__list[hidden] {
  display: none;
}

.lang__link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 8px 14px;
  border-bottom: 1px solid #e6e6e6;
  color: #000000;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}

.lang__item:last-child .lang__link {
  border-bottom: 0;
}

.lang__link:hover,
.lang__link:focus-visible {
  background: #e6ffde;
  outline: none;
}

.lang__check {
  display: block;
  flex: none;
  width: 15px;
  height: auto;
  margin-inline-start: auto;
}

/* Tablet and desktop
   ========================================================================== */

@media (min-width: 768px) {
  html {
    scroll-padding-top: 80px;
  }

  .header__inner {
    max-width: 1664px;
    min-height: 80px;
    padding-inline: 32px;
  }

  .header__logo {
    gap: 10px;
    font-size: 16px;
  }

  .header__logo-img {
    width: 37px;
    height: 37px;
  }

  .brand-wordmark {
    font-size: 16px;
  }

  .brand-wordmark strong {
    font-size: 18px;
  }

  .lang__toggle {
    gap: 8px;
    font-size: 18px;
  }

  /* the header is 80px high here */
  .lang__list {
    max-height: min(340px, calc(100vh - 96px));
    max-height: min(340px, calc(100dvh - 96px));
  }

  .lang__chevron {
    width: 24px;
    height: 24px;
    margin-inline-start: 2px;
  }
  
  .lang__link {
    font-size: 16px;
  }
}

@media (min-width: 1280px) {
  .header__inner {
    max-width: 1680px;
    padding-inline: 40px;
  }
}

/* reduced motion: the menu fades without sliding */
@media (prefers-reduced-motion: reduce) {
  .lang__list {
    transform: none;
  }
}
