.language-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.language-trigger,
.language-list button {
  display: flex;
  align-items: center;
  color: inherit;
  font: inherit;
  border: 0;
  background: transparent;
  transition: color 150ms ease;
}

.language-trigger {
  gap: 5px;
  padding: 5px 2px;
}

.language-picker .language-trigger:hover,
.language-picker .language-trigger[aria-expanded="true"],
.language-list button:hover,
.language-list button[aria-current="true"] {
  color: var(--primary);
}

.language-trigger svg { width: 15px; height: 15px; }
.language-trigger .caret { width: 11px; height: 11px; }

.language-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  right: 0;
  min-width: 145px;
  padding: 5px;
  border-radius: 9px;
  background: white;
  box-shadow: 0 4px 24px #211a4b20, 0 0 0 1px #211a4b09;
  animation: language-open 140ms ease-out;
}

.language-list button {
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 6px;
}

.language-list button[aria-current="true"]::after { content: "✓"; }
.nav-actions .language-picker { margin-right: 13px; }
.nav-links .language-picker { display: none; }
.footer-bottom .language-list { top: auto; bottom: calc(100% + 4px); left: 0; right: auto; }
.policy-actions { display: flex; gap: 20px; align-items: center; }

@keyframes language-open {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 801px) and (max-width: 1199px) {
  .nav .language-picker { font-size: 12px; }
  .header .nav { gap: 12px; }
  .nav-actions .language-picker { margin-right: 3px; }
}

@media (max-width: 800px) {
  .nav-actions .language-picker { display: none; }
  .nav-links .language-picker { display: flex; align-self: flex-start; font-size: 15px; }
  .nav-links .language-trigger { padding-inline: 8px; }
  .nav-links .language-list { left: 0; right: auto; }
  .language-trigger, .language-list button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .language-list { animation: none; }
  .language-trigger, .language-list button { transition: none; }
}

/* Use the existing hamburger navigation when the desktop links need more room. */
@media (min-width: 801px) and (max-width: 1199px) {
  .header .mobile-toggle {
    display: grid;
    place-items: center;
    order: 3;
    padding: 8px;
  }
  .header .nav-actions { margin-left: auto; }
  .nav-actions .language-picker { display: none; }
  .header .nav-links {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    margin: 0;
    padding: 10px 24px 18px;
    background: white;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 12px 22px #00000010;
  }
  .header .nav-links.open { display: flex; }
  .header .nav-links > a { padding: 10px 0; }
  .nav-links .language-picker { display: flex; align-self: flex-start; }
  .nav-links .language-list { left: 0; right: auto; }
  .nav-links .language-picker button { min-height: 44px; }
}

@media (min-width: 1200px) {
  .header .nav.wrap {
    max-width: 1360px;
    width: calc(100% - 44px);
  }

  .header .nav-links {
    gap: clamp(24px, calc(6vw - 43px), 40px);
  }
}

/* Mobile footer: trim vertical space and remove the secondary tagline. */
@media (max-width: 800px) {
  .footer { padding-top: 36px; }
  .footer-grid { gap: 16px 8px; padding-bottom: 28px; }
  .footer-brand p { margin: 14px 0; }
  .footer-bottom { gap: 0; padding: 14px 0 16px; }
  .footer-bottom span:nth-child(2) { display: none; }
}

/* Keep the complete navigation visible on tablets in landscape. */
@media (min-width: 800px) and (min-height: 540px) and (max-width: 1199px) and (orientation: landscape) {
  .header .nav.wrap { width: calc(100% - 32px); gap: 10px; }
  .header .mobile-toggle { display: none; }
  .header .nav-links,
  .header .nav-links.open {
    display: flex;
    position: static;
    align-items: center;
    justify-content: center;
    flex: 1;
    flex-flow: row wrap;
    gap: 4px clamp(8px, 1.2vw, 15px);
    margin: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    background: transparent;
    font-size: 12px;
  }
  .header .nav-links > a { padding: 6px 0; min-height: 0; }
  .header .nav-links .language-picker { display: none; }
  .header .nav-actions { margin-left: 0; }
  .header .nav-actions .language-picker,
  .header .nav-actions .btn-outline { display: inline-flex; }
  .header .nav-actions .btn { font-size: 12px; padding-inline: 10px; }
}
