/*
 * Site search: the header type-ahead and the search results page. Loaded by both layouts, so every
 * value falls back to a neutral default where the Alloy Bank tokens (alloycms.css :root) are absent.
 */

/* ---- type-ahead ------------------------------------------------------------------------------ */

.typeahead {
  position: relative;
  flex: 1 1 auto;
}

.typeahead__list {
  position: absolute;
  z-index: 1050;
  top: calc(100% + 6px);
  left: 0;
  min-width: max(100%, 280px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card, #fff);
  border: 1px solid var(--border-strong, rgba(0, 0, 0, 0.15));
  border-radius: var(--r-sm, 8px);
  box-shadow: 0 12px 32px rgba(13, 20, 37, 0.14);
}

.typeahead__option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-xs, 6px);
  color: var(--ink, #212529);
  cursor: pointer;
}

.typeahead__option:hover,
.typeahead__option.is-active {
  background: var(--brand-50, #e9f0ff);
}

.typeahead__title {
  font-weight: 600;
}

.typeahead__type {
  flex: none;
  font-size: 0.75rem;
  color: var(--subtle, #6c757d);
}

/* ---- results page ---------------------------------------------------------------------------- */

.site-search {
  max-width: 760px;
  padding: 24px 0 48px;
}

.site-search__form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.site-search__summary {
  color: var(--muted, #495057);
  margin-bottom: 8px;
}

.site-search__notice {
  padding: 10px 14px;
  border-radius: var(--r-xs, 6px);
  background: var(--warn-bg, #fff3cd);
  color: var(--warn, #664d03);
}

.site-search__facets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.site-search__facet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong, #ced4da);
  border-radius: 999px;
  color: var(--ink, #212529);
  font-size: 0.875rem;
  text-decoration: none;
}

.site-search__facet:hover {
  border-color: var(--brand-500, #0d6efd);
}

.site-search__facet.is-active {
  background: var(--brand-500, #0d6efd);
  border-color: var(--brand-500, #0d6efd);
  color: var(--on-fill, #fff);
}

.site-search__count {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.site-search__results {
  list-style: none;
  margin: 8px 0 24px;
  padding: 0;
}

.site-search__hit {
  padding: 18px 0;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.site-search__type {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle, #6c757d);
}

.site-search__title {
  margin: 4px 0 6px;
  font-size: 1.25rem;
  text-transform: none;
}

.site-search__title a {
  text-decoration: none;
}

.site-search__title a:hover {
  text-decoration: underline;
}

.site-search__excerpt {
  margin: 0 0 4px;
  color: var(--muted, #495057);
}

.site-search__excerpt mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--accent-100, #fff3bf);
  color: inherit;
}

.site-search__url {
  font-size: 0.8125rem;
  color: var(--subtle, #6c757d);
  word-break: break-all;
}

/* ---- header language switcher ------------------------------------------------------------- */

.language-switcher { margin-left: 0.75rem; }

.language-switcher__list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 2px;
  list-style: none;
  border: 1px solid var(--border-strong, #ced4da);
  border-radius: 999px;
}

.language-switcher__link {
  display: block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted, #495057);
  text-decoration: none;
}

.language-switcher__link:hover { color: var(--ink, #212529); }

.language-switcher__link.is-current {
  background: var(--brand-500, #0d6efd);
  color: var(--on-fill, #fff);
}
