/**
 * Article search — nav-column search box + combined results overlay.
 * Used on the Feature Tour (osat_feature_article) and Knowledge Base
 * (osat_help_article) single templates. Palette mirrors the inline help
 * layout styles (accent #3498db, sidebar bg #f0f4f8).
 */

/* --- Nav-column search box --- */
.osat-article-search {
    margin-top: auto; /* push to the bottom of the flex sidebar */
    padding: 20px 30px 30px;
    border-top: 1px solid #d1d9e4;
}

.osat-article-search__label {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #5a6a7a;
    margin-bottom: 10px;
}

.osat-article-search__row {
    display: flex;
    gap: 8px;
}

.osat-article-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 16px; /* >=16px avoids iOS zoom-on-focus */
    border: 1px solid #c3cdd9;
    border-radius: 6px;
    background: #fff;
    color: #1a2a3a;
}

.osat-article-search__input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

.osat-article-search__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: #fff;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.osat-article-search__btn:hover { background: #2980b9; }
.osat-article-search__btn svg { display: block; }

/* --- Results overlay --- */
.osat-article-search-overlay[hidden] { display: none; }

.osat-article-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 5vh 16px;
    overflow-y: auto;
}

.osat-article-search-overlay__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.osat-article-search-overlay__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
    overflow: hidden;
}

.osat-article-search-overlay__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 28px;
    border-bottom: 1px solid #eef2f7;
}

.osat-article-search-overlay__title {
    margin: 0;
    font-size: 1.25em;
    color: #1a2a3a;
}

.osat-article-search-overlay__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #5a6a7a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.osat-article-search-overlay__close:hover { background: #f0f4f8; color: #1a2a3a; }

.osat-article-search-overlay__results {
    padding: 12px 28px 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.osat-article-search-overlay__loading,
.osat-article-search-overlay__empty {
    padding: 24px 0;
    color: #64748b;
    font-style: italic;
}

/* --- Result list --- */
.osat-article-search-list { list-style: none; margin: 0; padding: 0; }

.osat-article-search-result { border-bottom: 1px solid #eef2f7; }
.osat-article-search-result:last-child { border-bottom: none; }

.osat-article-search-result__link {
    display: block;
    padding: 18px 8px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.osat-article-search-result__link:hover { background: #f7fafd; }

.osat-article-search-result__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.osat-article-search-result__cat {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

.osat-article-search-result__title {
    margin: 0 0 6px;
    font-size: 1.1em;
    color: #2c3e50;
}

.osat-article-search-result__excerpt {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: #5a6a7a;
}

/* --- Type badges --- */
.osat-search-badge {
    flex: 0 0 auto;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    line-height: 1.4;
}

.osat-search-badge--feature {
    background: #ede7f6;
    color: #5e35b1;
}

.osat-search-badge--help {
    background: #e1f1fb;
    color: #1976d2;
}

/* Lock background scroll while the overlay is open. */
body.osat-article-search-open { overflow: hidden; }

@media (max-width: 768px) {
    .osat-article-search-overlay { padding: 0; align-items: stretch; }
    .osat-article-search-overlay__panel { max-width: none; border-radius: 0; min-height: 100%; }
    .osat-article-search-overlay__results { max-height: none; }
}
