/*
 * css/search.css · The Long Game — global Find overlay styles (.find-*)
 * Purpose: the search field + grouped, ranked result rows shown by openFind() in
 *          js/app.js. Reuses the .overlay shell + .surface-card--rows; adds the
 *          search input, group headers, result rows, the match highlight, and the
 *          calm initial / no-match states. Tokens only — light + dark both work.
 * Related: js/app.js (openFind / renderFindResults / _findRow / _highlight),
 *          css/styles.css (base system: .overlay, .surface-card, .call-row-btn reset),
 *          index.html (links this with the current ?v=N), sw.js (precaches it)
 */

.find-body { padding-top: var(--space-3); }

/* ── Search field ───────────────────────────────────────────────────────────── */
.find-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
}
.find-search-icon {
  position: absolute;
  left: 13px;
  display: flex;
  color: var(--ink-soft);
  pointer-events: none;
}
.find-search-icon svg { width: 18px; height: 18px; display: block; }
.find-input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 16px 10px 40px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: 400 1rem/1.2 var(--sans);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.find-input::placeholder { color: var(--ink-soft); }
.find-input:focus-visible,
.find-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ── Results ─────────────────────────────────────────────────────────────────── */
.find-results { padding-bottom: var(--space-6); }

.find-hint { padding: var(--space-5) var(--space-3) var(--space-2); }
.find-hint-text {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

.find-group { margin-bottom: var(--space-4); }
.find-group-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: 600 0.74rem/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin: 0 0 var(--space-2) 4px;
}
.find-group-count {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
}
.find-group-more {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: var(--space-2) 0 0 4px;
}

/* ── Result row (real <button>; .call-row-btn supplies the appearance reset) ──── */
.find-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.find-row:first-child { border-top: none; }
.find-row:hover  { background: var(--surface-2); }
.find-row:active { background: var(--surface-2); }
.find-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.find-row-glyph {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--accent);
}
.find-row-body { flex: 1; min-width: 0; }
.find-row-heading {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}
.find-row-snippet {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.find-field {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 0.9;
}
.find-field-sep { color: var(--ink-soft); opacity: 0.6; }
.find-row-meta {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* The matched-term highlight — calm accent tint, never a jarring yellow. */
.find-mark {
  background: var(--verdict-better-bg);
  color: var(--accent-ink);
  border-radius: 3px;
  padding: 0 1px;
  font-weight: 600;
}
