/* Selettore IT / EN: lo aggiunge scripts/build-i18n.cjs alle pagine che hanno la versione inglese. */
.lang-switch {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.lang-switch > a,
.lang-switch > span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.lang-switch > a:hover,
.lang-switch > [aria-current] {
  opacity: 1;
}
.lang-switch > [aria-current]::after {
  content: '';
  position: absolute;
  inset: auto 4px 9px;
  height: 1px;
  background: currentColor;
}
.lang-switch .lang-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lang-switch a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* Header dei progetti (css/project-header.css) */
.project-header .lang-switch {
  position: relative;
  padding-left: clamp(14px, 1.4vw, 22px);
}
.project-header .lang-switch > a,
.project-header .lang-switch > span {
  opacity: 1;
  color: #8f8f8f;
}
.project-header .lang-switch > a:hover,
.project-header .lang-switch > [aria-current] {
  color: #fff;
}
.project-header .lang-switch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 16px;
  width: 1px;
  background: #ffffff38;
  transform: translateY(-50%);
}
@media (max-width: 1100px) {
  .portfolio-header.project-header:has(.lang-switch) {
    grid-template-columns: 44px 1fr auto 44px;
  }
  .project-header .lang-switch {
    grid-column: 3;
    grid-row: 1;
    padding-left: 0;
  }
  .project-header .lang-switch::before {
    display: none;
  }
  .project-header:has(.lang-switch) .burger {
    grid-column: 4;
  }
}
@media (max-width: 420px) {
  .portfolio-header.project-header:has(.lang-switch) {
    column-gap: 10px;
  }
}

/* About me */
.am-header .lang-switch {
  margin-left: auto;
  margin-right: clamp(10px, 2vw, 28px);
}

/* Air Max */
.amx-header .lang-switch {
  margin-left: -20px;
}
@media (max-width: 1100px) {
  .amx-header .lang-switch {
    margin-left: -6px;
  }
}

/* IKEA — Cabinet of Wonders */
@media (max-width: 700px) {
  .site-header .lang-switch {
    margin-left: auto;
  }
  .site-header:has(.lang-switch) .menu {
    margin-left: 0;
  }
}

/* Indice dei lavori */
#work-menu .wm-header .lang-switch {
  margin-left: auto;
  margin-right: 22px;
}
@media (max-width: 700px) {
  #work-menu .wm-header .lang-switch {
    margin-right: 12px;
  }
}

/* Pagine Readymag, senza header: fisso accanto al menu, in alto a destra (scala con la pagina). */
.lang-switch--float {
  position: fixed;
  z-index: 1000;
  top: max(22px, 3.2vw);
  right: 7.9vw;
  transform: translateY(-50%);
  color: #fff;
  mix-blend-mode: difference;
  font-family: 'custom_146852', Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch > a {
    transition: none;
  }
}
