/* Locale control is deliberately separate from the Cargo-matched editorial stylesheet. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500&display=swap');

.language-switch {
  color: rgba(0, 0, 0, .75);
  font-family: 'aktiv-grotesk', 'Noto Sans JP', Arial, sans-serif;
  font-size: .88rem;
  font-weight: var(--nonn-body-weight, 300);
  line-height: 1.1;
  letter-spacing: 0;
  z-index: 30;
}
.language-switch--desktop {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: calc(39vw - 2rem);
  text-align: right;
}
.language-switch a { pointer-events: auto; }
.language-switch a[aria-current='page'] { text-decoration: underline; text-underline-offset: .18em; }
.language-switch--mobile { display: none; }

/* Aktiv remains the primary system everywhere. Japanese adds a character-complete fallback only. */
html[lang='ja'] body {
  --nonn-sans: 'aktiv-grotesk', 'Noto Sans JP', Arial, sans-serif;
  --nonn-body: 'aktiv-grotesk', 'Noto Sans JP', Arial, sans-serif;
}
html[lang='ja'] .side-info .copy .courier-new {
  font-family: 'Courier New', 'aktiv-grotesk', 'Noto Sans JP', monospace;
}

@media (max-width: 800px) {
  .language-switch--desktop { display: none; }
  .language-switch--mobile {
    display: block;
    position: fixed;
    top: .45rem;
    right: .45rem;
    max-width: calc(100vw - 1rem);
    font-size: .84rem;
    text-align: right;
  }
  .language-switch--mobile summary {
    display: inline-flex;
    min-height: max(44px, 2.75rem);
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    list-style: none;
    padding: .25rem 0 .25rem .5rem;
  }
  .language-switch--mobile summary::-webkit-details-marker { display: none; }
  .language-switch--mobile summary::after { content: '⌄'; margin-left: .28rem; }
  .language-switch--mobile[open] .language-switch-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .42rem;
    min-width: max-content;
    padding: .55rem .6rem;
    background: rgba(244, 241, 234, .94);
  }
  .language-switch--mobile .language-switch-links > [aria-hidden='true'] { display: none; }
  .language-switch--mobile .language-switch-links a {
    display: inline-flex;
    min-height: max(44px, 2.75rem);
    align-items: center;
  }
}
