/*
 * jobs-filter-select.css
 *
 * Optik des eigenen Filter-Dropdowns (js/jobs-filter-select.js), das die nativen
 * <select> der Stellenuebersicht ersetzt (Asana 1219394457348871).
 *
 * Der Trigger uebernimmt Rahmen, Radius, Hoehe, Padding und Schrift des jeweiligen
 * Felds zur Laufzeit per getComputedStyle (siehe JS) - hier stehen nur Layout und die
 * Teile, die kein natives Select hat (Liste, Eintraege, Pfeil). Die Template-Styles
 * zielen auf `#job-filters select` / `input`; die neuen Elemente (button, ul, li)
 * trifft diese Spezifitaet nicht, !important ist daher nicht noetig.
 *
 * (body[data-key-color]) gesetzt; der Fallback ist eine neutrale Hervorhebung.
 */

.hey-select {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.hey-select *,
.hey-select *::before,
.hey-select *::after {
    box-sizing: border-box;
}

.hey-select__trigger {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    position: relative;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: inherit;
    overflow: hidden;
}

/* Mausklick bleibt ohne Ring; nur die Tastatur-Navigation (:focus-visible) bekommt
   einen sichtbaren Fokus, sonst sieht man beim Durchtabben nicht, wo man ist (WCAG 2.4.7).
   currentColor = die vom Feld uebernommene Schriftfarbe des Triggers (copyFieldStyle). */
.hey-select__trigger:focus {
    outline: none;
}

.hey-select__trigger:focus-visible {
    outline: 2px solid currentColor;
}

.hey-select__value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: inherit;
    pointer-events: none;
}

.hey-select__arrow {
    position: absolute;
    top: 50%;
    right: 1em;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.15s ease;
}

.hey-select.is-open .hey-select__arrow {
    transform: translateY(-50%) rotate(180deg);
}

.hey-select__list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1050;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    /* Hoehe deckeln: ein Scrollbalken erscheint erst, wenn die Eintraege hoeher als
       200px sind (overflow-y: auto blendet ihn sonst aus). Der Wert ist in
       js/jobs-filter-select.js (MAX_LIST_HEIGHT) gespiegelt - beide gleich halten. */
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    color: #333333;
    text-align: left;
    /* Firefox: schmaler Balken mit etwas Abstand (eine exakte px-Breite kennt FF nicht). */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
}

/* Scrollbalken: 7px schmal, mit etwas Luft zum Rand. Die 2px transparente, auf die
   padding-box geclippte Umrandung des Thumbs schaffen den Abstand (11px Spur - 2x2px). */
.hey-select__list::-webkit-scrollbar {
    width: 11px;
}

.hey-select__list::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.hey-select__list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.hey-select__list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.42);
}

.hey-select--up .hey-select__list {
    top: auto;
    bottom: calc(100% + 4px);
}

.hey-select.is-open .hey-select__list {
    display: block;
}

.hey-select__option {
    margin: 0;
    padding: 9px 16px;
    list-style: none;
    cursor: pointer;
    line-height: 1.3;
    white-space: normal;
    color: inherit;
    background: transparent;
}

.hey-select__option.is-active {
    background: rgba(0, 0, 0, 0.06);
}

.hey-select__option.is-selected {
    font-weight: 600;
}

.hey-select__option.is-selected.is-active {
    filter: brightness(0.92);
}
