/* Language switcher (inc/alg-lang-switcher.php) */

.alg-lang {
  margin: 0;
}
.alg-lang__link {
  margin: 0;
  text-decoration: none !important; /* theme link styles add underlines */
}

/* Desktop: dropdown at the left end of the top bar */
.alg-lang--bar {
  display: none;
}

@media (min-width: 992px) {
  /* Sits over the top bar (outside it, because the bar clips overflow for its glass effect) */
  .alg-lang--bar {
    display: block;
    position: absolute;
    top: 0;
    left: max(15px, calc((100% - 1700px) / 2 + 15px));
    z-index: 3;
    height: 48px;
  }
  .alg-lang__current {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    margin: 0;
    padding: 0 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    list-style: none;
    cursor: pointer;
    user-select: none;
  }
  .alg-lang__current::-webkit-details-marker {
    display: none;
  }
  .alg-lang__globe,
  .alg-lang__chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .alg-lang__globe {
    color: #C5A867;
  }
  .alg-lang__chevron {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
  }
  .alg-lang[open] .alg-lang__chevron {
    transform: rotate(180deg);
  }
  .alg-lang__current:focus-visible,
  .alg-lang__link:focus-visible {
    outline: 2px solid #C5A867;
    outline-offset: -2px;
  }

  .alg-lang__menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    margin: 0;
    padding: 6px 0;
    background: #222766;
    border-top: 2px solid #C5A867;
    box-shadow: 0 12px 28px rgba(15, 17, 40, .3);
  }
  .alg-lang__menu .alg-lang__link {
    display: block;
    padding: 12px 18px;
    color: #fff !important; /* beats theme link colors */
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
  }
  .alg-lang__menu .alg-lang__link[aria-current] {
    color: #C5A867 !important;
  }

  /* Room for the switcher before the slogan */
  .MainHeader .alg-mcta--lang .alg-mcta__slogan {
    padding-left: 150px;
  }
}

@media (min-width: 992px) and (hover: hover) {
  .alg-lang__menu .alg-lang__link:hover {
    background: rgba(255, 255, 255, .08);
  }
}

/* Phones and tablets: English / Spanish at the top left of the menu panel, beside Close */
.alg-lang--panel {
  display: none;
}

@media (max-width: 991.98px) {
  .alg-nav-js .alg-lang--panel {
    display: flex;
    position: absolute;
    top: 14px;
    left: 14px;
    gap: 4px;
  }
  .alg-lang--panel .alg-lang__link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 4px;
    color: #fff !important; /* beats theme link colors */
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .alg-lang--panel .alg-lang__link[aria-current] {
    border-color: #C5A867;
    background: #C5A867;
    color: #222766 !important;
  }
}
