/**
 * EventHub Auswahl-Liste – Suchfeld und Zeilen zum Wählen
 *
 * Gemeinsame Bauteile für alle Fenster, in denen etwas aus einer Liste gewählt wird:
 * - Kategorien-Flyout der Filterleiste (Übersicht, Karte): .eventhub-category-flyout
 * - Interessen-Fenster des Entdecken-Feeds: .eventhub-interests
 *
 * Aufbau einer Zeile:  Icon (Kreis) | Name + Zusatzzeile | Haken (Kreis)
 *   <button class="eventhub-pick-row" aria-checked="true|false">
 *     <span class="eventhub-pick-row__icon">…</span>
 *     <span class="eventhub-pick-row__text">
 *       <span class="eventhub-pick-row__name">…</span>
 *       <span class="eventhub-pick-row__meta">12 Termine</span>
 *     </span>
 *     <span class="eventhub-pick-row__check">…</span>
 *   </button>
 * Gewählt: aria-checked="true" oder die Klasse .is-selected. Ohne Termine: .is-idle.
 *
 * Die !important-Angaben halten Theme-Regeln für Knöpfe und Eingabefelder fern
 * (Großschrift, Außenabstand, Hintergrund).
 *
 * @package EventHub
 */

/* Auf body, nicht :root: Themes setzen --eventhub-color-primary erst dort. */
body {
    --eh-pick-accent: var(--eventhub-color-primary, #0073aa);
    --eh-pick-soft: color-mix(in srgb, var(--eh-pick-accent) 9%, #fff);
    --eh-pick-field: var(--eventhub-color-bg-light, #f2f2f2);
    --eh-pick-line: #e4e4e4;
    --eh-pick-muted: #666;
    --eh-pick-text: #1a1a1a;
}

/* ==========================================================================
   Suchfeld
   ========================================================================== */

.eventhub-pick-search__field {
    position: relative;
    display: block;
    margin: 0;
}

.eventhub-pick-search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    color: var(--eh-pick-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

body .eventhub-pick-search__field .eventhub-pick-search__input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 2.75rem;
    margin: 0 !important;
    padding: 0 14px 0 42px !important;
    border: 2px solid transparent !important;
    border-radius: 50px !important;
    background: var(--eh-pick-field) !important;
    color: var(--eh-pick-text) !important;
    font: inherit;
    font-size: 0.9375rem;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

body .eventhub-pick-search__field .eventhub-pick-search__input:focus {
    border-color: var(--eh-pick-accent) !important;
    background: #fff !important;
    outline: none !important;
}

/* ==========================================================================
   Liste und Zeile
   ========================================================================== */

.eventhub-pick-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.eventhub-pick-list > li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--eh-pick-line);
}

.eventhub-pick-list > li[hidden] {
    display: none;
}

body .eventhub-pick-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 3.5rem;
    margin: 0 !important;
    padding: 0.5rem 0.25rem !important;
    border: 0;
    border-radius: 8px;
    background: none !important;
    color: var(--eh-pick-text) !important;
    font: inherit;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: left;
    text-transform: none !important;
    cursor: pointer;
}

body .eventhub-pick-row:hover {
    background: rgb(0 0 0 / 0.04) !important;
}

body .eventhub-pick-row[aria-checked='true'],
body .eventhub-pick-row.is-selected {
    background: var(--eh-pick-soft) !important;
}

body .eventhub-pick-row:focus-visible {
    outline: 2px solid var(--eh-pick-accent);
    outline-offset: -2px;
}

.eventhub-pick-row__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--eh-pick-field);
    color: var(--eh-pick-accent);
}

.eventhub-pick-row__icon svg,
.eventhub-pick-row__icon img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.eventhub-pick-row__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.eventhub-pick-row__name {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eventhub-pick-row__meta {
    color: var(--eh-pick-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.eventhub-pick-row__meta:empty {
    display: none;
}

.eventhub-pick-row__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    box-sizing: border-box;
    border: 2px solid #b9bcc3;
    border-radius: 50%;
    color: transparent;
}

.eventhub-pick-row[aria-checked='true'] .eventhub-pick-row__check,
.eventhub-pick-row.is-selected .eventhub-pick-row__check {
    border-color: var(--eh-pick-accent);
    background: var(--eh-pick-accent);
    color: #fff;
}

/* Ohne kommende Termine: etwas zurückgenommen, aber wählbar. */
.eventhub-pick-row.is-idle .eventhub-pick-row__name {
    color: #5c5f66;
}

.eventhub-pick-row.is-idle .eventhub-pick-row__icon {
    opacity: 0.6;
}
