/* Shared by every locale and page. Carets are geometry, never font glyphs. */
.header-inner { gap: clamp(16px,2.4vw,30px); }
.site-header .brand { flex-shrink: 0; }
.navigation { justify-content: center; gap: 8px; margin-left: 0; min-width: 0; }
.header-actions { flex-shrink: 0; gap: 16px; }
.navigation > a, .navigation > details > summary, .language-menu > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; line-height: 24px; white-space: nowrap;
  color: var(--ink); transition: color 180ms ease, background-color 180ms ease;
}
.site-header .nav-caret {
  display: block; width: 12px; height: 12px; flex: 0 0 12px;
  margin: 0; transform: none; transition: none;
}
.language-menu > summary > .icon { width: 18px; height: 18px; }
.navigation > a:is(:hover,:active), .site-header .nav-dropdown > summary:is(:hover,:active),
.site-header .nav-dropdown[open] > summary {
  color: var(--blue); background: #f2f7fd;
}
.site-header .dropdown {
  top: calc(100% + 8px); left: 0; padding: 8px; min-width: 220px;
  max-width: min(320px,calc(100vw - 32px)); border-color: #e5ebf3;
  border-radius: 12px; box-shadow: 0 12px 32px -8px #233e6924;
  font-size: 14px; font-weight: 500; line-height: 1.5;
}
.site-header .dropdown a { padding: 10px 12px; overflow-wrap: anywhere; }
.site-header .language-menu .dropdown { left: auto; right: 0; min-width: 176px; }
.navigation > .nav-mobile-download { display: none; }

/* One panel for all locales, with native links and a stable trigger anchor. */
.site-header .language-menu .language-panel {
  width: 528px; min-width: 0; max-width: calc(100vw - 32px);
  max-height: min(560px,calc(100dvh - 110px)); overflow-y: auto;
  padding: 22px; border: 1px solid #e5ebf3; border-radius: 18px;
  background: white; box-shadow: 0 18px 48px -12px #233e6926;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ccd6e3 transparent;
}
.language-panel-title {
  margin: 0 0 14px; padding-inline: 12px; color: var(--text-supporting,var(--muted));
  font-size: 12px; font-weight: 500; line-height: 1.5;
}
.language-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.site-header .language-grid > a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; height: 48px; padding: 10px 12px; border-radius: 11px;
  font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--ink);
  transition: background-color 160ms ease,color 160ms ease;
}
.language-grid > a > span { min-width: 0; overflow-wrap: anywhere; }
.language-grid > a > .icon { flex: 0 0 16px; width: 16px; height: 16px; }
.site-header .language-grid > a:hover { background: #f5f8fc; color: var(--blue); }
.site-header .language-grid > a[aria-current="page"] { background: #edf5ff; color: #1268d6; }
.site-header .language-grid > a:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.language-panel::-webkit-scrollbar { width: 6px; }
.language-panel::-webkit-scrollbar-thumb { background: #ccd6e3; border-radius: 8px; }
.language-panel::-webkit-scrollbar-track { background: transparent; }
@media (max-width:680px) {
  .site-header .language-menu { position: static; }
  .site-header .language-menu .language-panel {
    top: calc(100% + 8px); left: 16px; right: 16px; width: auto; max-width: none;
    padding: 16px; max-height: min(560px,calc(100dvh - 100px));
  }
  .language-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:340px) {
  .site-header .language-menu .language-panel { padding: 12px; }
  .site-header .language-grid > a { padding-inline: 8px; gap: 4px; font-size: 13px; }
}

/* Collapse before long translations can compress the brand or download CTA. */
@media (max-width:1050px) {
  .site-header { height: 68px; }
  .header-inner { padding-inline: 20px; gap: 12px; }
  .mobile-toggle {
    display: block; order: 3; margin-left: 0; padding: 0; min-width: 36px;
    min-height: 44px; border: 0; background: none; color: var(--ink); font-size: 23px;
  }
  .header-actions { margin-left: auto; gap: 12px; }
  .navigation {
    display: none; position: absolute; top: 67px; left: 0; right: 0;
    margin: 0; padding: 16px 20px; gap: 4px; background: white;
    border-bottom: 1px solid var(--line); box-shadow: 0 15px 25px #15223b0c;
    max-height: calc(100dvh - 68px); overflow-y: auto;
  }
  .navigation.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .navigation > a, .navigation > details > summary {
    width: 100%; justify-content: flex-start; white-space: normal; text-align: left;
  }
  .navigation .dropdown {
    position: static; min-width: 0; max-width: none; margin: 4px 0 8px;
    padding: 4px 8px; box-shadow: none; border: 0; background: #f8fafd;
  }
  .header-actions .compact { display: inline-flex; }
}
@media (max-width:560px) {
  .header-inner { gap: 8px; padding-inline: 16px; }
  .language-menu > summary { padding-inline: 6px; gap: 8px; }
  .header-actions { gap: 0; }
  .header-actions .compact { display: none; }
  .navigation > .nav-mobile-download {
    display: inline-flex; margin-top: 8px; color: white; background: var(--blue);
    justify-content: center;
  }
  .navigation > .nav-mobile-download:hover { background: var(--blue-dark); }
}
@media (prefers-reduced-motion:reduce) {
  .navigation > a, .site-header .nav-dropdown > summary, .site-header .language-grid > a { transition: none; }
}
