/* Stage 5 — header from approved Figma layouts.
   Reuses the stage-4 color, typography and spacing tokens. */
.site-header {
  position: relative;
  z-index: 2;
  padding-block-start: var(--header-offset);
  background: transparent;
}
.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand language" "menu menu";
  align-items: center;
  column-gap: 12px;
  row-gap: 12px;
  min-block-size: 104px;
}
.site-header__brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 44px;
}
.site-header__logo {
  display: block;
  inline-size: 189.76px;
  max-inline-size: 100%;
  block-size: auto;
}
html:lang(en) .site-header__logo { inline-size: 209.1px; }
.site-header .site-nav {
  grid-area: menu;
  justify-self: center;
  min-inline-size: 0;
  gap: 32px;
  min-block-size: 44px;
}
.site-header .site-nav .text-link {
  min-block-size: 44px;
  min-inline-size: 44px;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
}
.site-header .site-nav .text-link:focus-visible {
  color: var(--color-link-hover);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.site-header .language-switch {
  grid-area: language;
  justify-self: end;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 9px 1fr;
  inline-size: 105px;
  min-inline-size: 105px;
  min-block-size: 44px;
  padding: 0 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}
.site-header .language-switch::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px 0;
  border: 1px solid rgb(199 191 228 / 16%);
  border-radius: var(--language-radius);
  background: rgb(255 255 255 / 3%);
  transition: background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}
.site-header .language-switch a {
  min-inline-size: 0;
  min-block-size: 44px;
  width: 100%;
  border-radius: var(--language-radius);
}
.site-header .language-switch:focus-within::before {
  background: var(--color-outline-hover-bg);
  border-color: var(--color-outline-hover);
  box-shadow: var(--shadow-secondary-hover);
}
.site-header__divider {
  height: 1px;
  margin-block-start: 8px;
  background: rgb(199 191 228 / 10.2%);
}
.site-header__skip {
  position: absolute;
  top: 4px;
  left: var(--header-gutter);
  z-index: 4;
  padding: 8px 12px;
  color: var(--color-ink);
  background: var(--color-text);
  border-radius: 8px;
  transform: translateY(-200%);
}
.site-header__skip:focus { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .site-header .language-switch:hover { background: none; box-shadow: none; }
  .site-header .language-switch:hover::before {
    background: var(--color-outline-hover-bg);
    border-color: var(--color-outline-hover);
    box-shadow: var(--shadow-secondary-hover);
  }
  .site-header .language-switch:hover a { color: var(--color-text); }
}

/* The EN tablet mark needs extra space: 824px is the header-only
   transition, preserving the exact centered menu at the 834px reference. */
@media (min-width: 768px) and (max-width: 823px) {
  .site-header { padding-block-start: 12px; }
}
@media (min-width: 824px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand menu language";
    min-block-size: var(--header-height);
    column-gap: 0;
    row-gap: 0;
  }
  .site-header__logo { inline-size: 232px; }
  html:lang(en) .site-header__logo { inline-size: 255px; }
  .site-header .site-nav { gap: var(--nav-gap); min-block-size: 0; }
  .site-header .site-nav .text-link { min-block-size: 19px; min-inline-size: 0; }
  .site-header .language-switch { min-block-size: 40px; }
  .site-header .language-switch::before { inset: 0; }
  .site-header .language-switch a { min-block-size: 40px; }
  .site-header__divider { margin-block-start: 12px; }
}
@media (min-width: 1200px) {
  .site-header .site-nav { gap: 40px; }
}
@media (max-width: 359px) {
  .site-header__inner { column-gap: 8px; }
  .site-header .site-nav { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .language-switch::before { transition: none; }
}

/* Temporary development destinations. Replace these sections, preserving IDs,
   during stages 7–9. No production copy or external URLs are implied. */
.stage-placeholder {
  min-block-size: 240px;
  padding-block: var(--space-11);
  display: grid;
  align-content: center;
  gap: var(--space-4);
  scroll-margin-block-start: var(--space-6);
}
.stage-placeholder h2 { font-size: var(--size-section-title); overflow-wrap: anywhere; }
.stage-placeholder p { color: var(--color-muted); }

/* Stage 12: keep logo and language control inside their grid tracks. */
.site-header__brand { width: max-content; max-inline-size: 100%; }
.site-header .site-nav { max-inline-size: 100%; }
.site-header .site-nav .text-link { max-inline-size: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }
