/* ── Search plugin — sidebar widget + overlay ── */

/* ── Widget sidebar ── */
.search-widget {
    margin-bottom: 1.5rem;
}

#srch-form {
    position: relative;
}

.srch-field {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.05);
}

.srch-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    min-width: 0;
}

.srch-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* Remove browser default search input clear button */
.srch-input::-webkit-search-cancel-button { display: none; }

.srch-btn {
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    padding: 0 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.srch-btn:hover {
    color: #fff;
}

/* ── Dropdown suggestions ── */
.srch-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

.srch-list__item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.35;
}

.srch-list__item:last-child { border-bottom: none; }

.srch-list__item:hover,
.srch-list__item[aria-selected="true"] {
    background: #f5f5f5;
    color: #111;
}

.srch-list__item__title {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
}

.srch-list__item__desc {
    display: block;
    font-size: 0.76rem;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

mark {
    background: rgba(255, 180, 0, 0.3);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

/* ── Overlay résultats ── */
.srch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 1rem 2rem;
    backdrop-filter: blur(2px);
}

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

.srch-overlay__inner {
    background: #fff;
    color: #333;
    border-radius: 6px;
    width: 100%;
    max-width: 680px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.srch-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.srch-overlay__title {
    font-size: 0.95rem;
    color: #555;
}

.srch-overlay__close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #888;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
}

.srch-overlay__close:hover { color: #333; background: #f0f0f0; }

/* ── Result items ── */
.srch-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.srch-results__item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.srch-results__item:last-child { border-bottom: none; }

.srch-results__item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.srch-results__item a:hover .srch-results__item__title {
    text-decoration: underline;
}

.srch-results__item__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.25rem;
}

.srch-results__item__desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.5;
}

.srch-results__item__excerpt {
    font-size: 0.82rem;
    color: #888;
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srch-empty {
    padding: 2rem 1.25rem;
    color: #888;
    text-align: center;
    font-size: 0.95rem;
}
