/* ── Multiselect optgroup labels ──────────────────────────────────────────── */

.ms-options li.optgroup > span {
    padding-left: 8px !important;
}

.ui-autocomplete {
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── [appcast_search_autocomplete] shortcode ────────────────────────────────── */

.appcast-ac-wrap {
    position: relative;
    width: 100%;
    z-index: 1000;
}

.appcast-ac-form {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.appcast-ac-field-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.appcast-ac-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY( -50% );
    color: #888;
    pointer-events: none;
    display: inline-flex;
}

.appcast-ac-wrap input.appcast-ac-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 44px 12px 48px !important;
    font-size: 16px;
    line-height: 1.4;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff !important;
    color: #222 !important;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.appcast-ac-input:focus {
    border-color: #666;
    box-shadow: 0 0 0 3px rgba( 0, 0, 0, 0.06 );
}

.appcast-ac-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY( -50% );
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}

.appcast-ac-clear:hover {
    color: #333;
    background: #f0f0f0;
}

.appcast-ac-submit {
    flex: 0 0 auto;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    white-space: nowrap;
    transition: background 0.15s;
}

.appcast-ac-submit:hover {
    background: #000;
}

/* ── Dropdown ─────────────────────────────────────────────────────────────── */

.appcast-ac-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba( 0, 0, 0, 0.12 );
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 480px;
    overscroll-behavior: contain;
}

/* ── Item rows ────────────────────────────────────────────────────────────── */

.appcast-ac-item {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr auto 20px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 18px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-top: 1px solid #f3f3f3;
    transition: background 0.1s;
    text-align: left;
}

.appcast-ac-item * {
    text-align: inherit;
}

.appcast-ac-item:first-of-type {
    border-top: none;
}

.appcast-ac-item:hover,
.appcast-ac-item--active {
    background: #f3f7fc;
}

.appcast-ac-item--active::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 3px;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}

.appcast-ac-item-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    border-radius: 50%;
    color: #555;
}

.appcast-ac-item-icon svg {
    width: 18px;
    height: 18px;
}

.appcast-ac-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-self: start;
}

.appcast-ac-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appcast-ac-item-title mark {
    background: #fde68a;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.appcast-ac-item-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appcast-ac-item-chips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.appcast-ac-item-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    transform: translateX( -4px );
}

.appcast-ac-item-arrow svg {
    width: 18px;
    height: 18px;
}

.appcast-ac-item--active .appcast-ac-item-arrow {
    opacity: 1;
    transform: translateX( 0 );
}

/* ── Chips ────────────────────────────────────────────────────────────────── */

.appcast-ac-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 999px;
    line-height: 1.4;
    white-space: nowrap;
}

.appcast-ac-chip--job {
    background: #dcfce7;
    color: #15803d;
}

.appcast-ac-chip--location {
    background: #fee2e2;
    color: #b91c1c;
}

.appcast-ac-chip--page {
    background: #e5e7eb;
    color: #374151;
}

.appcast-ac-chip--extra {
    background: #fef3c7;
    color: #92400e;
}

.appcast-ac-chip--count {
    background: #fbbf24;
    color: #422006;
}

.appcast-ac-chip--recent {
    background: #e0e7ff;
    color: #3730a3;
}

/* ── Empty-state sections (RECENT / POPULAR) ─────────────────────────────── */

.appcast-ac-section {
    padding: 12px 16px;
    border-top: 1px solid #f3f3f3;
}

.appcast-ac-section:first-child {
    border-top: none;
}

.appcast-ac-section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 10px;
}

.appcast-ac-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.appcast-ac-section-icon svg {
    width: 13px;
    height: 13px;
}

.appcast-ac-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.appcast-ac-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #1f2937;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    cursor: pointer;
}

.appcast-ac-chip-link:hover,
.appcast-ac-chip-link.appcast-ac-chip-link--active {
    background: #f3f7fc;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.appcast-ac-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.appcast-ac-chip-icon svg {
    width: 14px;
    height: 14px;
}

.appcast-ac-chip-label {
    white-space: nowrap;
}

.appcast-ac-chip-count {
    margin-left: 6px;
    padding-left: 8px;
    border-left: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Mobile (≤640px) — give the row more breathing room ──────────────────── */

@media ( max-width: 640px ) {
    .appcast-ac-form {
        gap: 6px;
    }

    .appcast-ac-wrap input.appcast-ac-input {
        padding: 10px 38px 10px 42px !important;
        font-size: 15px;
        border-radius: 6px;
    }

    .appcast-ac-search-icon {
        left: 12px;
    }

    .appcast-ac-clear {
        right: 8px;
    }

    .appcast-ac-submit {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 6px;
    }

    .appcast-ac-dropdown {
        max-height: 60vh;
    }

    /* Item rows: stack chips below the title so long section names don't squeeze it */
    .appcast-ac-item {
        grid-template-columns: 28px 1fr 16px;
        grid-template-areas:
            "icon text  arrow"
            ".    chips arrow";
        gap: 6px 10px;
        padding: 10px 12px 10px 14px;
    }

    .appcast-ac-item-icon {
        grid-area: icon;
        width: 28px;
        height: 28px;
    }

    .appcast-ac-item-icon svg {
        width: 15px;
        height: 15px;
    }

    .appcast-ac-item-text {
        grid-area: text;
    }

    .appcast-ac-item-title {
        font-size: 14px;
        white-space: normal; /* allow wrap on narrow viewports */
    }

    .appcast-ac-item-sub {
        font-size: 12px;
    }

    .appcast-ac-item-chips {
        grid-area: chips;
        justify-self: start;
        flex-wrap: wrap;
    }

    .appcast-ac-item-arrow {
        grid-area: arrow;
    }

    /* Cap chip width so something like "WINERIES & TASTING ROOM" truncates instead of pushing the layout */
    .appcast-ac-chip {
        max-width: 12em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Empty-state pills (recent / popular) also need smaller padding */
    .appcast-ac-section {
        padding: 10px 12px;
    }

    .appcast-ac-chip-link {
        padding: 5px 11px;
        font-size: 12px;
    }
}

/* ── Hide old group label (kept for safety if a cached HTML still references it) ─ */

.appcast-ac-group-label {
    display: none;
}
