/* ==========================================================
   lang-menu.css — LANGUAGE SWITCHER (STATIC, SAFE)
   - Dropdown anchored to the pill (no JS positioning)
========================================================== */

:root{
  --lang-menu-gap: 14px; /* vertical gap below the pill */
}

/* Slots (desktop navbar / mobile title) */
.nav-lang-slot{
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#lang-switcher-container{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  height: auto;
}

/* ==========================================================
   Switcher wrapper (ANCHOR for dropdown)
========================================================== */
#lang-switcher{
  position: relative;            /* dropdown anchors here */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  z-index: 2000;
  font-family: "Tinos", serif;

  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
}

#lang-switcher[style]{
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
}

/* ==========================================================
   Toggle button
========================================================== */
#lang-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 46px;
  padding: 7px 12px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: rgba(255, 245, 235, 0.78);
  backdrop-filter: blur(12px);

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;

  touch-action: manipulation;
}

#lang-toggle:focus{ outline: none; }

#lang-toggle:hover{
  transform: translateY(-1px);
  background: rgba(255, 245, 235, 0.98);
  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

#lang-toggle:active{
  transform: translateY(0);
}

/* Flag icons */
.lang-flag{
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;

  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ==========================================================
   Dropdown (anchored to #lang-switcher)
========================================================== */
#lang-menu{
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + var(--lang-menu-gap));

  min-width: 56px;
  padding: 10px 8px;
  border-radius: 20px;

  background: rgba(255, 250, 245, 0.65);
  backdrop-filter: blur(16px);

  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.75);

  opacity: 0;
  pointer-events: none;

  transform: translateY(-4px) scale(0.96);
  transform-origin: top right;

  transition:
    opacity 0.14s ease-out,
    transform 0.14s cubic-bezier(.16,.8,.2,1);
}

#lang-menu.open{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#lang-menu button{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 8px 0;
  margin: 0 0 6px 0;

  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
}

#lang-menu button:last-child{ margin-bottom: 0; }

#lang-menu button:hover{
  background: rgba(245, 230, 215, 0.95);
}

#lang-menu button.active{
  background: rgba(250, 235, 225, 1);
}