/* Botão de idioma PT | EN e transição de troca. Carregar depois de style.css */
.i18n-wait body { opacity: 0; }                 /* evita ver o português por um instante quando o visitante usa inglês */
body { transition: opacity .2s var(--m-ease, ease); }

.lang-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center;
  height: 34px; padding: 3px; border-radius: 999px; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08);
  transition: border-color .3s var(--m-ease, ease), background .3s var(--m-ease, ease);
}
.lang-switch button {
  position: relative; z-index: 1; min-width: 38px; height: 100%; padding: 0 10px; border: 0; background: none;
  font: 600 .72rem/1 inherit; font-family: inherit; letter-spacing: .08em; color: #fff; cursor: pointer;
  border-radius: 999px; transition: color .25s var(--m-ease, ease);
}
.lang-pill {                                    /* indicador que desliza entre PT e EN */
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--btn-azul, #009fc3);
  transition: transform .25s var(--m-ease, cubic-bezier(.25, 1, .5, 1));
}
.lang-switch[data-on="en"] .lang-pill { transform: translateX(100%); }
.lang-switch button.on { color: #fff; }
.lang-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.site-header.scrolled .lang-switch { border-color: rgba(0, 0, 0, .18); background: rgba(0, 0, 0, .04); }
.site-header.scrolled .lang-switch button:not(.on) { color: var(--azul-logo, #009fc3); }

/* Computador: fica à direita do menu, junto ao ícone do LinkedIn */
@media (min-width: 961px) { .lang-switch { margin-left: calc(-1 * var(--sp-2, .5rem)); } }
/* Telemóvel/tablet: fica à direita do cabeçalho, ao lado do botão do menu */
@media (max-width: 960px) {
  .lang-switch { order: 2; margin-left: auto; margin-right: 10px; }
  .menu-toggle { order: 3; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .lang-pill, .lang-switch button, body { transition: none; } }
