/* Global live search overlay */

.has-live-search-open {
  overflow: hidden;
}

.live-search[hidden] {
  display: none !important;
}

.live-search {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.live-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 20, .38);
  backdrop-filter: blur(7px);
}

.live-search__panel {
  position: relative;
  width: min(100% - 40px, 760px);
  margin: 92px auto 0;
  padding: 34px;
  border: 1px solid rgba(155,20,32,.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 12%, rgba(155, 20, 32, .08), rgba(255,255,255,0) 34%),
    #fff;
  box-shadow: 0 28px 90px rgba(20, 18, 20, .22);
}

.admin-bar .live-search__panel {
  margin-top: 120px;
}

.live-search__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f7eeee;
  color: #9b1420;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.live-search .eyebrow {
  margin: 0 0 10px;
  color: #9b1420;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}

.live-search h2 {
  margin: 0 0 22px;
  color: #24272d;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  font-weight: 850;
  line-height: .95;
  letter-spacing: -.065em;
}

.live-search__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(155,20,32,.10);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(24,20,20,.055);
}

.live-search__form input {
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #24272d;
  font-size: 1rem;
  outline: none;
}

.live-search__form button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #9b1420;
  color: #fff;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.live-search__status {
  min-height: 22px;
  margin-top: 18px;
  color: #686f78;
  font-size: .88rem;
}

.live-search__results {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.live-search-result {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border: 1px solid rgba(36,39,45,.07);
  border-radius: 16px;
  background: #f7f5f3;
  text-decoration: none;
}

.live-search-result:hover,
.live-search-result:focus {
  border-color: rgba(155,20,32,.22);
  background: #fff;
  text-decoration: none;
}

.live-search-result__type {
  color: #9b1420;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}

.live-search-result__title {
  color: #24272d;
  font-size: .98rem;
  line-height: 1.25;
}

.live-search-result__url {
  color: #6f7680;
  font-size: .78rem;
  line-height: 1.35;
  word-break: break-word;
}

.live-search__all {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 18px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f7eeee;
  color: #9b1420;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
  text-decoration: none;
}

.live-search__all::after {
  content: "→";
  margin-left: 8px;
}

.live-search__all:hover,
.live-search__all:focus {
  background: #9b1420;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 760px) {
  .live-search__panel {
    width: min(100% - 24px, 760px);
    margin-top: 72px;
    padding: 24px;
    border-radius: 22px;
  }

  .admin-bar .live-search__panel {
    margin-top: 88px;
  }

  .live-search__form {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .live-search__form button {
    justify-self: start;
  }
}


/* 0.4.8: live-search proportion + usability fix */
.live-search__panel {
  width: min(100% - 40px, 680px) !important;
  max-height: calc(100vh - 150px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin-top: 88px !important;
  padding: 28px !important;
}

.admin-bar .live-search__panel {
  max-height: calc(100vh - 178px) !important;
  margin-top: 116px !important;
}

.live-search h2 {
  margin-bottom: 18px !important;
  font-size: clamp(2.15rem, 4.1vw, 3.35rem) !important;
  line-height: .96 !important;
  letter-spacing: -.06em !important;
}

/* Keep the form compact and stop theme form styles from pushing text to the far right. */
.live-search__form {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 8px !important;
  border-radius: 20px !important;
}

.live-search__form input[type="search"] {
  order: 1 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 14px !important;
  text-align: left !important;
  direction: ltr !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.live-search__form button {
  order: 2 !important;
  flex: 0 0 auto !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 16px !important;
}

.live-search__status {
  flex: 0 0 auto !important;
  min-height: 20px !important;
  margin-top: 14px !important;
}

.live-search__results {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding-right: 4px !important;
}

.live-search-result {
  padding: 13px 14px !important;
  border-radius: 14px !important;
}

.live-search-result__title {
  font-size: .93rem !important;
}

.live-search-result__url {
  font-size: .74rem !important;
}

.live-search__all {
  flex: 0 0 auto !important;
}

@media (max-width: 760px) {
  .live-search__panel {
    width: min(100% - 24px, 680px) !important;
    max-height: calc(100vh - 96px) !important;
    margin-top: 64px !important;
    padding: 22px !important;
  }

  .admin-bar .live-search__panel {
    max-height: calc(100vh - 116px) !important;
    margin-top: 82px !important;
  }

  .live-search__form {
    align-items: stretch !important;
    flex-direction: column !important;
    border-radius: 18px !important;
  }

  .live-search__form button {
    align-self: flex-start !important;
  }
}


/* 0.5.4: header live-search final usability pass */
.live-search__panel {
  width: min(100% - 40px, 640px) !important;
  max-height: calc(100vh - 150px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 26px !important;
}

.admin-bar .live-search__panel {
  max-height: calc(100vh - 178px) !important;
}

.live-search h2 {
  margin-bottom: 18px !important;
  font-size: clamp(2rem, 3.6vw, 3rem) !important;
  letter-spacing: -.055em !important;
}

.live-search__form {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px !important;
  border-radius: 20px !important;
}

.live-search__form input[type="search"] {
  order: 1 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 14px !important;
  text-align: left !important;
  direction: ltr !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.live-search__form button {
  order: 2 !important;
  flex: 0 0 auto !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 16px !important;
}

.live-search__status {
  flex: 0 0 auto !important;
  min-height: 20px !important;
  margin: 13px 0 8px !important;
  color: #68707a !important;
  font-size: .82rem !important;
}

.live-search__results {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  display: grid !important;
  gap: 7px !important;
  padding-right: 4px !important;
}

.live-search-result {
  padding: 12px 13px !important;
  border-radius: 14px !important;
}

.live-search-result__type {
  font-size: .54rem !important;
}

.live-search-result__title {
  font-size: .91rem !important;
}

.live-search-result__url {
  font-size: .72rem !important;
}

.live-search__all {
  flex: 0 0 auto !important;
  margin-top: 14px !important;
}

@media (max-width: 760px) {
  .live-search__panel {
    width: min(100% - 24px, 640px) !important;
    max-height: calc(100vh - 96px) !important;
    margin-top: 64px !important;
    padding: 22px !important;
  }

  .admin-bar .live-search__panel {
    max-height: calc(100vh - 116px) !important;
    margin-top: 82px !important;
  }

  .live-search__form {
    align-items: stretch !important;
    flex-direction: column !important;
    border-radius: 18px !important;
  }

  .live-search__form button {
    align-self: flex-start !important;
  }
}


/* 0.5.34 tiny-screen live search cleanup */
@media (max-width: 560px) {
  .live-search {
    overflow: hidden !important;
  }

  .live-search__panel {
    width: calc(100vw - 20px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 74px) !important;
    margin: 54px auto 0 !important;
    padding: 18px !important;
    border-radius: 18px !important;
  }

  .admin-bar .live-search__panel {
    max-height: calc(100dvh - 98px) !important;
    margin-top: 74px !important;
  }

  .live-search__close {
    top: 12px !important;
    right: 12px !important;
  }

  .live-search h2 {
    max-width: calc(100% - 38px) !important;
    margin-bottom: 14px !important;
    font-size: clamp(1.6rem, 12vw, 2.25rem) !important;
    line-height: 1 !important;
  }

  .live-search__form {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    border-radius: 16px !important;
  }

  .live-search__form input[type="search"],
  .live-search__form button {
    width: 100% !important;
  }

  .live-search__form button {
    align-self: stretch !important;
    justify-content: center !important;
  }

  .live-search__results {
    padding-right: 0 !important;
  }

  .live-search-result {
    min-width: 0 !important;
  }
}
