/* =============================================
   GREEN DRAIN - LANGUAGE SWITCHER (EU surfaces)
   Dropdown pill styled to match the region
   selector. Click-to-open: js/lang-switch.js
   toggles .open, mirroring the region selector
   (hover alone never opens the menu). Loaded
   only on /eu/ pages with language alternates.
   ============================================= */

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  outline: none;
}

/* mobile: a native select inside the nav overlay (nav-actions is
   desktop-only). A row of links overflowed the 390px overlay once 8
   languages existed and pushed the whole menu sideways (2026-08-25). */
/* settings-style row matching the nav list: label flush left like the
   nav items, value + chevron flush right like the nav chevrons
   (centered pill widgets read as bolted-on -- Chris, 2026-08-25) */
.lang-switch-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 0;
}

.lang-switch-mobile-label {
  font-size: 0.78rem;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted, rgba(26, 60, 26, 0.7));
}
/* custom dropdown (same pattern as the desktop pill — no native select,
   so no unstylable browser widget painting, ever) */
.lang-switch-m {
  position: relative;
  display: inline-flex;
}

.lang-switch-m-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 24px 4px 28px;
  border: none;
  background-color: transparent;
  /* globe on the left says "language"; chevron right lines up with the
     nav rows' own chevrons */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'><g fill='none' stroke='%231a3c1a' stroke-width='1.1'><circle cx='7.5' cy='7.5' r='6.4'/><ellipse cx='7.5' cy='7.5' rx='2.9' ry='6.4'/><path d='M1.4 5.2h12.2M1.4 9.8h12.2'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%231a3c1a' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat, no-repeat;
  background-position: left 0 center, right 4px center;
  font-family: var(--font-primary, inherit);
  font-size: 1rem;
  color: var(--color-text-dark, #1a3c1a);
  cursor: pointer;
}

.lang-switch-m-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  background: #fff;
  border: 1px solid rgba(26, 60, 26, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 60, 26, 0.12);
  padding: 6px;
  display: none;
  z-index: 250;
}

.lang-switch-m.open .lang-switch-m-menu { display: block; }

.lang-switch-m-menu a,
.lang-switch-m-menu span {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.95rem;
  color: var(--color-text-dark, #1a3c1a);
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch-m-menu a:active,
.lang-switch-m-menu a:hover { background: var(--color-green-light, #e8f0e4); }

.lang-switch-m-menu span { font-weight: 600; opacity: 0.55; cursor: default; }
@media (min-width: 1024px) { .lang-switch-mobile { display: none; } }

/* identical metrics to .region-selector-btn so the two pills sit as a pair */
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--color-border, rgba(26, 60, 26, 0.18));
  border-radius: var(--radius-full, 999px);
  background: none;
  color: var(--color-text-dark, #1a3c1a);
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium, 500);
  font-family: var(--font-primary, inherit);
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.lang-switch-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.6;
}

.lang-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: #fff;
  border: 1px solid rgba(26, 60, 26, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 60, 26, 0.12);
  padding: 6px;
  display: none;
  z-index: 200;
}

.lang-switch.open .lang-switch-menu {
  display: block;
}

.lang-switch-menu a,
.lang-switch-menu span {
  display: block;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--color-text-dark, #1a3c1a);
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch-menu a:hover {
  background: var(--color-green-light, #e8f0e4);
}

.lang-switch-menu span {
  font-weight: 600;
  opacity: 0.55;
  cursor: default;
}
