/* Member search results. Dark Matrix. The collapsing header control lives elsewhere. */

.search-form {
  position: relative;
}

.srch-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.search-form input[type="search"] {
  background: #061006;
  color: #f3fff3;
  border: 1.5px solid rgba(57, 255, 20, 0.75);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  font-size: 16px; /* keep 16px so iOS does not zoom */
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.18);
}

.search-form input[type="search"]::placeholder {
  color: #8fbf8f;
}

.search-form input[type="search"]:focus {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
  border-color: #39ff14;
}

.srch-results {
  margin-top: 0.35rem;
}

.srch-state {
  padding: 0.35rem 0 0.15rem;
}

.srch-empty {
  margin: 0;
  color: #d7ffd7;
  font-size: 0.98rem;
}

.srch-hint {
  margin: 0.35rem 0 0;
  color: #9fdc9f;
  font-size: 0.88rem;
}

.srch-group + .srch-group {
  margin-top: 0.85rem;
}

.srch-group__title {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 0.25rem;
  color: #39ff14;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.srch-count {
  color: #9fdc9f;
  font-weight: 600;
  letter-spacing: 0;
}

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

.srch-hit {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-height: 44px;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(57, 255, 20, 0.18);
  color: #e8ffe8;
  text-decoration: none;
}

.srch-hit:hover,
.srch-hit:focus {
  background: rgba(57, 255, 20, 0.08);
  color: #ffffff;
}

.srch-hit:focus-visible {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

.srch-hit__title {
  color: #ffffff;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.srch-hit__sub,
.srch-hit__snip {
  color: #9fdc9f;
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.srch-mark {
  background: rgba(57, 255, 20, 0.35);
  color: #ffffff;
  padding: 0 0.12em;
  border-radius: 2px;
}

.srch-clear {
  font: inherit;
}

/* Compact recent-searches dropdown under the search input */
.srch-recent-dd {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: min(280px, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: manipulation;
  margin: 0;
  padding: 0.45rem 0.5rem 0.5rem;
  border-radius: 12px;
  border: 1.5px solid rgba(57, 255, 20, 0.55);
  background: #061006;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 14px rgba(57, 255, 20, 0.18);
}

.srch-recent-dd[hidden] {
  display: none !important;
}

.srch-recent-dd__label {
  margin: 0 0 0.35rem 0.15rem;
  color: #39ff14;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.srch-recent-dd__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.srch-recent-dd__list li {
  display: flex;
  gap: 0.3rem;
  align-items: stretch;
  border-radius: 10px;
}

.srch-recent-dd__list li.is-active,
.srch-recent-dd__list li[aria-selected="true"] {
  background: rgba(57, 255, 20, 0.12);
}

.srch-recent-dd__item,
.srch-recent-dd__drop,
.srch-recent-dd__clear {
  font: inherit;
}

.srch-recent-dd__item {
  flex: 1;
  min-height: 44px;
  text-align: left;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #e8ffe8;
  cursor: pointer;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srch-recent-dd__drop {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #9fdc9f;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.srch-recent-dd__item:hover,
.srch-recent-dd__item:focus,
.srch-recent-dd__drop:hover,
.srch-recent-dd__drop:focus,
.srch-recent-dd__clear:hover,
.srch-recent-dd__clear:focus {
  background: rgba(57, 255, 20, 0.12);
  color: #ffffff;
}

.srch-recent-dd__item:focus-visible,
.srch-recent-dd__drop:focus-visible,
.srch-recent-dd__clear:focus-visible {
  outline: 2px solid #39ff14;
  outline-offset: 1px;
}

.srch-recent-dd__clear {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  min-height: 40px;
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9fdc9f;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  font-size: 0.9rem;
}

/* Phone-first: full-width field + buttons */
@media (max-width: 480px) {
  .search-panel .search-form,
  .chrome-strip .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-panel input[type="search"],
  .chrome-strip input[type="search"] {
    min-width: 0;
    width: 100%;
    font-size: 16px;
  }

  .search-form .btn,
  .search-form .srch-clear {
    width: 100%;
    min-height: 44px;
  }
}

@media (min-width: 900px) {
  .srch-hit {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
    column-gap: 1rem;
    align-items: baseline;
  }

  .srch-hit__snip {
    grid-column: 1 / -1;
  }
}
