/* The NPPR search box (nppr-search.js): a Search button in the header that
   opens a search dialog (full screen on phones), and the same search inline
   on the Conditions and Approaches indexes. Brand teal, as in extra.css. */

/* Header button: a pill reading "Search /" on wide screens, an icon on phones. */
.nppr-search-button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0 0.4rem; padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  background: rgba(255,255,255,.12); color: inherit; font: inherit; font-size: 0.7rem;
  cursor: pointer; white-space: nowrap;
}
.nppr-search-button:hover, .nppr-search-button:focus-visible { background: rgba(255,255,255,.22); outline: none; }
.nppr-search-button svg { fill: currentColor; flex: none; }
.nppr-search-button__label { min-width: 6rem; text-align: left; opacity: .9; }
.nppr-search-button__key { padding: 0 0.35em; border: 1px solid rgba(255,255,255,.4); border-radius: 0.2rem; font-size: 0.6rem; font-family: inherit; }
@media screen and (max-width: 59.9844em) {
  .nppr-search-button { padding: 0.4rem; border: 0; background: none; }
  .nppr-search-button__label, .nppr-search-button__key { display: none; }
}

/* Dialog */
.nppr-search[hidden] { display: none; }
.nppr-search { position: fixed; inset: 0; z-index: 10; }
.nppr-search__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.nppr-search__panel {
  position: relative; display: flex; flex-direction: column;
  width: min(46rem, calc(100% - 2rem)); max-height: calc(100vh - 4rem);
  margin: 2rem auto 0; padding: 0.8rem 1rem 1rem; border-radius: 0.6rem;
  background: var(--md-default-bg-color); color: var(--md-default-fg-color);
  box-shadow: 0 0.8rem 2.4rem rgba(0,0,0,.35); font-size: 0.8rem; line-height: 1.5;
}
.nppr-search__panel .nppr-search__results { overflow-y: auto; overscroll-behavior: contain; margin: 0 -1rem; padding: 0 1rem; }
html.nppr-search-open { overflow: hidden; }
@media screen and (max-width: 44.9844em) {
  .nppr-search__panel { width: 100%; max-height: none; height: 100%; margin: 0; border-radius: 0; padding: 0.6rem 0.8rem 0.8rem; }
  .nppr-search__panel .nppr-search__results { flex: 1; margin: 0 -0.8rem; padding: 0 0.8rem; }
}

