/* Floating language switcher — TOP LEFT (avoids #navPanelToggle on the right).
   Letters only (PT, EN, IT...). Dark glass, no borders.
   Desktop: expands on hover. Mobile/touch: expands via .is-open (tap).
*/

#lang-switcher {
  position: fixed;
  top: 16px;
  left: 16px;
  right: auto;
  z-index: 10002; /* above page chrome; clear of menu on the right */
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: width 0.18s ease, height 0.18s ease, padding 0.18s ease, background 0.18s ease;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

/* Expand: hover (desktop) OR .is-open (tap on touch / small screens) */
#lang-switcher:hover,
#lang-switcher.is-open,
#lang-switcher:focus-within {
  width: 48px;
  height: auto;
  min-height: 40px;
  padding: 8px 0 10px;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.92);
}

#lang-switcher .current-lang {
  font-size: 13px;
  line-height: 1;
  display: block;
  padding: 4px 0;
}

#lang-switcher:hover .current-lang,
#lang-switcher.is-open .current-lang,
#lang-switcher:focus-within .current-lang {
  opacity: 0.55;
}

#lang-switcher .lang-list {
  display: none;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  width: 100%;
}

#lang-switcher:hover .lang-list,
#lang-switcher.is-open .lang-list,
#lang-switcher:focus-within .lang-list {
  display: block;
}

#lang-switcher .lang-list li {
  /* Comfortable tap targets (~44px tall) */
  padding: 10px 0;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
  white-space: nowrap;
}

#lang-switcher .lang-list li:hover,
#lang-switcher .lang-list li:focus {
  opacity: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

#lang-switcher .lang-list li.active {
  opacity: 1;
  color: #ffffff;
  font-weight: 800;
}

/* Phones / small tablets: larger still, clear of edges */
@media screen and (max-width: 980px) {
  #lang-switcher {
    top: 12px;
    left: 12px;
    width: 48px;
    min-height: 48px;
    font-size: 14px;
  }

  #lang-switcher:hover,
  #lang-switcher.is-open,
  #lang-switcher:focus-within {
    width: 56px;
    padding: 10px 0 12px;
  }

  #lang-switcher .current-lang {
    font-size: 14px;
    padding: 6px 0;
  }

  #lang-switcher .lang-list li {
    padding: 12px 0;
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  #lang-switcher {
    top: 10px;
    left: 10px;
    width: 48px;
    min-height: 48px;
  }

  #lang-switcher:hover,
  #lang-switcher.is-open,
  #lang-switcher:focus-within {
    width: 58px;
  }

  #lang-switcher .lang-list li {
    padding: 14px 0;
    font-size: 15px;
  }
}
