/* ==========================================================================
   Search lens + overlay, variant B (stroked pill-slot inside the rail cluster).
   Loaded only on pages that include /assets/js/search.js + the lens markup.
   ========================================================================== */

.nav-lens {
  width: 22px;
  height: 14px;
  border: 1px solid rgba(26, 26, 26, 0.25);
  border-radius: 2px;
  margin-bottom: 1.1rem;
  cursor: pointer;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  background: transparent;
  transition: opacity 0.12s ease, transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.nav-lens:hover { opacity: 1; transform: scale(1.12); }
.nav-lens svg { display: block; width: 10px; height: 10px; }

.nav-lens::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ghost-line);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.nav-lens:hover::after { opacity: 1; }

.nav-lens--active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ==========================================================================
   Overlay
   ========================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(247, 247, 245, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 60px 20px 20px;
  overflow-y: auto;
  animation: search-fade-in 0.12s ease;
}
.search-overlay[hidden] { display: none; }

@keyframes search-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-shell {
  max-width: 680px;
  margin: 0 auto;
  padding-left: var(--rail-width);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}
.search-input-wrap svg { color: var(--ink); flex-shrink: 0; }

.search-input {
  flex: 1;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.search-input::placeholder { color: var(--light-muted); font-weight: 400; }

.search-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid var(--ghost-line);
  border-radius: 2px;
  background: var(--paper);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-hit {
  padding: 10px 12px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: background 0.08s ease;
}
.search-hit:hover,
.search-hit--focused {
  background: var(--ghost-line);
}

.search-hit-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 3px;
  display: inline;
}
.search-hit-excerpt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.search-hit-excerpt mark,
.search-hit-title mark {
  background: rgba(198, 122, 26, 0.22);
  color: var(--ink);
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
}

.search-hit-lang {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 6px;
  vertical-align: 2px;
}

.search-kind {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-right: 8px;
  padding: 2px 7px;
  border-radius: 2px;
  line-height: 1.2;
  vertical-align: 2px;
  color: var(--paper);
  background: var(--ink);
}
.search-kind--letter     { background: var(--ink); }
.search-kind--production { background: var(--sapphire); }
.search-kind--event      { background: var(--amber); }
.search-kind--workshop   { background: var(--emerald); }
.search-kind--podcast    { background: var(--plum); }
.search-kind--member     { background: var(--burgundy); }
.search-kind--book       { background: var(--ink); }

.search-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 16px 0 6px;
  display: flex;
  justify-content: space-between;
}
.search-section-label[hidden] { display: none; }

.search-cross-divider {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 22px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--ghost-line);
}

.search-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

/* Keyboard hint for navigation help below results */
.search-keys {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 680px) {
  .search-shell { padding-left: 0; }
  .search-overlay { padding: 40px 16px 20px; }
  .search-input { font-size: 16px; }
}
