/* app/static/search.css - WEVA-W-229: the header search's results panel.
 *
 * The panel's frame (position under the field, border, ground, shadow, z-index)
 * is W-222's `.shell-search-results` in shell.css; the rows are W-222's list row
 * (.list-row, .list-row-mark, .list-row-body). This file adds only what the
 * results need on top: groups, the Save button, notes, the creator view, and a
 * height limit. Every value is a token from tokens.css, so light and dark follow
 * the shell. Loaded by app/templates/_search_panel.html. */

.shell-search-results.search-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: min(70vh, 34rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--c-text);
  font-size: var(--fs-desc);
  text-align: left;
  animation: shell-rise var(--dur-fast) var(--ease-out) both;
}
.shell-search-results.search-panel[hidden] { display: none; }

/* ---- groups ---- */
.search-group { display: flex; flex-direction: column; min-width: 0; }
.search-group + .search-group { margin-top: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--c-line); }
.search-group-head {
  margin: 0;
  padding: var(--space-2) var(--space-2) var(--space-1);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-text-2);
}

/* ---- one result: the row (a link or, for a creator, a button) and Save ---- */
.search-row { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.search-panel .search-hit {
  flex: 1;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-panel button.search-hit { width: 100%; }
.search-panel .search-hit:hover,
.search-panel .search-hit:focus-visible { background: var(--c-accent-wash); }
.search-panel .search-hit:focus-visible { outline: 2px solid var(--c-line-accent); outline-offset: -2px; }
.search-panel .list-row-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-mark { position: relative; }
.search-mark-skill { border-radius: var(--radius-small); }
.search-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.search-go { margin-left: auto; color: var(--c-text-3); }

/* Save on a result: shell.css's .save-toggle.is-icon (W-236 criterion 3) */
.search-save { flex: none; }
.search-save:focus-visible { outline: 2px solid var(--c-line-accent); outline-offset: -2px; }

/* ---- a creator's skills ---- */
.search-creator-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.search-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-control);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-meta);
  cursor: pointer;
}
.search-back:hover { border-color: var(--c-line-hover); }
.search-back:focus-visible { outline: 2px solid var(--c-line-accent); outline-offset: 2px; }
.search-back-icon { width: 16px; height: 16px; transform: rotate(180deg); }

/* ---- notes: empty, "more", a refusal, and the scope line ---- */
.search-note { margin: 0; padding: var(--space-2); font-size: var(--fs-meta); color: var(--c-text-2); overflow-wrap: anywhere; }
.search-more { padding-top: 0; }
.search-empty { color: var(--c-text); font-size: var(--fs-desc); }
.search-banner { border-radius: var(--radius-small); background: var(--c-warn-wash); color: var(--c-warn); }
.search-scope { margin-top: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--c-line); font-size: var(--fs-badge); }

@media (prefers-reduced-motion: reduce) {
  .shell-search-results.search-panel { animation: none; }
}
