/* Bird Guide autocomplete — add-on only; does not change card or hero styling. */
.bird-guide-page .species-search-label { min-width: 0; }
.bird-guide-page .species-search-wrap { position: relative; width: 100%; }
.bird-guide-page #species-search { width: 100%; }
.bird-guide-page .species-suggestions {
  position: absolute;
  z-index: 100;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #dfe8dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(7,63,43,.16);
}
.bird-guide-page .species-suggestions[hidden] { display: none !important; }
.bird-guide-page .species-suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #183b2b;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.bird-guide-page .species-suggestion:hover,
.bird-guide-page .species-suggestion.is-active { background: #f0f6ec; }
.bird-guide-page .species-suggestion-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e8f0e4;
  color: #5c8b3b;
  font-size: 17px;
  font-weight: 800;
}
.bird-guide-page .species-suggestion-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.bird-guide-page .species-suggestion-text strong {
  color: #183b2b;
  font-size: 13px;
  font-weight: 700;
}
.bird-guide-page .species-suggestion-text em {
  color: #758278;
  font-size: 11px;
}
.bird-guide-page .species-suggestion-region {
  margin-left: auto;
  color: #6b806e;
  font-size: 10px;
  white-space: nowrap;
}
.bird-guide-page .species-suggestion-empty {
  padding: 13px 12px;
  color: #758278;
  font-size: 12px;
}

/* Fix: ensure live-filtered species cards are actually removed from the grid.
   The existing card stylesheet uses display:flex; this explicit rule overrides it. */
.bird-guide-page #species-grid > .species-card[hidden],
.bird-guide-page #species-grid > .species-card.is-filtered-out {
  display: none !important;
}


/* Mobile card-content visibility fix.
   Keep the image and text panel in normal document flow; let each card grow
   to fit its full description and profile link instead of clipping the bottom. */
@media (max-width: 650px) {
  .bird-guide-page #species-grid {
    align-items: start !important;
    grid-auto-rows: auto !important;
  }
  .bird-guide-page #species-grid > .species-card {
    display: flex !important;
    flex-direction: column !important;
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .bird-guide-page #species-grid > .species-card > .species-visual {
    flex: 0 0 185px !important;
    height: 185px !important;
    min-height: 185px !important;
    max-height: 185px !important;
  }
  .bird-guide-page #species-grid > .species-card > .species-copy {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 16px 15px 18px !important;
  }
  .bird-guide-page #species-grid > .species-card .species-copy p,
  .bird-guide-page #species-grid > .species-card .species-copy .species-more {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
  }
}


/* V1.3 MOBILE CARD SPACING + ROUNDED CONTAINER FIX */
@media (max-width: 650px) {
  .bird-guide-page .species-grid,
  .bird-guide-page #species-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
    row-gap: 18px !important;
    align-items: start !important;
    grid-auto-rows: max-content !important;
  }

  .bird-guide-page #species-grid > .species-card,
  .bird-guide-page .species-grid > .species-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #e0e9dc !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(7,63,43,.06) !important;
  }

  .bird-guide-page #species-grid > .species-card > .species-visual,
  .bird-guide-page .species-grid > .species-card > .species-visual {
    display: block !important;
    position: relative !important;
    flex: 0 0 185px !important;
    width: 100% !important;
    height: 185px !important;
    min-height: 185px !important;
    max-height: 185px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .bird-guide-page #species-grid > .species-card > .species-copy,
  .bird-guide-page .species-grid > .species-card > .species-copy {
    display: flex !important;
    position: relative !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 16px 15px 18px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .bird-guide-page #species-grid > .species-card .species-copy > p,
  .bird-guide-page .species-grid > .species-card .species-copy > p {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
  }

  .bird-guide-page #species-grid > .species-card .species-more,
  .bird-guide-page .species-grid > .species-card .species-more {
    margin-top: 10px !important;
  }
}
