/* Search over the home list. */

.masthead__end {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.masthead__search {
  display: grid;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  place-items: center;
  cursor: pointer;
}

.search-page[hidden],
.search__clear[hidden] {
  display: none;
}

.search-page {
  position: fixed;
  z-index: 9;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}

body:has(.search-page:not([hidden])) {
  overflow: hidden;
}

.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.search-bar .search {
  min-width: 0;
  flex: 1;
}

.search-bar .search-cancel {
  flex: none;
  border: 0;
  color: var(--ink-soft);
  font: inherit;
  font-size: .8125rem;
  cursor: pointer;
}

.search {
  display: flex;
  position: relative;
  min-height: 46px;
  align-items: center;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

.search:focus-within {
  border-color: var(--accent);
  background: var(--raised);
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--focus-gap);
}

.search .search__input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 11px 0;
  padding-right: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
}

.search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search .search__input:focus-visible {
  outline: none;
  box-shadow: none;
}

.search__icon {
  display: grid;
  flex: none;
  width: 36px;
  padding-left: 4px;
  color: var(--muted);
  place-items: center;
}

.search:focus-within .search__icon {
  color: var(--ink-soft);
}

.search__clear {
  display: grid;
  flex: none;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bg);
  place-items: center;
  cursor: pointer;
}

.search__clear span {
  display: grid;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  place-items: center;
}

/* Keep clear's focus marker inside the field rather than across its edge. */
.search .search__clear:focus-visible {
  outline: none;
  box-shadow: none;
}

.search__clear:focus-visible span {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--focus-gap);
}

.search-results {
  margin-top: 22px;
}

.search-results .row__bell-control {
  display: none;
}

.search-results .row__main.row__main--bell {
  grid-template-columns: 44px minmax(0, 1fr);
}
