/* Buscador global: barra en el menu (PC), boton en la cabecera (celular),
   pantalla de resultados, pildoras con su atajo y marca de "ya vista". */

/* ---------- teclas dibujadas (Ctrl K, Alt 1...) ---------- */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700; line-height: 1;
  color: var(--text-dim); background: var(--bg-solid);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
  padding: 3px 6px; white-space: nowrap;
}

/* ---------- barra del menu (solo PC) ---------- */
.nav-search { display: none; }
@media (min-width: 900px) {
  .nav-search {
    display: flex; align-items: center; gap: 9px; height: 42px; margin: 0 0 8px; padding: 0 8px 0 12px;
    border-radius: 13px; background: var(--surface); border: 1px solid var(--ring);
    box-shadow: 0 6px 16px var(--glow); color: var(--text-faint); cursor: text;
    transition: box-shadow var(--dur) var(--ease), border-color .2s, color .2s;
  }
  .nav-search:hover { color: var(--text-dim); box-shadow: 0 10px 22px var(--glow); }
  .nav-search:focus-within {
    color: var(--accent); border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 24px var(--glow-strong);
    outline: 3px solid var(--focus-ring); outline-offset: 2px;   /* el contorno va en la caja, no en el input de dentro */
  }
  .nav-search input:focus-visible { outline: none; }
  .nav-search .ic { width: 17px; height: 17px; }
  .nav-search input {
    flex: 1; min-width: 0; border: none; background: none; padding: 0;
    font-family: inherit; font-size: 13.5px; color: var(--text);
  }
  .nav-search input::placeholder { color: var(--text-faint); }
  .nav-search input::-webkit-search-cancel-button { display: none; }
  .nav-search:focus-within kbd { opacity: 0; }
}

/* ---------- boton de buscar en la cabecera (solo celular) ---------- */
.content-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.header-search {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ring); color: var(--accent);
  box-shadow: 0 8px 20px var(--glow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
@media (min-width: 900px) { .header-search { display: none; } }

/* ---------- pildoras del tipo ---------- */
#screenBuscar .search-tabs { gap: 8px; margin-bottom: 18px; }
#screenBuscar .search-tab { flex: none; display: inline-flex; align-items: center; gap: 9px; border-radius: 999px; padding: 8px 10px 8px 16px; font-size: 13.5px; }
.search-tab kbd { font-size: 10px; padding: 2px 5px; background: var(--surface-2); border-color: var(--border-soft); color: var(--text-faint); }
.search-tab.active kbd { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.4); color: var(--accent-text); }
/* en celular no hay teclado fisico: los atajos sobran */
@media (max-width: 899px), (hover: none) { .search-tab kbd { display: none; } }

/* ---------- resultados ---------- */
.search-count { font-size: 13px; color: var(--text-faint); margin: 0 0 16px; }
.search-count + .people-grid, .search-count + .library-grid { margin-bottom: 30px; }

/* foco con teclado (flechas): se ve igual que el hover, con anillo del acento */
.search-hit:focus-visible { outline: none; }
.poster-card.search-hit:focus-visible .poster {
  transform: translateY(-6px) scale(1.035);
  box-shadow: 0 0 0 3px var(--ring), 0 0 0 6px var(--accent), 0 22px 40px var(--glow-strong);
}
.poster-card.search-hit:focus-visible .poster-title { color: var(--accent); }
.person-card.search-hit:focus-visible .person-card-photo {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 3px var(--ring), 0 0 0 6px var(--accent), 0 18px 32px var(--glow-strong);
}
.search-result.search-hit:focus-visible { background-color: var(--hover-soft); }

/* ---------- ayuda con los atajos (pantalla vacia) ---------- */
.search-hint {
  max-width: 520px; padding: 22px 24px; border-radius: 18px; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--ring); box-shadow: 0 8px 24px var(--glow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.search-hint p { margin: 0 0 12px; font-size: 14.5px; color: var(--text); }
.search-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.search-keys kbd { margin-right: 3px; }
@media (max-width: 899px), (hover: none) { .search-keys { display: none; } }
