/* 
* Styling the Polylang language switcher 
*/

/* Remove bullet points */
.wp-block-polylang-language-switcher {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  overflow: hidden;
  font-family: var(--wp--preset--font-family--default);
  background-color: var(--wp--preset--color--base);
}

/* Each language list item */
.wp-block-polylang-language-switcher li.lang-item {
  flex: 1 1 50%; /* Equal width */
}

/* Each link */
.wp-block-polylang-language-switcher li.lang-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.5rem;
  font-size: 0;
  font-weight: 700;
  text-decoration: none;
  color: var(--wp--preset--color--primary);
  transition: all 0.25s ease;
  position: relative;
}

/* Shortcode via ::after */
.wp-block-polylang-language-switcher li.lang-item-en a::after {
  content: "EN";
  font-size: 0.9rem;
  font-weight: 700;
}
.wp-block-polylang-language-switcher li.lang-item-sv a::after {
  content: "SV";
  font-size: 0.9rem;
  font-weight: 700;
}

/* Hover & focus effect */
.wp-block-polylang-language-switcher li.lang-item a:hover,
.wp-block-polylang-language-switcher li.lang-item a:focus {
  filter: brightness(0.8);
}
.wp-block-polylang-language-switcher li.lang-item a:hover::after,
.wp-block-polylang-language-switcher li.lang-item a:focus::after {
  filter: brightness(0.8);
}

/* Hide current language if visible */
.wp-block-polylang-language-switcher li.current-lang a,
.wp-block-polylang-language-switcher li.lang-item-hidden a {
  display: none;
}