/* =========================================================
   Site search overlay/results panel. The search TOGGLE BUTTON
   itself is styled in nav.css alongside the rest of the topnav
   (same breakpoints, same color rules) — this file only owns
   the modal that search.js injects into <body> on first open.
   ========================================================= */

/* ===== Overlay ===== */
#searchOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .5);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 16px;
}

#searchOverlay.open {
  display: flex;
}

.search-panel {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  overflow: hidden;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.search-panel-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e5ea;
  flex-shrink: 0;
}

.search-panel-input-row svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: #111827;
}

#searchInput::placeholder {
  color: #9ca3af;
}

.search-close-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px;
  font-family: inherit;
  flex-shrink: 0;
}

.search-close-btn:hover {
  color: #111827;
}

.search-results {
  overflow-y: auto;
  padding: 6px;
}

.search-result {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 10px 12px;
  border-radius: 8px;
}

.search-result + .search-result {
  margin-top: 2px;
}

.search-result:hover,
.search-result.is-selected {
  background: #eef2fd;
}

.search-result-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}

.search-result-title mark,
.search-result-snippet mark {
  background: #fde68a;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.search-result-snippet {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.45;
}

.search-empty-state,
.search-no-results {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

@media (max-width: 600px) {
  #searchOverlay {
    padding: 0;
  }
  .search-panel {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
}
