/*
 * Language dropdown (flag + code, list of languages with flags).
 * Markup is generated by lang-switcher.js into <div data-lang-switcher>.
 * Colours/fonts come from the page's own tokens (--c-text, --c-bg, ...), so one
 * stylesheet fits the dark and the light landing pages. A page can set
 * --lang-text-shadow when the nav sits on top of a photo.
 */
.lang {
  position: relative;
  display: inline-block;
  font-family: var(--font-body, inherit);
}

.lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--c-text, #111);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: var(--lang-text-shadow, none);
  cursor: pointer;
}

.lang__toggle:hover,
.lang__toggle:focus-visible {
  color: var(--c-accent, #c82151);
}

.lang__flag {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.35);
}

.lang__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}

.lang.is-open .lang__caret {
  transform: rotate(180deg);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  min-width: 168px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  border: 1px solid var(--c-border, #e5e5e5);
  border-radius: var(--radius, 4px);
  background: var(--c-bg, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.lang.is-open .lang__menu {
  display: flex;
}

.lang__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--c-text-muted, #444);
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.lang__option:hover,
.lang__option:focus {
  background: rgba(128, 128, 128, 0.16);
  color: var(--c-text, #111);
  outline: none;
}

.lang__option[aria-selected="true"] {
  color: var(--c-text, #111);
  font-weight: 500;
}
