/* search.css — Unified search results page */

:root {
  --bg: #0c0d0f;
  --text: #f5f6f7;
  --text-dim: #9aa3b2;
  --accent: #c7d2fe;
  --panel: #111214;
  --panel-2: #15171a;
  --border: #2a2a2a;
  --line: #1e1e1e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 100%; min-height: 100dvh; display: flex; flex-direction: column; }

.skip-link {
  position: absolute; top: -40px; left: 0; padding: .5rem 1rem;
  background: var(--accent); color: #000; z-index: 999;
}
.skip-link:focus { top: 0; }

/* ── Header / Topbar ── */
.site-header { border-bottom: 1px solid var(--line); }
.topbar { padding: .6rem 1.2rem; }
.topbar-content { display: flex; align-items: center; gap: 1rem; max-width: 72rem; margin: 0 auto; }
.brand {
  font-family: 'Lilex', monospace; font-size: 1rem; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: -0.02em;
}

/* ── Search Hero ── */
.search-hero {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.2rem 1.5rem;
  text-align: center;
}

.search-title {
  font-family: 'Lilex', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: .25rem;
}

.search-subtitle {
  color: var(--text-dim);
  font-size: .95rem;
  margin-bottom: 1.5rem;
}

.search-form {
  display: flex;
  gap: 0;
  max-width: 36rem;
  margin: 0 auto 1.2rem;
  position: relative;
}

.search-input {
  flex: 1;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: .75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); opacity: .7; }

.search-btn {
  background: var(--accent);
  color: #0c0d0f;
  border: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: .75rem 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.search-btn:hover { opacity: .85; }

/* ── Suggest dropdown ── */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  z-index: 50;
  text-align: left;
  max-height: 70vh;
  overflow-y: auto;
}

.search-suggest-group { padding: .35rem 0; }

.search-suggest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .75rem .15rem;
}

.search-suggest-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.search-suggest-clear {
  background: transparent;
  color: var(--text-dim);
  border: none;
  font-size: .72rem;
  font-family: inherit;
  cursor: pointer;
  padding: .15rem .35rem;
  border-radius: 4px;
}
.search-suggest-clear:hover { color: var(--text); background: var(--panel-2); }

.search-suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .75rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .1s, border-color .1s;
}
.search-suggest-item:hover,
.search-suggest-item.active {
  background: var(--panel-2);
  border-left-color: var(--accent);
}

.search-suggest-icon {
  flex-shrink: 0;
  color: var(--text-dim);
  opacity: .7;
}

.search-suggest-text {
  flex: 1;
  min-width: 0;
  font-size: .9rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-type {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .35rem;
}

.search-suggest-exhibit {
  flex-shrink: 0;
  font-size: .72rem;
  color: var(--text-dim);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-remove {
  flex-shrink: 0;
  background: transparent;
  color: var(--text-dim);
  border: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.search-suggest-remove:hover { color: var(--text); background: var(--bg); }

.search-suggest-footer {
  padding: .4rem .75rem .5rem;
  font-size: .72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
  margin-top: .25rem;
  text-align: center;
}

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: .4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-tab {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .8rem;
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.filter-tab:hover { color: var(--text); border-color: var(--text-dim); }
.filter-tab.active {
  background: var(--accent);
  color: #0c0d0f;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Results Section ── */
.results-section {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.2rem 3rem;
}

.results-status {
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 1rem;
  min-height: 1.2rem;
}

.results-list { display: flex; flex-direction: column; gap: .6rem; }

/* ── Result Card ── */
.result-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .9rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.result-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.result-type-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-artifact { background: #818cf820; color: #818cf8; }
.badge-milestone { background: #34d39920; color: #34d399; }
.badge-game { background: #f59e0b20; color: #f59e0b; }
.badge-path { background: #f472b620; color: #f472b6; }
.badge-quote { background: #a78bfa20; color: #a78bfa; }
.badge-recipe { background: #fb718520; color: #fb7185; }
.badge-music { background: #60a5fa20; color: #60a5fa; }

.result-title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
}
.result-title mark {
  background: #c7d2fe30;
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

.result-exhibit {
  font-size: .75rem;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
}

.result-desc {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-desc mark {
  background: transparent;
  color: var(--text);
  font-weight: 500;
}

.result-meta {
  display: flex;
  gap: .6rem;
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--text-dim);
  opacity: .7;
}

/* ── Load More ── */
.load-more {
  display: block;
  margin: 1.5rem auto 0;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem 1.5rem;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s;
}
.load-more:hover { border-color: var(--accent); }

/* ── Empty/Loading States ── */
.results-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.results-empty-icon { font-size: 2rem; margin-bottom: .5rem; }
.results-empty-hint { font-size: .8rem; margin-top: .5rem; }
.results-loading { text-align: center; padding: 2rem; color: var(--text-dim); }

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  padding: 1.5rem 1.2rem;
  text-align: center;
  font-size: .78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .search-hero { padding: 2rem 1rem 1rem; }
  .search-title { font-size: 1.4rem; }
  .search-input { font-size: .95rem; padding: .65rem .8rem; }
  .filter-tabs { gap: .3rem; }
  .filter-tab { font-size: .75rem; padding: .3rem .6rem; }
  .result-card { padding: .75rem .8rem; }
  .result-exhibit { display: none; }
  .search-suggest-exhibit { display: none; }
  .search-suggest-text { font-size: .85rem; }
}
