/**
 * サイト共通：言語切替 UI（.ft-lang-switch）
 * 多言語はセレクトでスケール（10カ国語以上でもヘッダーが破綻しにくい）
 */

/* workspace-app 等テーマ外ページ用（Minimal Mistakes の .visually-hidden と同等） */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.ft-lang-switch {
  display: inline-flex !important;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  max-width: min(14rem, 42vw);
}

.ft-lang-switch--select {
  gap: 0;
}

/* ネイティブ select（コンパクト・角丸） */
.ft-lang-switch__select {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0.38rem 2rem 0.38rem 0.65rem;
  border: 1px solid #2b2b2b;
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23222' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px auto;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #101010;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ft-lang-switch__select:hover,
.ft-lang-switch__select:focus {
  border-color: #101010;
  outline: none;
}

.ft-lang-switch__select:focus-visible {
  box-shadow: 0 0 0 2px rgba(16, 16, 16, 0.15);
}

/* マストヘッド内 */
.greedy-nav .ft-lang-switch {
  position: absolute;
  right: 156px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  max-width: 132px;
}

/* HALFTONE / workspace ヘッダー右エリア */
.site-actions .ft-lang-switch,
.halftone-header__inner .ft-lang-switch {
  margin: 0;
}

.ft-lang-switch--embed {
  margin-right: 0.35rem;
}

@media (max-width: 768px) {
  .greedy-nav .ft-lang-switch {
    position: static;
    transform: none;
    margin-left: 0.5rem;
    margin-right: 0.4rem;
    max-width: min(12rem, 52vw);
  }

  .ft-lang-switch__select {
    font-size: 0.68rem;
    padding: 0.32rem 1.75rem 0.32rem 0.5rem;
  }
}
