/* ============================================================
 * Anderman — Header Quick-Search (live AJAX) — supplemental CSS
 *
 * The AJAX handler renders `.search-card` cards directly inside
 * #searchModalResults, matching the original static template
 * (templates/scripts-v2.js + partials.js). The card / grid / empty
 * styles all live in anderman.css. This file only adds:
 *
 *   - The "View all results" footer link that follows the grid.
 *   - The loading spinner state.
 *   - A tweak to the static `.search-card-meta` so long values
 *     (formulas, slugs) wrap inside a narrow third column.
 *
 * Append after anderman.css — equal specificity, loaded later.
 * ============================================================ */

/* Highlight on title / desc */
.search-card-title mark,
.search-card-desc mark {
  background: rgba(198, 169, 107, 0.30);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* "View all" footer — spans the full grid width below the cards. */
.search-quick-all-wrap {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  text-align: right;
}
.search-quick-all {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r-pill, 999px);
  background: rgba(255, 255, 255, 0.08);
  transition: background-color .15s ease, border-color .15s ease;
}
.search-quick-all:hover,
.search-quick-all:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  outline: none;
}

/* Loading spinner overlay while the AJAX fetch is in flight. */
.search-modal-results.is-loading {
  position: relative;
  min-height: 120px;
}
.search-modal-results.is-loading::after {
  content: '';
  position: absolute;
  top: 28px;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: anderman-quicksearch-spin 0.8s linear infinite;
}
@keyframes anderman-quicksearch-spin {
  to { transform: rotate(360deg); }
}

/* Card body — minor tweaks for AJAX content. The static cards in
   anderman.css use display:flex column with gap, which works for
   our markup unchanged. We just make sure long words (formulas,
   compound chemical names) wrap rather than overflow. */
.search-card-title,
.search-card-desc {
  overflow-wrap: anywhere;
}
.search-card-meta {
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
}
