/* /search/ (plan 31, §1.5). Linked by that page only — main.css (shared with the Bay apps) is not touched.
   Without JS the list is every page; with JS it is the answer to ?q=. Results are separated by space, not rules. */
.page-search {
  padding-top: clamp(8rem, 18vh, 12rem);
  padding-bottom: var(--sp-section);
}

.page-search__inner { max-width: 760px; }

.page-search h1 {
  font-size: var(--fs-800);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-7);
  text-wrap: balance;
}

.page-search__label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-300);
  color: var(--c-text-2);
}

.page-search__row {
  display: flex;
  gap: var(--sp-2);
}

.page-search__row input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--c-control-line);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: max(16px, var(--fs-400)); /* 16 px at the least: iOS zooms into smaller fields */
}

.page-search__row input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; } /* the browser's blue × */

.page-search__submit {
  flex-shrink: 0;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--pm-purple-700); /* fill, same in both themes; white on it 9.2:1 */
  color: var(--pm-white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 140ms var(--ease-out-expo);
}
.page-search__submit:active { transform: scale(0.97); }

.page-search__status {
  margin-top: var(--sp-5);
  font-size: var(--fs-300);
  color: var(--c-text-2);
  overflow-wrap: anywhere;
}
.page-search__status a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }

.page-search__results {
  list-style: none;
  margin: var(--sp-7) 0 0;
  padding: 0;
  display: grid;
  gap: var(--sp-6);
}

.search-result { display: grid; gap: var(--sp-1); }

.search-result__title {
  justify-self: start;
  font-family: var(--ff-display);
  font-size: var(--fs-600);
  line-height: 1.2;
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.search-result__title:focus-visible { text-decoration-color: var(--c-mark); }

.search-result__where {
  font-size: var(--fs-200);
  color: var(--c-muted);
  overflow-wrap: anywhere;
}

.search-result__desc {
  max-width: 65ch;
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-300);
  line-height: var(--lh-loose);
  color: var(--c-text-2);
}

@media (hover: hover) and (pointer: fine) {
  .search-result__title { transition: text-decoration-color 140ms ease; }
  .search-result__title:hover { text-decoration-color: var(--c-mark); }
}

@media (max-width: 480px) {
  .page-search__row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .page-search__submit { transition: none; }
  .page-search__submit:active { transform: none; }
}
