/* ===== Search suggestions dropdown (search-suggest.js) ===== */
.srch-suggest-panel {
    --ss-surface: #ffffff;
    --ss-border: rgba(16, 12, 40, 0.1);
    --ss-text: #1f1d2b;
    --ss-muted: #6b6880;
    --ss-hover: #f3f2f8;
    --ss-accent: var(--color-primary, #49108b);
    --ss-accent-soft: rgba(73, 16, 139, 0.09);
    --ss-mark: rgba(250, 204, 21, 0.45);

    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 1200;
    min-width: 280px;
    max-height: min(420px, 70vh);
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--ss-border);
    border-radius: 14px;
    background: var(--ss-surface);
    box-shadow: 0 18px 40px rgba(16, 12, 40, 0.16);
    color: var(--ss-text);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    text-align: right;
    direction: rtl;
    overscroll-behavior: contain;
}

body.active-dark-mode .srch-suggest-panel {
    --ss-surface: #1d1d24;
    --ss-border: rgba(255, 255, 255, 0.1);
    --ss-text: #f3f3f6;
    --ss-muted: #a3a1b3;
    --ss-hover: #26262f;
    --ss-accent: #a98bf5;
    --ss-accent-soft: rgba(169, 139, 245, 0.14);
    --ss-mark: rgba(250, 204, 21, 0.3);

    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.srch-suggest-panel[hidden] {
    display: none;
}

/* A form that was position: static, so the panel sits right under it */
.srch-suggest-anchor {
    position: relative;
}

.srch-suggest-group {
    padding: 8px 10px 4px;
    color: var(--ss-muted);
    font-size: 12px;
    font-weight: 700;
}

.srch-suggest-group:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid var(--ss-border);
    padding-top: 10px;
}

.srch-suggest-panel .srch-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--ss-text);
    font-size: 14px;
    line-height: 1.7;
    text-decoration: none;
}

.srch-suggest-panel .srch-suggest-item[aria-selected="true"] {
    background: var(--ss-hover);
    color: var(--ss-text);
}

.srch-suggest-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* .srch-suggest-panel prefix: beats search.css's ".srch-area mark" padding, which splits words */
.srch-suggest-panel .srch-suggest-title mark {
    padding: 0;
    border-radius: 3px;
    background: var(--ss-mark);
    color: inherit;
}

.srch-suggest-badge {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ss-hover);
    color: var(--ss-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.8;
}

.srch-suggest-item[aria-selected="true"] .srch-suggest-badge {
    background: var(--ss-surface);
}

.srch-suggest-empty {
    padding: 10px;
    color: var(--ss-muted);
    font-size: 13px;
}

.srch-suggest-panel .srch-suggest-all {
    margin-top: 4px;
    border-top: 1px solid var(--ss-border);
    border-radius: 0 0 10px 10px;
    color: var(--ss-accent);
    font-weight: 700;
}

.srch-suggest-panel .srch-suggest-all[aria-selected="true"] {
    background: var(--ss-accent-soft);
    color: var(--ss-accent);
}

.srch-suggest-all i {
    flex: none;
    font-size: 13px;
}

@media (max-width: 575px) {
    .srch-suggest-panel {
        min-width: 0;
        max-height: 60vh;
    }
}
