/* xeek.dev theme, search.css: search toggle, dropdown, hero search input */

.search { position: relative; }

.search-toggle {
  background: none;
  border: 0;
  padding: 4px;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
}

.search-toggle:hover { color: var(--green); }

.search-input {
  width: 100%;
  background: rgba(220, 230, 240, 0.06);
  border: 1px solid rgba(220, 230, 240, 0.14);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font: 400 14px var(--font-body);
  outline: none;
}

.search-input::placeholder { color: #7d92a5; }
.search-input:focus { border-color: var(--blue-border); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 92vw);
  background: rgba(25, 30, 37, 0.65);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid #2a3441;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 60;
}

.search-dropdown .search-input {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

/* Results markup comes from the default theme's search.js:
   li > a.search-result-link > .search-result-title,
   .search-result-meta (.search-result-date, .search-result-draft),
   .search-result-excerpt */
.search-results li { cursor: pointer; }

.search-results li.is-active,
.search-results li:hover {
  background: rgba(65, 132, 228, 0.08);
  box-shadow: inset 2px 0 0 var(--blue);
}

.search-result-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 18px;
  color: inherit;
  /* the hero centers its text; results stay left-aligned */
  text-align: left;
}

.search-result-title {
  font: 600 14px/1.35 var(--font-display);
  color: var(--text);
}

.search-results li.is-active .search-result-title,
.search-results li:hover .search-result-title { color: var(--blue-bright); }

.search-result-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font: 400 11px var(--font-body);
  color: var(--dim);
}

.search-result-date { font-family: var(--font-mono); }
.search-result-draft { color: var(--purple); }

.search-result-excerpt {
  font: 400 12.5px/1.5 var(--font-body);
  color: var(--muted);
}

.search-empty {
  margin: 0;
  padding: 14px 18px;
  font: 400 13px var(--font-body);
  color: var(--dim);
}

/* Hero search (input mode, centered, frosted like the header) */
.hero-search { position: relative; width: min(420px, 100%); margin-top: 14px; }
.hero-search .search { width: 100%; }
.hero-search .search-input {
  background: rgba(20, 24, 30, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding-right: 42px;
}
.hero-search .search-dropdown { left: 0; right: 0; width: auto; }

.hero-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
}

.hero-search-icon svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .nav-links .search { margin-top: 14px; }
  .nav-links .search-toggle { display: none; }
  .nav-links .search-dropdown {
    position: static;
    display: block;
    width: 100%;
    box-shadow: none;
    background: rgba(220, 230, 240, 0.06);
  }
}
