/*
 * Search page styles.
 * Extracted from specs/v2-profile-prototype-APR-23.html (search-shell, chips, grant-card).
 * Uses tokens from tokens.css. No fit badges (Search is profile-agnostic).
 */

/* Search shell (prototype lines 77-83) */
.search-shell {
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: var(--ugf-radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.search-row {
  display: flex;
  gap: 0.5rem;
}
.search-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--ugf-border);
  border-radius: var(--ugf-radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--ugf-surface-muted);
  color: var(--ugf-ink);
}
.search-input:focus {
  outline: none;
  border-color: var(--ugf-accent);
  background: var(--ugf-surface);
}
.btn-primary {
  padding: 0.625rem 1.125rem;
  background: var(--ugf-accent);
  color: var(--ugf-surface);
  border: none;
  border-radius: var(--ugf-radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover { background: var(--ugf-accent-ink); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Chips row (prototype lines 80-83) */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.875rem;
}
.chips-label {
  font-size: 0.8125rem;
  color: var(--ugf-text-soft);
  align-self: center;
  margin-right: 0.25rem;
}
.chip {
  padding: 0.3rem 0.75rem;
  background: var(--ugf-surface-muted);
  border: 1px solid var(--ugf-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--ugf-ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--ugf-border-strong); }
.chip.chip-active {
  background: var(--ugf-accent-tint);
  border-color: var(--ugf-accent);
  color: var(--ugf-accent);
  font-weight: 500;
}

/* Result summary header (prototype lines 84-86) */
.page-header { margin: 1rem 0 1rem; }
.page-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ugf-ink);
}
.page-header p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ugf-text-soft);
}
.page-header em { font-style: italic; color: var(--ugf-accent); }

/* Status line (loading / error / no-results) */
.search-status {
  font-size: 0.875rem;
  color: var(--ugf-text-soft);
  padding: 0.25rem 0.25rem 1rem;
  min-height: 1.25rem;
}
.search-status.is-error { color: var(--ugf-urgent); }

/* Cards list (prototype lines 88-95) */
.cards {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.grant-card {
  position: relative;
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: var(--ugf-radius-lg);
  padding: 1rem 1.125rem;
  transition: border-color 0.1s;
}
.grant-card:hover { border-color: var(--ugf-border-strong); }

/* Star (prototype lines 93-94) */
.star {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--ugf-border);
  border-radius: 6px;
  font-size: 1.0625rem;
  color: var(--ugf-text-soft);
  cursor: pointer;
  font-family: inherit;
}
.star:hover { color: var(--ugf-star); border-color: var(--ugf-star); }
.star[data-saved="true"] {
  color: var(--ugf-star);
  background: var(--ugf-star-bg);
  border-color: var(--ugf-star);
}

/* Card title + kv grid (prototype lines 95-109) */
.gc-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  padding-right: 2.5rem;
  letter-spacing: -0.01em;
  color: var(--ugf-ink);
}
.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.kv { min-width: 0; }
.kv .k {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--ugf-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}
.kv .v {
  font-size: 0.8125rem;
  color: var(--ugf-ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kv .v.mono,
.kv .v .mono {
  font-family: var(--gf-font-mono);
  font-size: 0.75rem;
}
.kv .v .sep { color: var(--ugf-text-soft); margin: 0 0.2rem; }
.kv .v.closes-urgent { color: var(--ugf-urgent); font-weight: 500; }
.kv .v.closes-posted { color: var(--ugf-posted); }
.kv .v.closes-forecasted { color: var(--ugf-forecasted); }

/* CTA row (prototype lines 182-195) */
.gc-cta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ugf-border);
}
.gc-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.425rem 0.875rem;
  background: var(--ugf-accent);
  color: var(--ugf-surface);
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.1s;
}
.gc-primary-btn:hover {
  background: var(--ugf-accent-ink);
  text-decoration: none;
}
.gc-cta-hint {
  font-size: 0.7125rem;
  color: var(--ugf-text-soft);
}

@media (max-width: 640px) {
  .kv-grid { grid-template-columns: 1fr; gap: 0.375rem; }
  .search-row { flex-direction: column; }
  .btn-primary { width: 100%; }
}
