/* ==========================================================================
   Typeahead Dropdown — loaded globally for nav search bar
   ========================================================================== */

/* The nav form is already position: absolute, so the dropdown positions
   relative to it. Other forms (footer, hero) need position: relative. */
.site-search:has(.search-typeahead-dropdown) {
  position: relative;
}

.site-navigation .site-search:has(.search-typeahead-dropdown) {
  position: absolute;
}

.site-navigation .site-search {
  overflow: visible;
}

.site-navigation.searching .site-search {
  z-index: 100;
}

.search-typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: none;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  max-height: 28rem;
  overflow-y: auto;
}

.site-navigation .search-typeahead-dropdown {
  z-index: 101;
  border-radius: 0 0 0.25rem 0.25rem;
}

.search-typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  text-decoration: none;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background-color 0.15s;
}

.search-typeahead-item:last-of-type {
  border-bottom: none;
}

.search-typeahead-item.is-selected,
.search-typeahead-item:hover {
  background: #faf8f5;
}

.search-typeahead-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.4;
}

.search-typeahead-type {
  flex-shrink: 0;
  font-family: National, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #990000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-typeahead-view-all {
  display: block;
  padding: 1rem 1.25rem;
  text-align: center;
  font-family: National, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #990000;
  text-decoration: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  letter-spacing: 0.02em;
  transition: background-color 0.15s;
}

.search-typeahead-view-all:hover {
  background: #faf8f5;
}

.search-typeahead-dropdown mark {
  background-color: transparent;
  color: inherit;
  font-weight: 700;
}

.search-typeahead-loading {
  padding: 1.25rem;
  font-size: 1rem;
  font-weight: 300;
  color: #999;
  text-align: center;
}

.search-typeahead-empty {
  padding: 1.25rem;
  font-size: 1rem;
  font-weight: 300;
  color: #666;
  text-align: center;
}

.search-typeahead-heading {
  padding: 0.75rem 1.25rem 0.375rem;
  font-family: National, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
}

.search-typeahead-recent .search-typeahead-title::before {
  content: "\21A9";
  margin-right: 0.625rem;
  opacity: 0.35;
}
