/*
 * rml-language-switcher: the Polylang switcher (#12), as the live Connect
 * Polylang for Elementor widgets (header 3417659, footer e6f2361 / 985b983).
 * Measured at 1440px on 2026-11-21.
 *
 * --flag (header): 22 x 16.5px flag and a black angle-down 12px after it; the
 * other languages drop below, right-aligned, on hover (with a fine pointer) or
 * click. A link's background turns light grey on hover or focus. Names are
 * read by screen readers only.
 *
 * --flag-name (footer): 20 x 15px flag, the name 3px after it in white
 * uppercase (500), a white caret 8px after; the list drops on click. Hover and
 * focus turn the text orange. 14px on mobile.
 */

.rml-language-switcher {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading), sans-serif;
  font-size: 16px;
  line-height: 24px;
}

.rml-language-switcher__toggle,
.rml-language-switcher__link {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}

/* As live: the toggle is a line of text high (24px); a list link is the flag's
   height plus its line gap (21px). */
.rml-language-switcher__toggle {
  min-height: 24px;
}

.rml-language-switcher__link {
  min-height: 21px;
}

.rml-language-switcher__toggle:focus-visible,
.rml-language-switcher__link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.rml-language-switcher__flag {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 16.5px;
  line-height: 0;
}

.rml-language-switcher__flag img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  object-position: 75%;
}

.rml-language-switcher__icon {
  display: block;
  flex: none;
  box-sizing: content-box;
  width: auto;
  height: 16px;
  padding-left: 12px;
  transition: transform 0s 0.2s;
}

.rml-language-switcher.is-open .rml-language-switcher__icon {
  transform: rotateX(180deg);
  transition-delay: 0s;
}

.rml-language-switcher__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rml-language-switcher__list {
  position: absolute;
  z-index: 10;
  top: 100%;
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  visibility: hidden;
  transition: max-height 0.3s ease-out, visibility 0s 0.3s;
}

.rml-language-switcher.is-open .rml-language-switcher__list {
  max-height: 10em;
  visibility: visible;
  transition: max-height 0.4s ease-in, visibility 0s;
}

.rml-language-switcher__item {
  width: 100%;
  margin: 0;
}

/* ---------- Flag only (header) ---------- */

.rml-language-switcher--flag {
  color: var(--black);
  font-weight: 600;
}

.rml-language-switcher--flag .rml-language-switcher__name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rml-language-switcher--flag .rml-language-switcher__link:is(:hover, :focus-visible) {
  background-color: var(--neutral-300);
}

@media (pointer: fine) {
  .rml-language-switcher[data-open="hover"]:hover .rml-language-switcher__list {
    max-height: 10em;
    visibility: visible;
    transition: max-height 0.4s ease-in, visibility 0s;
  }

  .rml-language-switcher[data-open="hover"]:hover .rml-language-switcher__icon {
    transform: rotateX(180deg);
    transition-delay: 0s;
  }
}

/* ---------- Flag and name (footer) ---------- */

.rml-language-switcher--flag-name {
  color: var(--white);
  font-weight: 500;
  text-transform: uppercase;
}

.rml-language-switcher--flag-name .rml-language-switcher__flag {
  width: 20px;
  height: 15px;
}

.rml-language-switcher--flag-name .rml-language-switcher__name {
  padding-left: 3px;
}

.rml-language-switcher--flag-name .rml-language-switcher__icon {
  padding-left: 8px;
}

.rml-language-switcher--flag-name .rml-language-switcher__list {
  right: auto;
  left: 0;
}

.rml-language-switcher--flag-name :is(.rml-language-switcher__toggle, .rml-language-switcher__link):is(:hover, :focus-visible) {
  color: var(--brand-primary);
}

@media (max-width: 767px) {
  .rml-language-switcher--flag-name {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rml-language-switcher__list,
  .rml-language-switcher__icon {
    transition: none !important;
  }
}

/* Theme guard (#13). Hello Elementor's reset gives every button a pink
   background and white text on :hover and :focus ([type=button]:hover,
   specificity 0,2,0), and the Design guide doesn't load that reset, so its
   samples never showed it. These rules (html button[type]:where(...), 0,2,2)
   beat the theme and restate this element's own resting and state colours;
   rules with three or more classes (open, current) still win over them. */
html button[type]:where(.rml-language-switcher__toggle):is(:hover, :focus) {
  background-color: transparent;
  color: inherit;
}

/* As live: the header switcher's toggle turns light grey under the pointer. */
html .rml-language-switcher--flag button[type]:where(.rml-language-switcher__toggle):hover {
  background-color: var(--neutral-300);
}