/* Search bar, filters and status (dialog and inline) */
.nppr-search__ui { font-size: 0.8rem; }
.nppr-search__bar { display: flex; align-items: center; gap: 0.5rem; }
.md-typeset .nppr-search__ui .nppr-search__bar { position: sticky; top: 3.2rem; z-index: 2; padding: 0.4rem 0; background: var(--md-default-bg-color); }
.nppr-search__icon { flex: none; fill: #00897b; }
.nppr-search__input {
  flex: 1; min-width: 0; padding: 0.55em 0.9em;
  border: 1px solid rgba(0,137,123,.5); border-radius: 999px;
  font: inherit; font-size: 0.8rem; color: var(--md-default-fg-color); background: var(--md-default-bg-color);
}
.nppr-search__input:focus { outline: none; border-color: #00897b; box-shadow: 0 0 0 2px rgba(0,137,123,.2); }
.nppr-search__filters-toggle, .nppr-search__close, .nppr-search__more, .nppr-search__chips button, .nppr-search__suggest {
  flex: none; padding: 0.4em 0.9em; border: 1px solid rgba(0,137,123,.5); border-radius: 999px;
  font: inherit; font-size: 0.65rem; color: #00897b; background: var(--md-default-bg-color); cursor: pointer;
}
.nppr-search__filters-toggle:hover, .nppr-search__filters-toggle[aria-expanded="true"], .nppr-search__close:hover, .nppr-search__more:hover { border-color: #00897b; }
.nppr-search__filters-toggle--set { background: rgba(0,137,123,.12); }
.nppr-search__close { padding: 0.4em 0.7em; }
.nppr-search__filters[hidden] { display: none; }
.nppr-search__filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.2rem; }
.nppr-search__filters select {
  max-width: 100%; padding: 0.3em 0.6em; border: 1px solid rgba(0,137,123,.5); border-radius: 999px;
  font: inherit; font-size: 0.65rem; color: var(--md-default-fg-color); background: var(--md-default-bg-color);
}
/* The AI toggle sits on its own line below the search bar. Its rules carry
   .md-typeset so that no page-level rule can pull it up under the sticky bar. */
.md-typeset .nppr-search__ui .nppr-ai, .nppr-search__ui .nppr-ai { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin: 0.4rem 0 0; font-size: 0.65rem; line-height: 1.5; color: var(--md-default-fg-color--light); }
.md-typeset .nppr-search__ui .nppr-ai label { display: inline-flex; align-items: center; gap: 0.35em; margin: 0; cursor: pointer; }
.md-typeset .nppr-search__ui .nppr-ai input { flex: none; margin: 0; accent-color: #00897b; }
.nppr-search__status { min-height: 1em; margin: 0.3rem 0 0.2rem; font-size: 0.65rem; color: var(--md-default-fg-color--light); }

/* Results */
.nppr-search__results mark { padding: 0; background: rgba(0,137,123,.18); color: inherit; border-radius: 0.1rem; }
.nppr-search__group h3 { margin: 0.9rem 0 0.3rem; font-size: 0.65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--md-default-fg-color--light); }
.nppr-search__count { font-weight: 400; }
[dir] .md-typeset ul.nppr-search__list, .nppr-search__list { margin: 0; padding: 0; list-style: none; }
[dir] .md-typeset ul.nppr-search__list > li, .nppr-search__list > li { margin: 0; padding: 0.4rem 0.5rem; border-radius: 0.3rem; }
.nppr-search__list > li + li { border-top: 1px solid var(--md-default-fg-color--lightest); }
.nppr-search__hit { font-weight: 600; color: var(--md-typeset-a-color, #00796b); }
.nppr-search__hit--active { outline: 2px solid #00897b; outline-offset: 2px; border-radius: 0.15rem; }
.nppr-search__year { color: var(--md-default-fg-color--light); }
.nppr-search__where, .nppr-search__note, .nppr-search__links, .nppr-search__crumbs, .nppr-search__also { font-size: 0.65rem; color: var(--md-default-fg-color--light); }
.nppr-search__where { margin-left: 0.4rem; }
div.nppr-search__where, div.nppr-search__note { margin-left: 0; }
.nppr-search__where a, .nppr-search__links a { color: inherit; text-decoration: underline; text-decoration-color: var(--md-default-fg-color--lighter); }
.nppr-search__badge { display: inline-block; margin-left: 0.35rem; padding: 0 0.45em; border-radius: 0.2rem; font-size: 0.55rem; font-weight: 700; line-height: 1.6; vertical-align: 0.1em; background: var(--md-default-fg-color--lightest); color: var(--md-default-fg-color--light); }
.nppr-search__badge--bc { background: rgba(0,137,123,.15); color: #00796b; }
.nppr-search__badge--ca { background: rgba(198,40,40,.12); color: #b71c1c; }
.nppr-search__badge--intl { background: rgba(63,79,143,.14); color: #3f4f8f; }
[data-md-color-scheme="slate"] .nppr-search__badge--bc { color: #4db6ac; }
[data-md-color-scheme="slate"] .nppr-search__badge--ca { color: #ef9a9a; }
[data-md-color-scheme="slate"] .nppr-search__badge--intl { color: #9fa8da; }
.nppr-search__more { margin: 0.4rem 0 0 0.5rem; }

/* Best bet: the page whose name matches, with its sections to jump to */
.nppr-search__best { margin: 0.6rem 0 0.2rem; padding: 0.7rem 0.8rem; border: 1px solid rgba(0,137,123,.35); border-left: 4px solid #00897b; border-radius: 0.4rem; background: rgba(0,137,123,.05); }
.nppr-search__best-title { font-size: 0.95rem; }
.nppr-search__jumps { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.nppr-search__jump, .nppr-search__chips a {
  padding: 0.15em 0.7em; border: 1px solid rgba(0,137,123,.4); border-radius: 999px;
  font-size: 0.65rem; color: #00796b; text-decoration: none; background: var(--md-default-bg-color);
}
.nppr-search__jump:hover, .nppr-search__chips a:hover { border-color: #00897b; background: rgba(0,137,123,.08); }
[data-md-color-scheme="slate"] .nppr-search__jump, [data-md-color-scheme="slate"] .nppr-search__chips a,
[data-md-color-scheme="slate"] .nppr-search__filters-toggle, [data-md-color-scheme="slate"] .nppr-search__close,
[data-md-color-scheme="slate"] .nppr-search__more, [data-md-color-scheme="slate"] .nppr-search__chips button { color: #4db6ac; }

/* Before typing: recent searches and browse links */
.nppr-search__label { margin: 0.9rem 0 0.4rem; font-size: 0.65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--md-default-fg-color--light); }
.nppr-search__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Nothing found */
.nppr-search__empty { margin: 0.8rem 0; }
.nppr-search__empty p { margin: 0.4rem 0; }
.nppr-search__actions a {
  display: inline-block; margin: 0.2rem 0.3rem 0.2rem 0; padding: 0.4em 1em; border: 1px solid #00897b; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; color: #00796b; text-decoration: none;
}
.nppr-search__actions a.nppr-search__primary { background: #00897b; color: #fff; }
