/* Search box in the top header bar. Pages keep their own .header rules. */
.header {
  z-index: 1000;
}

.nav-search {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  margin: 0;
  width: 260px;
  text-align: left;
  font-weight: normal;
}

/* Matches the .typeahead search box in style.css. */
.nav-search-input {
  display: block;
  width: 100%;
  height: 30px;
  padding: 4px 10px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 18px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.nav-search-input::placeholder {
  color: #999;
}

.nav-search-input:focus {
  border-color: #0097cf;
}

/* Keep in step with .tt-menu in style.css. */
.nav-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-width: calc(100vw - 30px);
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  color: #222;
}

.nav-search-results[hidden] {
  display: none;
}

.nav-search-results a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  color: #222;
  font-size: 15px;
  line-height: 20px;
  font-weight: normal;
  text-decoration: none;
}

.nav-search-results a:hover,
.nav-search-results a:focus,
.nav-search-results .active a {
  background: #0097cf;
  color: #fff;
  text-decoration: none;
}

.nav-search-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-search-kind {
  flex: none;
  color: #888;
  font-size: 12px;
}

.nav-search-results a:hover .nav-search-kind,
.nav-search-results a:focus .nav-search-kind,
.nav-search-results .active .nav-search-kind {
  color: rgba(255, 255, 255, 0.85);
}

.nav-search-empty {
  padding: 6px 12px;
  font-size: 15px;
  line-height: 20px;
  color: #888;
}

@media (max-width: 760px) {
  .header {
    text-align: left !important;
    padding-left: 15px !important;
  }

  .nav-search {
    width: 44%;
    max-width: 220px;
    right: 10px;
  }

  /* iOS zooms into inputs smaller than 16px on focus. */
  .nav-search-input {
    font-size: 16px;
  }
}
