/* ==========================================================================
   Upstream Property – header search overlay + search results page
   ========================================================================== */
:root {
  --up-blue: #199ad6;
  --up-blue-hover: #1386bb;
  --up-ink: #1d2433;
  --up-muted: #667085;
  --up-line: #e4e7ec;
}

/* the theme's old search bar is replaced by the overlay */
.main-header .header-search-form { display: none !important; }

/* ---------- Overlay ---------- */
.up-search {
  position: fixed;
  inset: 0;
  z-index: 100000;
  visibility: hidden;
  opacity: 0;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.up-search.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .22s ease, visibility 0s linear 0s;
}
.up-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 28, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.up-search__panel {
  position: relative;
  background: #fff;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 24px 60px rgba(10, 16, 28, .25);
  transform: translateY(-16px);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.up-search.is-open .up-search__panel { transform: none; }
body.admin-bar .up-search__panel { margin-top: var(--wp-admin--admin-bar--height, 32px); }
.up-search__inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 24px 30px;
}
.up-search__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.up-search__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--up-muted);
}
button.up-search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0 !important;
  border: 0;
  border-radius: 50% !important;
  background: transparent;
  color: var(--up-ink);
  cursor: pointer;
  transition: background-color .2s ease;
}
button.up-search__close:hover, button.up-search__close:focus-visible { background: #f2f4f7; color: var(--up-ink); }
button.up-search__close:focus-visible { outline: 2px solid var(--up-blue); outline-offset: 2px; }

/* input row (shared by the overlay and the results page) */
.up-search__form,
.up-results__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.up-search__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--up-muted);
  pointer-events: none;
}
input.up-search__input,
input.up-search__input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 60px;
  margin: 0;
  padding: 0 20px 0 54px;
  font-size: 18px;
  color: var(--up-ink);
  background: #f7f8fa;
  border: 1px solid var(--up-line);
  border-radius: 30px !important;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input.up-search__input::placeholder { color: #98a2b3; }
input.up-search__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--up-blue);
  box-shadow: 0 0 0 4px rgba(25, 154, 214, .16);
}
input.up-search__input::-webkit-search-cancel-button { cursor: pointer; }
button.up-search__submit {
  flex: 0 0 auto;
  height: 60px;
  margin: 0;
  padding: 0 30px !important;
  border: 1px solid var(--up-blue);
  border-radius: 30px !important;
  background: var(--up-blue) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
button.up-search__submit:hover,
button.up-search__submit:focus-visible {
  background: var(--up-blue-hover) !important;
  border-color: var(--up-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 24, 40, .14);
}
button.up-search__submit:focus-visible { outline: 2px solid var(--up-blue); outline-offset: 3px; }

/* live suggestions */
.up-search__suggest:empty { display: none; }
.up-search__suggest { margin-top: 14px; }
.up-search.is-loading .up-search__icon { animation: up-search-pulse 1s ease-in-out infinite; }
@keyframes up-search-pulse { 50% { opacity: .35; } }
.up-search__results { list-style: none; margin: 0; padding: 0; }
.up-search__results li { margin: 0; padding: 0; }
.up-search__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--up-ink) !important;
  text-decoration: none !important;
  transition: background-color .15s ease;
}
.up-search__item:hover, .up-search__item:focus-visible { background: #f2f7fb; outline: none; }
.up-search__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f5;
}
.up-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.up-search__noimg {
  display: block; width: 100%; height: 100%;
  background: #eef1f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V8l8-5 8 5v12h-5v-6H9v6z' fill='%23b8c1cc'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.up-search__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-search__item-title {
  font-size: 15px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.up-search__item-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--up-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-search__item-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.up-search__empty { margin: 6px 12px; color: var(--up-muted); font-size: 15px; }
.up-search__all {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 12px 0;
  font-weight: 600; font-size: 14px;
  color: var(--up-blue) !important;
  text-decoration: none !important;
}
.up-search__all:hover { color: var(--up-blue-hover) !important; text-decoration: underline !important; }

/* popular links */
.up-search__quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 20px;
}
.up-search.has-results .up-search__quick { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--up-line); }
.up-search__quick-label {
  margin-right: 4px;
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--up-muted);
}
.up-search__chip {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--up-line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--up-ink) !important;
  text-decoration: none !important;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.up-search__chip:hover, .up-search__chip:focus-visible { border-color: var(--up-blue); color: var(--up-blue) !important; background: #f2f9fd; outline: none; }

/* page behind the overlay doesn't scroll */
body.up-search-open { overflow: hidden; }

/* ---------- Status badges (overlay + results page) ---------- */
.up-badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: var(--up-radius-badge, 6px);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #fff;
  background: #667085;
}
.up-badge--lease, .up-badge--rent { background: #199ad6; }
.up-badge--sale { background: #1f9d55; }
.up-badge--under-offer { background: #d9822b; }
.up-badge--leased, .up-badge--sold, .up-badge--rented { background: #56585a; }

/* ---------- Results page ---------- */
.search .page-wrap { padding-top: 56px; padding-bottom: 80px; }
.up-results { float: none; width: 100%; }
.up-results__header { max-width: 820px; margin: 0 0 40px; }
.up-results__eyebrow {
  margin: 0 0 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--up-blue);
}
.up-results__title { margin: 0 0 22px; font-size: 40px; line-height: 1.15; color: #00102e; overflow-wrap: anywhere; }
.up-results__count { margin: 14px 0 0 4px; color: var(--up-muted); font-size: 15px; }
.up-results__group { margin-bottom: 52px; }
.up-results__group-title {
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--up-line);
  font-size: 22px;
  color: #00102e;
}
.up-results__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.up-results__list { display: grid; gap: 16px; max-width: 900px; }

.up-result { margin: 0; }
.up-result__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: var(--up-radius-card, 14px);
  overflow: hidden;
  box-shadow: var(--up-shadow-card, 0 8px 24px rgba(16, 24, 40, .06));
  color: var(--up-ink) !important;
  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.up-result__link:hover, .up-result__link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(16, 24, 40, .12);
  border-color: #d6e9f5;
  outline: none;
}
.up-result__link:focus-visible { box-shadow: 0 0 0 3px rgba(25, 154, 214, .35); }
.up-result__media { position: relative; aspect-ratio: 16 / 10; background: #eef1f5; overflow: hidden; }
.up-result__media img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0;
  transition: transform .4s ease;
}
.up-result__link:hover .up-result__media img { transform: scale(1.04); }
.up-result__placeholder {
  display: block; width: 100%; height: 100%;
  background: #eef1f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V8l8-5 8 5v12h-5v-6H9v6z' fill='%23b8c1cc'/%3E%3C/svg%3E") center / 48px no-repeat;
}
.up-result__media .up-badge { position: absolute; top: 14px; left: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.up-result__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.up-result__kind { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--up-blue); }
.up-result__title { margin: 0; font-size: 18px; line-height: 1.35; color: #00102e; }
.up-result__meta { margin: 0; font-size: 14px; color: var(--up-muted); }
.up-result__excerpt { margin: 0; font-size: 14px; line-height: 1.55; color: #475467; }
.up-result__more { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--up-blue); }
.up-result--page .up-result__body { padding: 20px 24px; }

.up-results__empty {
  max-width: 640px; padding: 36px; border-radius: var(--up-radius-card, 14px);
  background: #f7f8fa; border: 1px solid #eef0f4;
}
.up-results__empty h2 { margin-top: 0; font-size: 24px; }
.up-results__cta {
  display: inline-block; margin-top: 8px; padding: 16px 32px;
  background: var(--up-blue); color: #fff !important; border-radius: var(--up-radius-btn, 8px);
  font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; text-decoration: none !important;
  transition: background-color .2s ease;
}
.up-results__cta:hover { background: var(--up-blue-hover); }

@media (max-width: 1024px) {
  .up-results__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 767px) {
  .up-search__inner { padding: 16px 16px 22px; }
  .up-search__head { margin-bottom: 10px; }
  input.up-search__input, input.up-search__input[type="search"] { height: 54px; font-size: 16px; padding-left: 48px; } /* 16px: no iOS zoom */
  .up-search__icon { left: 17px; }
  button.up-search__submit { height: 54px; padding: 0 18px !important; letter-spacing: 1px; }
  .search .page-wrap { padding-top: 32px; padding-bottom: 56px; }
  .up-results__title { font-size: 28px; }
  .up-results__grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 400px) {
  .up-search__form button.up-search__submit,
  .up-results__form button.up-search__submit { width: 54px; padding: 0 !important; font-size: 0 !important; letter-spacing: 0; }
  .up-search__form button.up-search__submit::before,
  .up-results__form button.up-search__submit::before {
    content: ""; display: block; width: 20px; height: 20px; margin: auto;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
@media (prefers-reduced-motion: reduce) {
  .up-search, .up-search__panel, .up-result__link, .up-result__media img { transition: none !important; }
}
