/* ============================================================
   search-suggest.css — the live search dropdown (search-suggest.js).
   Loaded on the homepage and /search. Uses the site tokens
   (--primary, --border, --radius-*), so it always matches.
   ============================================================ */

.ss-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- the panel ---------- */
.ss-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden; text-align: left; color: var(--text-main, #0f172a);
  animation: ss-in 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top center;
}
.ss-panel[hidden] { display: none !important; }
.ss-panel.ss-float { position: fixed; right: auto; z-index: 2600; }
@keyframes ss-in { from { opacity: 0; transform: translateY(-4px) scale(0.99); } to { opacity: 1; transform: none; } }

.ss-scroll {
  max-height: var(--ss-max, min(62vh, 460px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border-strong, #cbd5e1) transparent;
}
.ss-scroll::-webkit-scrollbar { width: 6px; }
.ss-scroll::-webkit-scrollbar-track { background: transparent; }
.ss-scroll::-webkit-scrollbar-thumb { background: var(--border-strong, #cbd5e1); border-radius: 999px; }
.ss-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-subtle, #94a3b8); }

.ss-label {
  padding: 10px 10px 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-subtle, #94a3b8);
}
.ss-label-row { display: flex; align-items: center; justify-content: space-between; }
.ss-linkbtn {
  font: inherit; font-size: 0.72rem; font-weight: 700; text-transform: none; letter-spacing: 0;
  color: var(--primary, #2563eb); padding: 2px 6px; border-radius: 6px;
}
.ss-linkbtn:hover { background: var(--primary-light, #eff6ff); }

/* ---------- rows ---------- */
.ss-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px;
  color: var(--text-main, #0f172a); font-size: 0.9rem; cursor: pointer; min-height: 44px;
}
.ss-item.ss-active, .ss-item:hover { background: var(--primary-light, #eff6ff); }
.ss-q > i:first-child { flex: 0 0 auto; width: 20px; text-align: center; font-size: 1.05rem; color: var(--text-subtle, #94a3b8); }
.ss-q .ss-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ss-x {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-subtle, #94a3b8); font-size: 1rem;
}
.ss-x:hover { background: #fff; color: var(--accent-red, #ef4444); }

.ss-mark { background: none; color: var(--primary, #2563eb); font-weight: 800; }

.ss-ent { gap: 12px; }
.ss-media {
  position: relative; flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px; max-width: 40px; min-height: 40px; max-height: 40px;
  align-self: center; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--primary-light, #eff6ff);
  display: grid; place-items: center; color: var(--primary, #2563eb); font-size: 1.15rem;
}
/* Photos are always a perfect square crop — never stretched, whatever their own shape or the page's img rules. */
.ss-media > img {
  display: block; width: 40px; height: 40px; min-width: 0; max-width: none; max-height: none;
  aspect-ratio: 1 / 1; object-fit: cover; object-position: center top; border-radius: 10px;
}
.ss-media-trainers { border-radius: 50%; }
.ss-media-trainers > img { border-radius: 50%; }
.ss-flag {
  position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1); overflow: hidden;
}
.ss-flag img { display: block; width: 100%; height: 100%; max-width: none; aspect-ratio: 1 / 1; border-radius: 50%; object-fit: cover; }
.ss-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ss-title { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-sub { font-size: 0.76rem; color: var(--text-muted, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

/* ---------- pills (popular / skills) ---------- */
.ss-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 8px; }
.ss-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: #f1f5f9; color: var(--text-main, #0f172a); font-size: 0.8rem; font-weight: 600; min-height: 34px;
  transition: background 0.15s ease, color 0.15s ease;
}
.ss-pill i { font-size: 0.95rem; color: var(--accent-yellow, #f59e0b); }
.ss-pill-skill i { color: var(--primary, #2563eb); }
.ss-pill.ss-active, .ss-pill:hover { background: var(--primary-light, #eff6ff); color: var(--primary, #2563eb); }

/* ---------- notes / empty ---------- */
.ss-note { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 0.8rem; color: var(--text-muted, #64748b); }
.ss-note i { color: var(--primary, #2563eb); }
.ss-note b { color: var(--text-main, #0f172a); }
.ss-none { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; text-align: center; font-size: 0.82rem; color: var(--text-muted, #64748b); }
.ss-none i { font-size: 1.8rem; color: var(--text-subtle, #94a3b8); }
.ss-none strong { color: var(--text-main, #0f172a); font-size: 0.9rem; }

.ss-foot {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--border-light, #edf2f7);
  background: #fafcff; color: var(--primary, #2563eb); font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
.ss-foot span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-foot b { font-weight: 800; }
.ss-foot.ss-active, .ss-foot:hover { background: var(--primary-light, #eff6ff); }

/* ---------- loading skeleton ---------- */
.ss-skel { padding: 6px; }
.ss-skel-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; }
.ss-skel-col { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.ss-skel-b {
  display: block; background: #e2e8f0; border-radius: 6px;
  background-image: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 40%, #e2e8f0 80%);
  background-size: 200% 100%; animation: ss-shimmer 1.2s linear infinite;
}
.ss-skel-img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; flex: 0 0 auto; }
.ss-skel-l1 { height: 11px; width: 60%; }
.ss-skel-l2 { height: 9px; width: 85%; }
@keyframes ss-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 600px) {
  .ss-panel { border-radius: 14px; }
  .ss-item { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-panel, .ss-skel-b { animation: none; }
}

/* Phones: 16px inputs so iOS Safari doesn't zoom the page when the box is focused. */
@media (max-width: 768px) { .app-search-input-box input { font-size: 16px; } }
