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

.wy-menu-vertical p.caption,
.wy-menu-vertical .caption-text {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}

.wy-menu-vertical p.caption {
  margin-bottom: 4px;
}

.wy-menu-vertical a {
  white-space: normal;
  overflow-wrap: anywhere;
}

.wy-menu-vertical li.toctree-l1 > a,
.wy-menu-vertical li.toctree-l2 > a,
.wy-menu-vertical li.toctree-l3 > a {
  line-height: 1.35;
}


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

.ts3d-language-switcher {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-end: 28px;
  z-index: 50;

  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  font-size: 13px;
}

.ts3d-language-switcher label {
  margin: 0;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.ts3d-language-switcher select {
  height: 32px;
  min-width: 150px;

  padding: 0 32px 0 10px;

  border: 1px solid #cfd6df;
  border-radius: 4px;

  background: #ffffff;
  color: #1f2937;

  font-size: 13px;
  line-height: 1.2;

  cursor: pointer;
}

.ts3d-language-switcher select:hover {
  border-color: #aeb7c2;
}

.ts3d-language-switcher select:focus {
  outline: none;
  border-color: #0076bc;
  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;
  }
}