@use "../../../00-base/00-config/00-variables" as *;
@use "../../../00-base/01-helpers" as *;

////////////////////////////////////////////////////////////////////////////////
// *
// * Menu links: language
// *
////////////////////////////////////////////////////////////////////////////////

.block--language-blocklanguage-interface {
  position: relative;
}

// * Inline list
// ===========================================================================

.nav__item--language {
  display: inline;
}

// * Dropdown
// ===========================================================================

// hide title visually

.nav--language--dropdown {
  text-align: right;

  // hide language nav, because we show it elsewhere on mobile
  // .nav-section & {
  //   display: none;
  // }
}

// active language

.nav__active--language--dropdown {
  cursor: pointer;
  position: relative;
  padding: rem(5) rem(16) rem(5) 0;

  @include icon((
    icon: chevron-down,
    size: 10,
    position: absolute,
    right: 0,
    top: 50%,
  ));

  &::before {
    transform: translateY(-50%);
  }
}

// list

.nav__items--language--dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 100%;
  margin: 0;
  padding: 0;
  background: hsl(var(--clr-white));
  transition: all $duration $easing;

  .js-open > & {
    box-shadow: 0 0 rem(15) hsla(var(--clr-black), .2);
  }
}

// list item

.nav__item--language--dropdown {
  display: block;
  overflow: hidden;
  max-height: 0;
  margin: 0;
  transition: all $duration $easing;

  .js-open > ul > & {
    max-height: rem(100);
  }
  &:last-child {
    .nav__link--language--dropdown {
      border: none;
    }
  }
}

.nav__link--language--dropdown {
  display: block;
  padding: rem(5) rem(10);
  border-bottom: rem(1) solid hsl(var(--clr-border));
  text-align: center;

  // no underline
  &::after {
    content: none;
  }
}
