/* Search (issue #844): the jump menu in the top bar, and the search page. */

/* The box sits in the top bar beside the page's name, the page's actions at the far end; on a phone the phone bar's
   search link stands in for it. Its menu drops down under it, over the page. */
.jump { position: relative; margin-inline-end: auto; width: min(18rem, 100%); }
.jump__box { position: relative; display: flex; align-items: center; }
.jump__box > .icon { position: absolute; inset-inline-start: var(--space-3); color: var(--text-tertiary); pointer-events: none; }
.jump__input {
  min-height: 34px; padding-inline: calc(var(--space-3) + 22px) 4.5rem;
  font-size: var(--text-sm); background: var(--surface-muted); border-color: var(--border);
}
.jump__input:focus { background: var(--surface); }
.jump__input::-webkit-search-cancel-button { display: none; }
.jump__hint {
  position: absolute; inset-inline-end: var(--space-2);
  padding: 1px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-tertiary); font: inherit; font-size: var(--text-xs); pointer-events: none;
}
.jump:focus-within .jump__hint { display: none; }

.jump__menu {
  position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 20;
  width: max(100%, 28rem); max-width: calc(100vw - 2 * var(--space-4)); max-height: min(70vh, 32rem); overflow-y: auto;
  padding: var(--space-1);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised);
}
.jump__menu[hidden] { display: none; }
.jump__kind {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 600;
}
.jump__option {
  display: flex; align-items: baseline; gap: var(--space-2); padding: 6px var(--space-2); border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: var(--text-sm);
}
.jump__option:hover, .jump__option[aria-selected="true"] { background: var(--surface-muted); }
.jump__option[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.jump__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; flex: none; }
.jump__detail { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jump__all { margin-top: var(--space-1); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--text-secondary); align-items: center; }
.jump__all .icon { flex: none; }
.jump__note { padding: var(--space-3) var(--space-2); color: var(--text-secondary); font-size: var(--text-sm); }

@media (max-width: 768px) {
  .jump { display: none; }
}
.phonebar__search { flex: none; }

/* The search page */
.search { max-width: 760px; }
.search__form { flex-wrap: nowrap; }
.search__input { flex: 1; }
.search__kinds { align-self: flex-start; }
.search__count { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
