/* ==========================================================================
   Witnessy · language switcher
   A self-contained dropdown that scales from 2 to 7+ languages.
   Visual language matches the site header: dark navy glass, white/10 borders,
   Inter, gold (#FFD66B) accent for the active locale.
   All markup is generated by /assets/lang-switcher.js.
   ========================================================================== */

.wy-lang {
  position: relative;
  display: inline-block;
  font-family: "Inter", sans-serif;
}

/* --- Trigger ------------------------------------------------------------- */
.wy-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.65rem 0 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  color: rgb(226 232 240);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.wy-lang__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.wy-lang__btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.wy-lang__globe {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.9;
}

.wy-lang__code {
  letter-spacing: 0.04em;
}

.wy-lang__chev {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.wy-lang__btn[aria-expanded="true"] .wy-lang__chev {
  transform: rotate(180deg);
}

/* --- Menu ---------------------------------------------------------------- */
.wy-lang__menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 60;
  min-width: 232px;
  padding: 0.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 29, 58, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
  /* animation */
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.wy-lang[data-open="true"] .wy-lang__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.wy-lang__label {
  padding: 0.4rem 0.7rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

/* --- Options ------------------------------------------------------------- */
.wy-lang__opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 0.7rem;
  color: rgb(203 213 225);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wy-lang__opt:hover,
.wy-lang__opt:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.wy-lang__opt-name {
  flex: 1 1 auto;
}

/* two-letter locale badge on the right */
.wy-lang__badge {
  flex: none;
  min-width: 30px;
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgb(148 163 184);
}

/* active locale */
.wy-lang__opt--active {
  color: #fff;
  background: rgba(255, 214, 107, 0.1);
}

.wy-lang__opt--active .wy-lang__badge {
  border-color: rgba(255, 214, 107, 0.45);
  color: #ffd66b;
}

.wy-lang__check {
  width: 16px;
  height: 16px;
  flex: none;
  color: #ffd66b;
}

/* upcoming locale (not yet published) */
.wy-lang__opt--soon {
  cursor: default;
  color: rgb(100 116 139);
}

.wy-lang__opt--soon:hover {
  background: none;
  color: rgb(100 116 139);
}

.wy-lang__soon {
  flex: none;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}

/* --- Block variant (mobile nav) ----------------------------------------- */
.wy-lang--block {
  display: block;
  width: 100%;
}

.wy-lang--block .wy-lang__btn {
  width: 100%;
  justify-content: space-between;
}

.wy-lang--block .wy-lang__menu {
  left: 0;
  right: 0;
  transform-origin: top center;
}

@media (prefers-reduced-motion: reduce) {
  .wy-lang__menu,
  .wy-lang__chev {
    transition: none;
  }
}
