/* Floating switcher */
.trp-floating-switcher {
    display: flex;
    flex-direction: column-reverse;
    position: fixed;
    z-index: 99999;
    overflow: hidden;
    padding: var(--switcher-padding, 10px);
    border: var(--border, none);
    border-radius: var(--border-radius, 8px);
    background: var(--bg, #fff);
    width: var(--switcher-width, auto);
    top: var(--top, unset);
    right: var(--right, unset);
    bottom: var(--bottom, unset);
    left: var(--left, unset);
    box-shadow: 0 10px 20px 0 #0000000D;
}

.trp-floating-switcher .trp-switcher-dropdown-list {
    flex-direction: column-reverse;
}

/* Inline variant */

/* Powered by */

/* Shortcode switcher */

/* Hide the anchor that holds space in the document for the actual switcher. Only if opposite mode is not enabled. We show only the anchor in opposite mode */
/* Opposite mode enabled */

/* Shared by both */
.trp-language-switcher-inner {
    display: flex;
}

.trp-floating-switcher .trp-language-switcher-inner {
    flex-direction: column-reverse;
}

.trp-switcher-dropdown-list {
    display: flex;
    overflow-y: hidden; /* closed state */
    transition: max-height 0.2s ease-in-out;
    max-height: 0;
    transition-duration: var(--transition-duration);
}

/* OPEN STATE — scroll the LIST (floating & shortcode) */
.trp-ls-dropdown.is-open .trp-switcher-dropdown-list,
.trp-ls-dropdown[aria-expanded="true"] .trp-switcher-dropdown-list {
    overflow-y: auto;
    max-height: min(350px, 70vh);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--text) transparent;
}

/* Links inside switcher */
.trp-language-item:focus { outline: none; }
.trp-language-item:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: -2px;
}

/* Items */
.trp-language-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    text-decoration: none;
    min-height: 19px;
    box-sizing: content-box;
}

.trp-language-item:hover {
    background: var(--bg-hover, #f3f3f3);
}

.trp-language-item:hover .trp-language-item-name {
    color: var(--text-hover, #000);
}

.trp-language-item__current {
    pointer-events: none;
    cursor: default;
}

.trp-language-item-name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text, #000);
    font-size: var(--font-size, 14px);
    line-height: 1.2;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    font-weight: 400;
}

.trp-flag-image {
    border-radius: var(--flag-radius, 0) !important;
    aspect-ratio: var(--aspect-ratio, 4/3) !important;
    width: var(--flag-size, 18px) !important;
    display: inline-block !important;
    height: auto !important;
}

/* WebKit scrollbar styling on the ACTUAL scrollable element */
.trp-switcher-dropdown-list::-webkit-scrollbar { width: 6px; }
.trp-switcher-dropdown-list::-webkit-scrollbar-track { background: transparent; }
.trp-switcher-dropdown-list::-webkit-scrollbar-thumb {
    background-color: var(--text);
    border-radius: 4px;
}

.trp-switcher-dropdown-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-hover);
}

/* Menu item */

@media (prefers-reduced-motion: reduce) {
    .trp-switcher-dropdown-list {
        transition: none !important; /* no max-height animation */
    }
}

/* Legacy Language Switcher shortcode css rules
 * Useful for displaying the Automatic Language Detection language switcher
*/
