/* ============ Header search ============ */
/* The one global field. It sits on the page background beside the brand, the
   same way the layout area does, and it is the only place a query is typed.
   Where the query goes is decided in js/search.js; this file only draws the
   field and the highlight it can leave behind. */

.sh-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 520px;
}

.sh-search-icon {
  position: absolute;
  left: 10px;
  font-size: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.sh-search {
  width: 100%;
  height: 30px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--sh-line);
  border-radius: 999px;
  background: var(--sh-inset);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}

.sh-search::placeholder {
  color: var(--text-muted);
}

.sh-search:focus {
  border-color: var(--accent);
  background: var(--bg-mid);
}

/* ============ The Browser, in columns ============ */
/* The results page: one column per content type, only the types that matched.
   It reuses the sound library's rows and plugin cards for the things inside a
   column, so a sample looks the same here as it does in the rail. */

.bsearch {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  font-family: var(--font-ui);
  color: #f5f5f5;
}

.bsearch-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 12px 14px 10px;
  flex-shrink: 0;
}

.bsearch-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.bsearch-query {
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-text);
  font-size: 11.5px;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* What the search had to do to land: a word it corrected, or the note that the
   page fell back to its nearest matches. Muted, because it is an aside. */
.bsearch-note {
  flex-shrink: 0;
  font-family: var(--font-text);
  font-size: 10.5px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsearch-note:empty {
  display: none;
}

/* Columns share the width until they cannot, then the row scrolls sideways
   rather than squeezing a column until its content is unreadable. */
.bsearch-cols {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
}

.bsearch-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 210px;
  min-height: 0;
  border-left: 1px solid var(--sh-line);
}

.bsearch-col:first-child {
  border-left: none;
}

.bsearch-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sh-line);
  flex-shrink: 0;
}

.bsearch-col-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c8c8c8;
}

.bsearch-col-count {
  font-size: 10px;
  color: #8a8a8a;
}

.bsearch-col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0 12px;
}

.bsearch-all {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 16px;
  font-size: 12px;
  color: #9a9a9a;
  text-align: center;
}

/* The one way out of an empty page: take the matcher's nearest real word. */
.bsearch-dym {
  padding: 5px 12px;
  border: 1px solid var(--sh-line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.bsearch-dym:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bsearch-dym b {
  font-weight: 600;
}

/* ---------- A name with one line under it ---------- */
/* A preset or a project that has no picture of its own. */

.bsearch-rows {
  padding: 0 8px;
}

.bsearch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: grab;
}

.bsearch-row:hover {
  background: #484848;
}

.bsearch-row:active {
  cursor: grabbing;
}

.bsearch-row-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.bsearch-row-name {
  font-family: var(--font-text);
  font-size: 12px;
  color: #f5f5f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsearch-row-meta {
  font-family: var(--font-text);
  font-size: 9.5px;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- A project, as a row ---------- */

.bsearch-projects {
  padding: 0 8px;
}

.bsearch-proj {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 8px;
}

.bsearch-proj:hover {
  background: #484848;
}

.bsearch-proj-thumb {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
}

.bsearch-proj-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bsearch-proj-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.bsearch-proj-name {
  font-family: var(--font-text);
  font-size: 12px;
  color: #f5f5f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsearch-proj-meta {
  font-family: var(--font-text);
  font-size: 9.5px;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
