/* ============================================================
   OneHabit — Sprachumschalter
   Wird von build_i18n.py in jede uebersetzte Seite eingebunden.
   ============================================================ */

.lang-switch {
  position: relative;
}

.lang-switch-btn {
  font-family: var(--font-ui, inherit);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text, #eae6d8);
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  border-radius: var(--r-sm, 8px);
  padding: 6px 12px;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}

.lang-switch-btn::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  vertical-align: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0.7;
}

.lang-switch-btn:hover,
.lang-switch:focus-within .lang-switch-btn {
  color: var(--accent, #e8c547);
  border-color: var(--accent, #e8c547);
}

.lang-switch-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 148px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: var(--bg-card, #1a2540);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--r, 12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 200;
}

.lang-switch:hover .lang-switch-menu,
.lang-switch:focus-within .lang-switch-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switch-menu li + li {
  margin-top: 2px;
}

.lang-switch-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: var(--r-sm, 8px);
  color: var(--text, #eae6d8);
  transition: background 0.15s, color 0.15s;
}

.lang-switch-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent, #e8c547);
}

.lang-switch-menu a[aria-current='true'] {
  color: var(--accent, #e8c547);
}

.lang-switch-menu a[aria-current='true']::before {
  content: '· ';
}

/* ---- Mobile: aufgeklappte Navigation, kein Dropdown ---- */
@media (max-width: 860px) {
  .lang-switch {
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  }

  .lang-switch-btn {
    display: none;
  }

  .lang-switch-menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    min-width: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .lang-switch-menu li + li {
    margin-top: 0;
  }

  .lang-switch-menu a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}
