/* Shared header row keeps the signature and language trigger aligned to the same shell. */
.language-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

portfolio-language-switcher.language-control {
  position: relative;
  z-index: 21;
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.language-trigger {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 6px;
  border-radius: 10px;
  background: transparent;
}

@media (hover: hover) {
  .language-trigger:hover { background: #f5f5f5; }
}

.language-trigger img {
  display: block;
  width: 20px;
  height: 20px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 22;
  display: flex;
  width: 140px;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  gap: 0;
  padding: 4px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 85px 44px #08090a03, 0 55px 30px #08090a05, 0 31px 18px #08090a08, 0 14px 14px #08090a0a, 0 3px 8px #08090a0a;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}

.language-menu::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 4px;
  content: "";
}

.language-control.is-open .language-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s;
}

.language-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  border-radius: 8px;
  color: #00000099;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  text-align: left;
  white-space: nowrap;
  transition: background-color 140ms ease;
}

.language-item:hover,
.language-item:focus-visible {
  background: #f5f5f5;
}

.language-item-check {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: 0;
}

.language-item-check.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .language-menu,
  .language-item { transition: none; }
}
