/* ===== Investor-list search bar ===== */

/* "Island" above the Product Hunt badge */
.investor-search-island {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(7, 31, 48, 0.15), 0 8px 24px rgba(7, 31, 48, 0.08);
}

/* Close (X) — top-right corner */
.investor-search-island__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.investor-search-island__close:hover {
  background: var(--grey-surface);
}

.investor-search-island__close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.investor-search-island__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 20px;
}

/* Search pill (industry · country · type · submit) */
.search-pill {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px;
  box-shadow: 0 4px 16px rgba(7, 31, 48, 0.08);
}

.search-pill__divider {
  width: 1px;
  align-self: stretch;
  margin: -6px 4px; /* eat the pill's 6px padding (edge to edge) + 4px side spacing */
  background: var(--border);
  flex-shrink: 0;
  transform: translateZ(0); /* snap the hairline to the pixel grid (avoids 2px smear at fractional display scaling) */
}

/* Dropdown */
.sp-dropdown {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sp-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--black);
  padding: 0 16px;
  border-radius: var(--radius-pill);
  transition: background-color 0.2s ease;
}

.sp-dropdown__trigger:hover {
  background: var(--grey-surface);
}

.sp-dropdown__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dropdown__panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(7, 31, 48, 0.12);
  z-index: 20;
  overflow: hidden;
  text-align: left;
}

.sp-dropdown.open .sp-dropdown__panel {
  display: block;
}

.sp-dropdown__search-box {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.sp-dropdown__filter {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--black);
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
}

.sp-dropdown__filter:focus-visible {
  border-color: var(--blue);
}

.sp-dropdown__list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.sp-dropdown__item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dropdown__item:hover {
  background: var(--grey-surface);
}

.sp-dropdown__item--selected {
  background: var(--grey-surface);
  font-weight: 700;
}

/* Submit button */
.search-pill__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin-left: 4px;
  background: var(--blue);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-pill__btn:hover {
  background: #0279d0;
}

.search-pill__btn-label {
  display: none;
}

.sp-dropdown__trigger:focus-visible,
.search-pill__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Mobile — stack the pill vertically, widen the island, tighten the frame */
@media (max-width: 768px) {
  .investor-search-island {
    /* Break out of .hero-content (90%) + .container (24px) to 16px viewport gutters
       (matches the header pill). The element is wider than its container, so auto
       margins won't center it — anchor the left edge to the (centered) container's
       midpoint, then pull back half the island's own width. Negative top lifts it
       up toward the header. */
    width: calc(100vw - 32px);
    margin: -92px 0 48px 50%;
    transform: translateX(-50%);
    padding: 10px;
    border-radius: 40px; /* = pill radius (30) + frame padding (10) → concentric with the pill */
  }

  /* Title + close share one row */
  .investor-search-island__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .investor-search-island__close {
    position: static; /* leave the corner, sit on the title row */
    flex-shrink: 0;
  }

  .investor-search-island__title {
    margin-bottom: 0;
    text-align: left;
  }

  .search-pill {
    flex-direction: column;
    align-items: stretch;
    padding: 6px;
    gap: 4px;
    border-radius: 30px; /* = field radius (24, stadium half-height) + padding (6) → concentric */
  }

  .search-pill__divider {
    width: auto;
    height: 1px;
    margin: 4px -6px; /* edge to edge across the stacked pill (eats 6px padding) */
  }

  .sp-dropdown {
    width: 100%;
  }

  .sp-dropdown__panel {
    width: 100%;
  }

  .search-pill__btn {
    width: 100%;
    height: 48px;
    margin-left: 0;
    margin-top: 4px;
    border-radius: var(--radius-pill);
  }

  .search-pill__btn-label {
    display: inline;
    color: var(--white);
    font-weight: 700;
    font-size: 16px;
    margin-left: 8px;
  }
}
