/* Search feature styles (search/search.css).
   Linked from index.html alongside styles.css and uses only the design tokens
   defined there (--ink, --hairline, --surface, …) — no new colour values.
   Covers the shared result list (also rendered inside the landing inline
   search) and the Ctrl+K overlay built by search.js. The header trigger
   (.search-icon-btn) and the landing wrapper (.landing-search-*) are host
   chrome and stay in styles.css. */

/* ── Search result items ───────────────────────────────── */
.search-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 16px 6px;
  border-top: 1px solid var(--hairline);
}

.search-group-label:first-child { border-top: none; padding-top: 10px; }

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  gap: 12px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .1s;
}

.search-result-item:hover,
.search-result-item[aria-selected="true"] {
  background: var(--hover-tint);
}

.search-result-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.search-result-title mark {
  background: none;
  font-weight: 700;
  color: var(--ink);
}

.search-result-meta {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint);
}

/* ── Overlay search ────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}

.search-overlay[hidden] { display: none; }

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,24,29,.35);
  z-index: -1;
}

.search-modal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 12px 40px rgba(22,24,29,.15);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.search-field-wrap {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  gap: 10px;
}

.search-icon { color: var(--ink-muted); flex-shrink: 0; }

#search-input {
  flex: 1;
  height: 54px;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

#search-input::placeholder { color: var(--ink-faint); }

.search-close-btn {
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}

.search-close-btn:hover { color: var(--ink); }

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

/* ── Motion preferences ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .search-overlay, .search-modal { transition: none; }
}
