/* Final override for the language menu. Keep this file loaded after page CSS. */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body .header,
  body .header__top,
  body .lang-switch {
    overflow: visible !important;
  }

  body .header .lang-switch {
    position: relative !important;
    z-index: 1001 !important;
  }

  body .header .lang-menu,
  body > .header .lang-menu {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    left: auto !important;
    min-width: 178px !important;
    width: max-content !important;
    max-width: calc(100vw - 24px) !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    padding: 4px 0 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    z-index: 1002 !important;
    scrollbar-width: none !important;
  }

  body .header .lang-menu::-webkit-scrollbar,
  body > .header .lang-menu::-webkit-scrollbar {
    display: none !important;
  }

  body .header .lang-menu a,
  body > .header .lang-menu a {
    display: block !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 480px) {
  body .header .lang-menu,
  body > .header .lang-menu {
    min-width: 172px !important;
    max-width: calc(100vw - 20px) !important;
  }

  body .header .lang-menu a,
  body > .header .lang-menu a {
    padding: 5px 13px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) and (max-height: 640px) {
  body .header .lang-menu a,
  body > .header .lang-menu a {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }
}

/* Low-width guard for the shared English intro title. */
@media (max-width: 360px) {
  body .intro-grid .intro-title-mobile {
    max-width: 100% !important;
    font-size: clamp(20px, 7vw, 24px) !important;
    line-height: 1.16 !important;
    overflow-wrap: normal !important;
  }

  body .intro-grid .intro-title-mobile span {
    display: inline !important;
    white-space: normal !important;
  }

  body .intro-grid .intro-title-mobile br + span::before {
    content: " ";
  }

  body .intro-grid .intro-title-mobile br {
    display: none !important;
  }
}
