/* Shared TR/EN/DE disclosure. Native details remains usable without JavaScript. */
.site-header .sf-language-switcher {
  display: block;
  min-width: 0;
  font-size: .95rem;
  line-height: 1.35;
  white-space: normal;
}
.sf-language-dropdown { position: relative; }
.sf-language-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  height: 100%;
  min-height: 44px;
  padding: .35rem;
  border: 1px solid transparent;
  border-inline-start-color: rgba(255, 255, 255, .35);
  border-radius: 0 .8rem .8rem 0;
  color: #fff;
  background: var(--action-bg, var(--focus-orange));
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 650;
}
.sf-language-trigger::-webkit-details-marker { display: none; }
.sf-language-trigger::marker { content: ''; }
.sf-language-trigger:hover { background: var(--focus-orange-dark); }
.sf-language-code { font-weight: 750; }
.sf-language-flag {
  display: block;
  width: 24px;
  height: 16px;
  flex: 0 0 24px;
  overflow: hidden;
  border-radius: 3px;
  outline: 1px solid rgba(120, 130, 145, .3);
  forced-color-adjust: none;
}
/* The closed control is flag-only; the explicit aria-label names the current language. */
.sf-language-trigger > .sf-language-code,
.sf-language-trigger > .sf-language-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sf-language-trigger > .sf-language-chevron { display: none; }
.sf-language-options {
  position: absolute;
  z-index: 5;
  inset-inline-end: 0;
  top: 100%;
  width: 15rem;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 7rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .18);
  list-style: none;
}
.sf-language-options li { margin: 0; padding: 0; list-style: none; }
.site-header .sf-language-options a {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .5rem .6rem;
  border-radius: .5rem;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sf-language-options a:hover { background: var(--surface-soft); }
.site-header .sf-language-options [aria-current="page"] {
  background: var(--surface-soft);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.sf-language-option-text { display: grid; min-width: 0; gap: .1rem; }
.sf-language-option-text small { color: var(--muted); font-size: .82rem; }
.sf-language-trigger:focus-visible,
.site-header .sf-language-options a:focus-visible {
  outline: 2px solid var(--focus-orange);
  outline-offset: 3px;
}
.sf-language-inline-hint {
  margin-inline-start: auto;
  padding: .15rem .3rem;
  border: 1px solid currentColor;
  border-radius: .35rem;
  font-size: .75rem;
  line-height: 1.3;
}
/* Keep the real CTA and the language disclosure adjacent in DOM and visual order. */
.site-header .site-header__bar:has(.sf-language-switcher) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
}
.site-header .site-nav { min-width: 0; }
.site-header .site-header__actions {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  gap: 0;
  min-width: 0;
}
.site-header .site-header__actions .header-demo {
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  border-radius: .8rem 0 0 .8rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.site-header .site-header__actions .sf-language-switcher { flex: 0 0 44px; }
.site-header .site-header__actions .sf-language-dropdown { height: 100%; }
.site-header .site-header__actions .theme-toggle {
  align-self: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-inline-start: .5rem;
}
@media (min-width: 921px) and (max-width: 1200px) {
  .site-header .site-header__bar:has(.sf-language-switcher) { gap: .6rem; padding-inline: .75rem; }
  .site-header .sf-wordmark { width: 108px; max-width: 108px; }
  .site-header .site-nav { justify-self: stretch; }
  .site-header .site-nav__list, .site-header .site-nav .menu { gap: .35rem .7rem; flex-wrap: wrap; justify-content: center; }
  .site-header .site-nav a { white-space: normal; }
}
/* Match the main-navigation JS breakpoint. Auto rows preserve DOM/Tab order:
   hidden nav -> actions row 2; open/no-JS nav -> nav row 2, actions row 3. */
@media (max-width: 920px) {
  .site-header .site-header__bar:has(.sf-language-switcher) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: .5rem;
    padding: .5rem;
    min-height: 62px;
  }
  .site-header .site-header__bar > * { order: 0; }
  .site-header .site-brand { grid-column: 1; grid-row: 1; min-width: 0; width: min(112px, 100%); margin-right: 0; justify-self: stretch; }
  .site-header .sf-wordmark { width: min(112px, 100%); max-width: 100%; }
  .site-header .menu-toggle { grid-column: 2; grid-row: 1; width: 44px; height: 44px; min-width: 44px; }
  .site-header .site-nav { grid-column: 1 / -1; min-width: 0; }
  .site-header .site-header__actions { position: relative; grid-column: 1 / -1; }
  .site-header .site-header__actions .header-demo { flex: 1 1 0; font-size: .875rem; padding: .5rem; }
  .site-header .site-header__actions .sf-language-dropdown { position: static; }
  .site-header .site-header__actions .sf-language-options {
    inset-inline-end: 0;
    top: 100%;
    max-width: 100%;
  }
}
@media (forced-colors: active) {
  .sf-language-trigger, .sf-language-options { border-color: CanvasText; }
  .sf-language-trigger:focus-visible, .site-header .sf-language-options a:focus-visible { outline-color: Highlight; }
}
