.search-trigger:disabled { cursor: default; }
.search-trigger:enabled:hover { color: #d4e7ea; }

/* Keep the browser from scrolling the page to put the sticky input below itself. */
html:has(.header-search__form:not([hidden])) { scroll-padding-top: 0; }

.header-search__form {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  border: 1px solid rgb(224 249 255 / 48%);
  border-radius: 4px;
  background: rgb(0 52 66 / 60%);
}

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

.header-search__form:focus-within { border-color: #e0ebed; }

.header-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 12px;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
}

.header-search__input::placeholder { color: #e0ebed; }
.header-search__input:focus { outline: none; }
.header-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.header-search__close {
  display: grid;
  flex: 0 0 44px;
  height: 44px;
  place-items: center;
}

.header-search__close:hover { color: #d4e7ea; }
.header-search__close:focus-visible { outline-offset: -3px; }

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: clamp(320px, 36vw, 470px);
  max-height: min(440px, calc(100dvh - var(--header-height) - 12px));
  padding: 0 16px;
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: light;
  color: #000015;
  border: 1px solid #d9e1e3;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 38 50 / 18%);
  --color-focus: #3a737c;
}

.search-panel ::selection { background: #d4e7ea; }

.search-panel__status {
  margin: 16px 0 8px;
  color: #48585c;
  font-size: 14px;
}

.search-panel__retry {
  min-height: 44px;
  color: #3a737c;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.search-panel__results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-panel__result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid #d9e1e3;
  overflow-wrap: anywhere;
}

.search-panel__result strong {
  display: block;
  color: #003442;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.08;
}

.search-panel__result:hover strong {
  color: #3a737c;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.search-panel__result small {
  display: block;
  margin-top: 6px;
  color: #48585c;
  font-size: 14px;
}

.search-panel__result:focus-visible { outline-offset: -2px; }
.search-panel__results li:last-child .search-panel__result { border-bottom: 0; }

@media (max-width: 767px) {
  .site-header__inner:has(.header-search__form:not([hidden])) > .header-phone { display: none; }
}

@media (max-width: 639px) {
  .search-panel {
    inset: 100% var(--page-gutter-right) auto var(--page-gutter-left);
    width: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .header-search__form:not([hidden]) { animation: search-field-enter 220ms cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes search-field-enter {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: none; }
  }
}
