/* Footer switcher and Select2: readable in light and dark footers. */
.tm-language-switcher { position:relative; display:inline-flex; align-items:center; min-width:120px; }
.tm-language-switcher .tm-language-select { width:120px; height:36px; border:1px solid #94a3b8; border-radius:7px; background:#fff!important; color:#172033!important; padding:4px 8px; cursor:pointer; }
.tm-language-switcher .tm-language-links { display:none; }
.tm-language-switcher .select2-container { width:120px!important; }
.tm-language-switcher .select2-container--default .select2-selection--single { height:36px!important; background:#fff!important; border:1px solid #94a3b8!important; border-radius:7px; cursor:pointer; }
.tm-language-switcher .select2-container--default .select2-selection--single .select2-selection__rendered { line-height:34px!important; color:#172033!important; -webkit-text-fill-color:#172033!important; padding-left:10px; }
.tm-language-switcher .select2-container--default .select2-selection--single .select2-selection__arrow { height:34px; }
/* Select2 normally appends its menu to body, outside the footer and theme subtree. */
body .select2-container--open .tm-language-dropdown.select2-dropdown,
body .tm-language-dropdown.select2-dropdown { z-index:99999!important; background:#fff!important; border:1px solid #94a3b8!important; color:#172033!important; }
body .tm-language-dropdown .select2-search,
body .tm-language-dropdown .select2-results,
body .tm-language-dropdown .select2-results__options { background:#fff!important; color:#172033!important; }
body .tm-language-dropdown .select2-search__field { background:#fff!important; color:#172033!important; -webkit-text-fill-color:#172033!important; border:1px solid #94a3b8!important; outline-offset:1px; }
body .tm-language-dropdown .select2-results__option,
body .tm-language-dropdown .select2-results__option--selectable { background:#fff!important; color:#172033!important; -webkit-text-fill-color:#172033!important; }
body .tm-language-dropdown .select2-results__option--selected { background:#e2e8f0!important; color:#172033!important; -webkit-text-fill-color:#172033!important; }
body .tm-language-dropdown .select2-results__option--highlighted,
body .tm-language-dropdown .select2-results__option--highlighted.select2-results__option--selectable { background:#4338ca!important; color:#fff!important; -webkit-text-fill-color:#fff!important; }

/* Force a consistent light Select2 surface even when the website uses a dark theme.
   Select2's open dropdown is appended to <body>, not the footer. */
html body .tm-language-switcher .select2-container--default .select2-selection--single,
html body .tm-language-switcher .select2-container--default.select2-container--focus .select2-selection--single,
html body .tm-language-switcher .select2-container--default.select2-container--open .select2-selection--single {
    background-color:#fff!important;
    color:#172033!important;
    color-scheme:light;
}
html body .tm-language-switcher .select2-container--default .select2-selection--single .select2-selection__rendered,
html body .tm-language-switcher .select2-container--default.select2-container--focus .select2-selection__rendered,
html body .tm-language-switcher .select2-container--default.select2-container--open .select2-selection__rendered {
    color:#172033!important;
    -webkit-text-fill-color:#172033!important;
    opacity:1!important;
    text-shadow:none!important;
}
html body .select2-container--open .tm-language-dropdown .select2-results__option--selected,
html body .tm-language-dropdown .select2-results__option--selected.select2-results__option--selectable,
html body .tm-language-dropdown .select2-results__option[aria-selected="true"] {
    background-color:#e2e8f0!important;
    color:#172033!important;
    -webkit-text-fill-color:#172033!important;
}
html body .select2-container--open .tm-language-dropdown .select2-results__option--highlighted,
html body .tm-language-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
html body .tm-language-dropdown .select2-results__option--highlighted[aria-selected="true"] {
    background-color:#4338ca!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
}

/* Bootstrap dark mode: selected language must be LIGHT on DARK. */
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default .select2-selection--single,
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default.select2-container--focus .select2-selection--single,
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default.select2-container--open .select2-selection--single {
    background: #1e293b !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
    color-scheme: dark;
}
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default.select2-container--focus .select2-selection__rendered,
html[data-bs-theme="dark"] body .tm-language-switcher .select2-container--default.select2-container--open .select2-selection__rendered,
html[data-bs-theme="dark"] body .tm-language-switcher .select2-selection__rendered span {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}
html[data-bs-theme="dark"] body .tm-language-switcher .tm-language-select {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #64748b !important;
}
html[data-bs-theme="dark"] body .tm-language-dropdown.select2-dropdown,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__options,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-search {
    background: #1e293b !important;
    color: #f8fafc !important;
}
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-search__field,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__option {
    background: #1e293b !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__option--selected,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__option[aria-selected="true"] {
    background: #334155 !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__option--highlighted,
html[data-bs-theme="dark"] body .tm-language-dropdown .select2-results__option--highlighted[aria-selected="true"] {
    background: #4338ca !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
