/*
 * BJC book — the search overlay.
 *
 * vendor/_static/search.js builds <div id="bjc-search-overlay"> over the
 * page when the navbar's search icon is clicked: a box with the query input
 * and an <ol> of result links (li.selected is the keyboard cursor), backed
 * by the lunr index the build emits.
 */

#bjc-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  background: rgba(0, 0, 0, 0.4);
}

#bjc-search-overlay .bjc-search-box {
  display: flex;
  flex-direction: column;
  width: min(40rem, 90vw);
  max-height: 70vh;
  color: var(--bjc-body-color);
  background: var(--bjc-body-bg);
  border-radius: 0.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

#bjc-search-overlay input {
  padding: 1rem;
  font-size: 1.2rem;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

#bjc-search-overlay ol {
  margin: 0;
  padding: 0 0 0.5rem;
  overflow-y: auto;
  list-style: none;
  border-top: 1px solid var(--bjc-border);
}

#bjc-search-overlay ol a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

#bjc-search-overlay ol a:hover,
#bjc-search-overlay ol li.selected a {
  background: var(--bjc-code-bg);
}
