/*
 * Control Soft & Automation — V1.8.24 multilingual header repair.
 * Scope: header/navigation only. No content, SEO, canonical or hreflang changes.
 */

/* Keep every desktop menu label intact; CSA Platform must never wrap. */
@media (min-width: 861px) {
  .site-header__inner {
    gap: 10px;
  }

  .brand {
    width: 205px;
    flex: 0 0 205px;
  }

  .theme-toggle {
    flex: 0 0 42px;
    width: 42px;
    margin-left: 0 !important;
  }

  .csa-lang-switcher {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0 2px 0 0 !important;
    align-items: center;
    gap: 3px !important;
    font-size: 10px !important;
    line-height: 1;
    letter-spacing: .035em !important;
    white-space: nowrap;
  }

  .csa-lang-switcher > span {
    display: none;
  }

  .csa-lang-switcher > a {
    display: inline-flex;
    min-width: 27px;
    height: 27px;
    padding: 0 5px;
    border: 1px solid transparent;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    color: #b8cadd;
    background: transparent;
    font-weight: 850;
    text-align: center;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
  }

  .csa-lang-switcher > a:hover {
    border-color: rgba(41, 199, 255, .3);
    color: #fff;
    background: rgba(41, 199, 255, .08);
  }

  .csa-lang-switcher > a[aria-current="page"] {
    border-color: rgba(41, 199, 255, .48);
    color: #29c7ff;
    background: rgba(41, 199, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(41, 199, 255, .04);
  }

  .site-nav {
    min-width: 0;
    gap: 10px !important;
  }

  .csa-nav-list {
    min-width: 0;
    gap: 11px !important;
  }

  .csa-nav-list li,
  .csa-nav-list a {
    white-space: nowrap;
  }

  .csa-nav-list a {
    font-size: 11px !important;
    letter-spacing: .005em;
  }

  .site-nav > .button.button--small {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 13px;
    white-space: nowrap;
    font-size: 10px;
  }
}

/* More room for the longer Romanian menu before the mobile breakpoint. */
@media (min-width: 861px) and (max-width: 1240px) {
  .brand {
    width: 180px;
    flex-basis: 180px;
  }

  .site-header__inner {
    gap: 7px;
  }

  .site-nav,
  .csa-nav-list {
    gap: 8px !important;
  }

  .csa-nav-list a {
    font-size: 10px !important;
  }

  .csa-lang-switcher > a {
    min-width: 25px;
    height: 25px;
    padding-inline: 4px;
  }
}

/* Mobile/tablet: keep the language selector compact next to theme/menu controls. */
@media (max-width: 860px) {
  .csa-lang-switcher {
    display: inline-flex;
    margin-left: auto !important;
    margin-right: 0 !important;
    align-items: center;
    gap: 2px !important;
    font-size: 9px !important;
    letter-spacing: .03em !important;
  }

  .csa-lang-switcher > span {
    display: none;
  }

  .csa-lang-switcher > a {
    display: inline-flex;
    min-width: 25px;
    height: 25px;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    color: #b8cadd;
    font-weight: 850;
  }

  .csa-lang-switcher > a[aria-current="page"] {
    border-color: rgba(41, 199, 255, .44);
    color: #29c7ff;
    background: rgba(41, 199, 255, .09);
  }
}

/* Light mode readability. */
html[data-theme="light"] .csa-lang-switcher > a {
  color: #36566b;
}
html[data-theme="light"] .csa-lang-switcher > a:hover,
html[data-theme="light"] .csa-lang-switcher > a[aria-current="page"] {
  border-color: rgba(8, 127, 245, .35);
  color: #0565d5;
  background: rgba(8, 127, 245, .07);
}
