/* search-box.css -- Reusable expand/collapse filter input (magnifier <-> clear).
 * Token-driven + mode-aware. The raised surface (border + radius + offset shadow)
 * comes from the shared `.neo-raised` class in components.css, so the search box
 * stays identical to .btn. Neo-editorial input: sans, plain placeholder, focus-within
 * affordance (cleaner/less terminal). Pairs with search-box.js. */

.search-box {
  /* Component-owned geometry (tier 3, docs/specs/design.md): width knobs --
     one per state, on the component root so a consumer overrides per context
     (e.g. a flex row) instead of hardcoding. collapsed = just the toggle;
     expanded = room for the input. */
  --search-box-collapsed: var(--space-xl);
  --search-box-expanded: 13rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: var(--space-xl);
  background: var(--bg-base);
  transition: width var(--transition-base) ease, border-color var(--transition-base) ease;
  width: var(--search-box-collapsed);
}

.search-box.expanded {
  width: var(--search-box-expanded);
}

.search-box:focus-within {
  border-color: var(--border-strong);
  background-color: var(--bg-elevated);
}

.search-box-toggle {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-lg);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.search-box-toggle:hover {
  color: var(--text-primary);
}

.search-box-icon,
.search-box-clear-icon {
  position: absolute;
  transition: opacity var(--transition-fast) ease;
}

.search-box-clear-icon {
  opacity: 0;
}

.search-box.has-value .search-box-icon {
  opacity: 0;
}

.search-box.has-value .search-box-clear-icon {
  opacity: 1;
}

.search-box-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  padding: 0 var(--space-xs);
  outline: none;
}

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