/* ── Site Search Overlay ───────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-skip, 9999);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(20vh, 160px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur, 0.2s) ease;
}
.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-box {
  width: min(580px, 92vw);
  background: var(--surface, #1a1d27);
  border: 1px solid var(--border, #2a2d3a);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform var(--dur, 0.2s) var(--ease-out, ease-out);
}
.search-overlay.is-open .search-box {
  transform: translateY(0) scale(1);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2a2d3a);
}
.search-input-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--muted, #666);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text, #e8e8e8);
  font-size: 1rem;
  font-family: inherit;
}
.search-input::placeholder {
  color: var(--muted, #666);
}
.search-kbd {
  font-size: 0.6875rem;
  color: var(--muted, #666);
  background: rgba(255,255,255,0.06);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border, #2a2d3a);
  font-family: inherit;
  white-space: nowrap;
}

.search-results {
  max-height: min(400px, 55vh);
  overflow-y: auto;
  padding: 8px 0;
}
.search-results:empty::after {
  content: none;
}

.search-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #666);
  padding: 10px 20px 4px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text, #e8e8e8);
  transition: background 0.1s;
  cursor: pointer;
}
.search-item:hover,
.search-item.is-active {
  background: rgba(91, 168, 248, 0.08);
}
.search-item-icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
}
.search-item-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item-cat {
  font-size: 0.6875rem;
  color: var(--accent, #5ba8f8);
  background: rgba(91, 168, 248, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted, #666);
  font-size: 0.875rem;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border, #2a2d3a);
  font-size: 0.6875rem;
  color: var(--muted, #666);
}
.search-footer kbd {
  font-size: 0.625rem;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border, #2a2d3a);
  font-family: inherit;
}

/* Header search button */
.topbar-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border2, #2a2d3a);
  background: transparent;
  color: var(--muted, #999);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  padding: 0;
}
.topbar-search:hover {
  color: var(--text, #e8e8e8);
  border-color: var(--accent, #5ba8f8);
}
.topbar-search svg {
  width: 16px;
  height: 16px;
}
