/* Compact AR/EN selector; full names remain available to assistive technology. */
.mg-language-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 2px;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
}

.mg-language-switch .mg-language-switch-full {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mg-language-switch .mg-language-switch-compact { display: inline; }

.mg-language-switch a,
.mg-language-switch > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 42px;
  min-height: 38px;
  padding-inline: 8px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: var(--mg-type-small);
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.mg-language-switch [aria-current="page"] {
  position: relative;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.mg-language-switch [aria-disabled="true"] {
  color: var(--ink-muted);
  cursor: not-allowed;
}

.mg-language-switch a:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mg-site-header .mg-shell-actions .mg-language-switch { gap: 0; }
.mg-site-header .mg-shell-actions .mg-language-switch a,
.mg-site-header .mg-shell-actions .mg-language-switch > span {
  min-width: 42px;
  min-height: 38px;
  padding: 0 8px;
  font-size: var(--mg-type-small);
}

.mg-shell-mobile-language { display: none; }

@media (max-width: 1250px) {
  .mg-site-header .mg-shell-actions .mg-language-switch { display: none; }
  .mg-shell-mobile-language {
    display: flex;
    justify-content: flex-end;
    padding-block: 0 6px;
  }
  .mg-shell-mobile-language .mg-language-switch a,
  .mg-shell-mobile-language .mg-language-switch > span {
    min-width: 48px;
    min-height: 44px;
  }
}
