/* Page-scoped styles for the /search entry page (US3).
   Centered, autofocused input + browsable category chips. */

.search-page {
  min-height: 100vh;
  background: var(--home-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-10) var(--space-4) var(--space-8);
}

.search-page__form {
  width: 100%;
  max-width: 640px;
  margin-bottom: var(--space-8);
}

.search-page__input {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-5);
  font-size: var(--text-h3);
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
}
.search-page__input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px var(--accent-blue-glow);
}

.search-page__categories { width: 100%; max-width: 640px; }

/* Query results: wider than the tiles column; reuses the listing grid. */
.search-page__results { width: 100%; max-width: 1200px; }
.search-page__empty {
  color: var(--text-tertiary);
  font-size: var(--text-h3);
  padding: var(--space-8) 0;
  text-align: center;
}
.search-page__heading {
  font-size: var(--text-h2);
  margin: var(--space-6) 0 var(--space-3);
}

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 104px;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  /* h3 (20px) leaves only ~10 characters per line at the 140px track, so
     "Documentary" outgrew its tile; body size clears the longest genre by
     ~19px at every breakpoint. */
  font-size: var(--text-body);
  font-weight: 600;
  /* Safety net for any future name with no break opportunity: without this a
     long token paints over the tile edge. Must be `anywhere`, not
     `break-word` — only `anywhere` feeds the break into the min-content size,
     which is what lets this flex item shrink below the word. */
  overflow-wrap: anywhere;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.chip:hover,
.chip:focus-visible {
  border-color: var(--accent-blue);
  background: var(--surface-3);
}
