/* Shared ⌘K place-search modal (search-modal.js).
 *
 * Loaded by pages that use the shared modal (currently /forecast). The
 * /weather-events page ships its own copy of these rules inline because it
 * themes them with its dark page tokens; this file is the standalone source
 * for every other page with the search header.
 *
 * Colours read the host page's design tokens when present and fall back to a
 * light palette otherwise, so the dialog matches whatever page mounts it.
 * z-index sits above the topnav (which is z-index:100). */

.search-modal { position: fixed; inset: 0; z-index: 200; }
.search-modal[hidden] { display: none; }

.search-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--page-bg, #f5f5f7) 70%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}

.search-box {
  position: absolute; top: 14vh; left: 50%; transform: translateX(-50%);
  width: min(540px, calc(100vw - 32px));
  background: var(--sheet-bg, #ffffff); border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: min(64vh, 560px);
}
@media (prefers-reduced-motion: no-preference) {
  .search-box { animation: gc-search-in 160ms cubic-bezier(0.32, 0.72, 0, 1); }
  @keyframes gc-search-in { from { opacity: 0; transform: translate(-50%, -8px); } }
}

.search-field {
  flex: none; display: flex; align-items: center; gap: 11px;
  padding: 15px 16px; border-bottom: 1px solid var(--hair, rgba(23, 23, 23, 0.09));
}
.search-field .i-search { width: 18px; height: 18px; flex: none; color: var(--ink-3, rgba(23, 23, 23, 0.38)); }
.search-field input {
  flex: 1; min-width: 0; appearance: none; border: 0; background: transparent;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--ink, #171717);
}
.search-field input::placeholder { color: var(--ink-3, rgba(23, 23, 23, 0.38)); font-weight: 500; }
.search-field input:focus { outline: none; }
.search-close {
  flex: none; appearance: none; border: 0; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--seg-bg, rgba(23, 23, 23, 0.06)); color: var(--ink-2, rgba(23, 23, 23, 0.55));
}
.search-close svg { width: 15px; height: 15px; }
.search-close:hover { background: var(--hair, rgba(23, 23, 23, 0.09)); color: var(--ink, #171717); }

.search-results { margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.search-result {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.search-result.is-active, .search-result:hover { background: var(--card-2, rgba(23, 23, 23, 0.035)); }
.search-result .wx {
  flex: none; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2, rgba(23, 23, 23, 0.55));
}
.search-result .wx svg { width: 30px; height: 30px; display: block; }
.search-result.search-use-location .wx { color: var(--sev-minor, #2563eb); }
.search-result.search-use-location .wx svg { width: 18px; height: 18px; }
.search-result .wx-temp {
  flex: none; margin-inline-start: auto; min-width: 40px; text-align: right;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink, #171717);
}
.search-result .body { min-width: 0; flex: 1; }
.search-result .primary {
  font-size: 15.5px; font-weight: 700; color: var(--ink, #171717);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result .secondary {
  font-size: 13px; font-weight: 600; color: var(--ink-3, rgba(23, 23, 23, 0.38));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-empty {
  padding: 22px 16px; text-align: center;
  color: var(--ink-3, rgba(23, 23, 23, 0.38)); font-size: 14px; font-weight: 600;
}
.search-section {
  padding: 12px 14px 6px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3, rgba(23, 23, 23, 0.38));
}
