/* =================================================================
   Site search — results page + topbar search bar (web) / icon (touch).
   Built on shared design tokens (see themes/*/default/style.css).
   ================================================================= */

/* ---------- Main search bar — one unified pill instead of a plain
   input + separate button, matching the same treatment used across
   the site's other module search bars. ---------- */
.se-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 640px;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .3rem .3rem .3rem 1rem;
    margin-bottom: 1rem;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.se-form:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft, rgba(90, 130, 187, .15)); }
.se-form-icon { display: inline-flex; align-items: center; color: var(--ink-soft); font-size: .9rem; flex-shrink: 0; margin-right: .6rem; }
.se-form input[type=text] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: .95rem;
    padding: .6rem 0;
    color: var(--ink);
}
.se-form-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: none;
    background: var(--indigo);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .85rem;
    transition: background .12s ease;
}
.se-form-btn:hover { background: var(--indigo-deep, var(--indigo)); }

/* ---------- Compact section search bar (Community, Forum, Blog,
   Downloads, Members) — same unified-pill treatment, smaller. ---------- */
.search-row { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.search-row .compact-search-form { flex: 1; margin-bottom: 0; }

.compact-search-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .2rem .2rem .2rem .8rem;
    margin-bottom: 1rem;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.compact-search-form:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft, rgba(90, 130, 187, .15)); }
.compact-search-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: .88rem;
    color: var(--ink);
    padding: .55rem 0;
}
.compact-search-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--indigo);
    color: #fff;
    cursor: pointer;
    font-size: .8rem;
    transition: background .12s ease;
}
.compact-search-form button:hover { background: var(--indigo-deep, var(--indigo)); }

.se-summary { margin: .5rem 0 1rem; font-size: .88rem; }

/* ---------- Quick-jump chips — shown only when results span more than
   one category, so the whole breakdown is visible at a glance instead
   of needing to scroll past every section to see what matched. ---------- */
.se-jump-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
}
.se-jump-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .12s ease, background .12s ease;
}
.se-jump-chip:hover { border-color: var(--indigo); background: var(--indigo-soft, var(--paper)); }

.se-group { margin-bottom: 1.75rem; }
.se-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .65rem; gap: .5rem; }
.se-group-head h3 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: .98rem; }
.se-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--indigo-soft, var(--paper));
    color: var(--indigo);
    font-size: .82rem;
    flex-shrink: 0;
}
.se-group-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 .35rem;
    background: var(--paper); color: var(--ink-soft); border-radius: 999px;
    font-size: .7rem; font-weight: 700;
}
.se-see-all {
    font-size: .8rem; font-weight: 600; color: var(--indigo); text-decoration: none;
    white-space: nowrap; flex-shrink: 0;
}
.se-see-all:hover { text-decoration: underline; }

/* ---------- Result cards ---------- */
.se-results-list { display: flex; flex-direction: column; gap: .5rem; }
.se-result {
    display: flex; gap: .8rem; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: .75rem .9rem; text-decoration: none; color: inherit;
    transition: border-color .12s ease, box-shadow .12s ease, transform .1s ease;
}
.se-result:hover { border-color: var(--indigo); box-shadow: 0 6px 16px -10px rgba(0,0,0,.22); transform: translateY(-1px); }
.se-result-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.se-result-thumb { flex-shrink: 0; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: var(--paper); }
.se-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.se-result-avatar {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
    background: var(--indigo); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .88rem;
}
.se-result-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.se-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; padding-top: .1rem; }
.se-result-body strong { font-size: .9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-result-excerpt { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.se-result-meta { font-size: .74rem; color: var(--ink-soft); }
.se-result-member { align-items: center; }

/* ---------- Topbar search — web theme (full input) ------------------ */
.topbar-search-form { display: flex; align-items: center; flex: 1; max-width: 360px; margin: 0 .75rem; }
.topbar-search-input {
    width: 100%; padding: .45rem .85rem; border: 1px solid var(--border); border-radius: 5px;
    background: var(--paper); font-family: inherit; font-size: .85rem;
    transition: border-color .12s ease, background .12s ease;
}
.topbar-search-input:focus { outline: none; border-color: var(--indigo); background: var(--surface); }

/* ---------- Topbar search — touch theme (icon only) ------------------ */
.app-bar-search-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%; color: var(--ink);
    font-size: 1.05rem; text-decoration: none; flex-shrink: 0;
    margin-left: auto;
}
.app-bar-search-icon:hover { background: var(--paper); }

@media (max-width: 720px) {
    .topbar-search-form { display: none; }
}

/* Belt-and-suspenders: forces the intended row layout on touch theme
   regardless of any other rule that might otherwise interfere, since a
   button was observed wrapping onto its own line there. */
body.touch-theme .se-form,
body.touch-theme .compact-search-form {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: center !important;
}
body.touch-theme .se-form input[type=text],
body.touch-theme .compact-search-form input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
body.touch-theme .se-form-btn,
body.touch-theme .compact-search-form button {
    flex: 0 0 auto !important;
}

@media (max-width: 560px) {
    .se-result-body strong { font-size: .86rem; }
    .se-jump-chip { font-size: .74rem; padding: .3rem .6rem; }
}
