/* Language Switcher Enhancement - Hide Active and Untranslated Languages */

/* Container styling */
.language-switcher-locale-url {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* List items */
.language-switcher-locale-url li {
  display: inline-block;
  margin: 0;
  position: relative;
}

/* Hide active language completely */
.language-switcher-locale-url li.active,
.language-switcher-locale-url li:has(span.language-link.locale-untranslated) {
  display: none;
  margin-left: unset!important;
}

/* Fallback for browsers that don't support :has */
.language-switcher-locale-url li span.language-link.locale-untranslated {
  display: none;
}

/* Links */
.language-switcher-locale-url li a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  transition: all 0.2s ease;
  position: relative;
}

/* Hover effect */
.language-switcher-locale-url li a:hover {
  background-color: #e9e9e9;
  color: #009555;
}

/* Dividers between languages */
.language-switcher-locale-url li:not(:last-child):after {
  content: '';
  position: absolute;
  right: 0;
  top: 10px;
  height: 16px;
  width: 1px;
  background-color: #ddd;
}

/* First and last items - adjust styling when items are hidden */
.language-switcher-locale-url li:first-of-type:not([style*="display: none"]) a {
  padding-left: 14px;
}

.language-switcher-locale-url li:last-of-type:not([style*="display: none"]) a {
  padding-right: 14px;
}

/* For RTL languages (Arabic) */
.language-switcher-locale-url li.ar a {
  font-size: 14px;
}

/* Alternative approach to hide items with untranslated content */
.language-switcher-locale-url li:has(> span.language-link.locale-untranslated) {
  display: none;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .language-switcher-locale-url {
    justify-content: center;
  }
  
  .language-switcher-locale-url li a {
    padding: 10px 14px;
  }
}

@media screen and (min-width: 768px) {
    #block-locale-language {
        padding-top: 8px!important; 
       font:-size:1em;
    }
     #block-search-form {
        width: 220px;
        padding-top: 8px;
        margin-right: 2em;
}
}
