/* --- Multilingual sidebar wrapping fixes --- */

.wy-menu-vertical {
  p.caption,
  .caption-text,
  a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}


/* ---  TOP-RIGHT LANGUAGE SWITCHER --- */

.ts3d-language-switcher {
  --font-size: calc(13rem/var(--root-font-factor)); /* computes to 13px but allows for scaling with user settings */
  position: absolute;
  display: inline-flex;
  inset-block-start: 18px;
  inset-inline-end: 28px;
  align-items: center;
  gap: 0.5em;
  z-index: 50;
  font-size: var(--font-size);
  
  label {
    margin: 0;
    font-weight: bold;
  }
  
  select {
    height: 32px;
    min-width: 150px;
    padding: 0 32px 0 10px;
    border: 1px solid var(--search-grey);
    border-radius: 4px;
    background: #fff;
    font-size: var(--font-size);
    line-height: 1.2;
    cursor: pointer;
  
    &:hover {
      border-color: hsl(from var(--search-grey) h s calc(l * .9));
    }
    
    &:focus {
      outline: none;
      border-color: var(--ts3d-lt-blue);
      box-shadow: 0 0 0 2px rgba(0, 118, 188, 0.18);
    }
  }
}

/* Make room for the switcher */

.wy-nav-content {
  position: relative;
  padding-top: 64px;
}


/* --- MOBILE / TABLET --- */

@media (max-width: 768px) {

  .ts3d-language-switcher {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 18px;
  }

  .wy-nav-content {
    padding-top: 1.618em;
  }

  .ts3d-language-switcher select {
    min-width: 130px;
  }
}