/* Avarten Capital — language switcher (EN | DE)
   Desktop: sits beside the "Speak with an Advisor" button inside the primary nav.
   Mobile / tablet (< 1024px): sits in the header bar, left of the menu button. */

.av-lang{display:inline-flex;align-items:center;font-family:var(--font-sans,Arial,sans-serif);font-size:13px;font-weight:500;letter-spacing:.08em;line-height:1;white-space:nowrap}
.av-lang a,.av-lang span.av-lang-current{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 6px;text-decoration:none;transition:color .2s ease}
.av-lang a{color:rgba(42,46,49,.6)}
.av-lang a:hover,.av-lang a:focus-visible{color:#11161b}
.av-lang a:focus-visible{outline:1px solid #8a7152;outline-offset:2px}
.av-lang span.av-lang-current{color:#11161b;font-weight:700;position:relative}
.av-lang span.av-lang-current::after{content:"";position:absolute;left:6px;right:6px;bottom:5px;height:1px;background:#8a7152}
.av-lang-sep{width:1px;height:12px;background:rgba(17,22,27,.25);display:inline-block}

/* Desktop placement: beside the CTA button */
nav .av-lang{margin-left:.25rem}

/* Mobile/tablet group: switcher + menu button on the right of the header bar */
.av-header-end{display:flex;align-items:center;gap:.25rem}
.av-header-end .av-lang a,.av-header-end .av-lang span.av-lang-current{min-width:40px;height:44px}
.av-header-end .av-lang span.av-lang-current::after{bottom:11px}
@media (min-width:1024px){.av-header-end{display:none}}

/* Very small phones */
@media (max-width:359px){
  .av-header-end .av-lang{font-size:12px;letter-spacing:.04em}
  .av-header-end .av-lang a,.av-header-end .av-lang span.av-lang-current{min-width:32px}
}

/* Narrow desktops (1024–1199px): tighten the nav so the longer German labels + switcher fit */
@media (min-width:1024px) and (max-width:1199px){
  header nav[aria-label="Primary"],header nav[aria-label="Hauptnavigation"]{gap:1.5rem}
  header nav[aria-label="Primary"] a.bg-ink,header nav[aria-label="Hauptnavigation"] a.bg-ink{padding:.9rem 1.1rem;margin-left:0}
  nav .av-lang{margin-left:0}
}

/* Flags (inline SVG, so they render on every OS incl. Windows) */
.av-flag{display:inline-block;width:18px;height:12px;margin-right:6px;flex:none;border-radius:2px;background-size:cover;background-position:center;background-repeat:no-repeat;box-shadow:0 0 0 1px rgba(17,22,27,.15)}
.av-flag-de{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Crect width='5' height='3' fill='%23FFCE00'/%3E%3Crect width='5' height='2' fill='%23DD0000'/%3E%3Crect width='5' height='1' fill='%23000'/%3E%3C/svg%3E")}
.av-flag-en{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='c'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23c)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E")}
.av-lang a:not(:hover):not(:focus-visible) .av-flag{opacity:.75}
.av-lang a{min-width:0;padding:0 8px}
.av-lang span.av-lang-current{min-width:0;padding:0 8px}
.av-lang span.av-lang-current::after{left:8px;right:8px}
.av-header-end .av-lang a,.av-header-end .av-lang span.av-lang-current{min-width:0}
