/**
 * Global search page (/search): one input + results.
 */

.search-page__form {
  margin-bottom: var(--space-4);
}

/* "What you can search": a calm two-column list (field / rule) instead of
   one dense sentence. Lives in #results, so it disappears with results. */
.search-hint {
  padding: var(--space-3) var(--space-4);
  background: var(--color-muted);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
}

.search-hint__title {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}

.search-hint__list {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  margin: 0;
}

.search-hint__row {
  display: contents;
}

.search-hint__field {
  font-weight: var(--font-weight-medium);
  color: var(--color-foreground);
}

.search-hint__rule {
  margin: 0;
  color: var(--color-muted-foreground);
}

/* Narrow phones: stack field over rule so nothing gets squeezed. */
@media (max-width: 359px) {
  .search-hint__list {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .search-hint__rule {
    margin-bottom: var(--space-2);
  }
}

.search-page__empty {
  margin: 0 0 var(--space-3);
  color: var(--color-muted-foreground);
}

/* Mobile result cards (reuse .participant-card from 22-seminars-list.css).
   `display` lives in the media query so it never beats .hidden-desktop. */
.search-results-cards {
  flex-direction: column;
  gap: var(--space-2);
}

@media (max-width: 767px) {
  .search-results-cards {
    display: flex;
  }
}

/* Whole card is one tap target: stretch the profile link over the card. */
.search-card {
  position: relative;
}

.search-card:active {
  background: var(--color-muted);
}

.search-card .participant-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.search-card .participant-card__name a {
  font-size: var(--font-size-base);
  white-space: normal;
}

/* The phone keeps its own tel: link above the stretched profile link. */
.search-card__phone a {
  position: relative;
  z-index: 1;
}

/* How this result matched the query — calm, small, not a shout. */
.search-match-badge {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-1);
  padding: 0.1rem var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  color: var(--color-muted-foreground);
  background: var(--color-muted);
  white-space: nowrap;
}

.search-match-badge--exact {
  color: var(--color-foreground);
  background: color-mix(in srgb, var(--color-link) 14%, var(--color-muted));
}

/* Found by a previous last name («раніше: Іваненко»): even quieter — an
   outline instead of a fill, so it reads as a footnote, not a label. */
.search-match-badge--previous {
  font-style: italic;
  font-weight: var(--font-weight-normal);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--color-muted);
  white-space: normal;
}

.search-name-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.search-name-cell .search-match-badge {
  margin-top: 0;
}

.search-card__match {
  margin-top: 0.15rem;
}

/* Exact user id / Telegram id: soft accent, distinctive but not loud. */
.search-card--exact-id {
  box-shadow: inset 3px 0 0 var(--color-link);
  background: color-mix(in srgb, var(--color-link) 6%, var(--color-background));
}

.search-card--exact-id:active {
  background: color-mix(in srgb, var(--color-link) 10%, var(--color-muted));
}

.tabulator-row.search-row--exact-id,
.tabulator-row.search-row--exact-id.tabulator-row-even {
  box-shadow: inset 3px 0 0 var(--color-link);
  background: color-mix(in srgb, var(--color-link) 6%, var(--color-background));
}
