/* ============================================================
   Astra Origins — Global smart search (header spotlight)
   A light dropdown panel under the dark header search box. Result
   cards + badges reuse the newdesign theme tokens (cosmos.css :root).
   ============================================================ */

/* Anchor the dropdown to the search box. */
.t-search { position: relative; }

/* Clear (×) button — appears once there's a query. */
.t-search-clear {
  display: grid; place-items: center;
  width: 20px; height: 20px; padding: 0; flex-shrink: 0;
  border: 0; border-radius: 50%;
  background: oklch(0.95 0.005 240 / 0.16);
  color: oklch(0.95 0.005 240 / 0.9);
  font-size: 9px; cursor: pointer;
  transition: background 0.15s ease;
}
.t-search-clear:hover { background: oklch(0.95 0.005 240 / 0.32); }
.t-search-clear[hidden] { display: none; }
.t-search-kbd[style*="display: none"] { display: none !important; }

/* ── Dropdown panel ───────────────────────────────────────── */
.t-search-panel {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: min(560px, 92vw);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px oklch(0 0 0 / 0.22), 0 2px 8px oklch(0 0 0 / 0.1);
  z-index: 200; overflow: hidden;
  animation: srch-pop 0.14s ease;
}
.t-search-panel[hidden] { display: none; }
@keyframes srch-pop { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.t-search-scroll {
  max-height: min(66vh, 520px);
  overflow-y: auto; overflow-x: hidden;
  padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.t-search-scroll::-webkit-scrollbar { width: 9px; }
.t-search-scroll::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.t-search-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--surface); }
.t-search-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ── Idle hint ────────────────────────────────────────────── */
.srch-hint { padding: 22px 14px; text-align: center; }
.srch-hint[hidden] { display: none; }
.srch-hint-row { display: inline-flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 800; }
.srch-hint-row .bi { color: var(--accent); font-size: 12px; }

/* ── Loading skeleton ─────────────────────────────────────── */
.srch-loading { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.srch-loading[hidden] { display: none; }
.srch-sk-row { display: flex; align-items: center; gap: 12px; padding: 8px; }
.srch-sk-thumb { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.srch-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.srch-sk-line { height: 10px; border-radius: 6px; }
.srch-sk-glow {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: srch-shimmer 1.3s ease-in-out infinite;
}
@keyframes srch-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Result groups ────────────────────────────────────────── */
.srch-group + .srch-group { margin-top: 4px; }
.srch-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 8px; letter-spacing: 0.16em; font-weight: 800; color: var(--ink-3);
  padding: 10px 10px 5px; text-transform: uppercase;
}
.srch-showall {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 8px; font-weight: 800; letter-spacing: 0.1em; color: var(--accent);
  text-decoration: none; cursor: pointer;
}
.srch-showall:hover { color: var(--ink); }
.srch-showall .bi { font-size: 10px; }
.srch-group-list { display: flex; flex-direction: column; gap: 2px; }

/* "See all results" footer link in the dropdown. */
.srch-seeall {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 4px 2px; padding: 11px 12px; border-radius: 11px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  text-decoration: none; cursor: pointer; transition: border-color 0.14s, background 0.14s;
}
.srch-seeall:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.srch-seeall .bi { font-size: 12px; color: var(--accent); }
.srch-seeall-arrow { margin-left: auto; }

/* ── Result row (card + optional follow button) ───────────── */
.srch-item { display: flex; align-items: center; gap: 6px; border-radius: 11px; }
.srch-item:hover { background: var(--surface-2); }

.srch-card {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: border-color 0.14s ease, background 0.14s ease;
}
.srch-card:hover, .srch-card.is-active, .srch-card:focus-visible {
  background: var(--accent-soft); border-color: var(--accent-line); outline: none;
}

/* Thumbnail / avatar with a type badge in the corner. */
.srch-thumb {
  position: relative; width: 44px; height: 44px; flex-shrink: 0;
}
.srch-thumb img, .srch-thumb-txt {
  width: 44px; height: 44px; border-radius: 11px; object-fit: cover;
  display: grid; place-items: center; color: white; font-size: 13px; font-weight: 800;
  background: linear-gradient(135deg, oklch(0.55 0.16 250), oklch(0.34 0.12 265));
  box-shadow: inset -3px -4px 10px oklch(0 0 0 / 0.22);
}
.srch-thumb.is-round img, .srch-thumb.is-round .srch-thumb-txt { border-radius: 50%; }
.srch-badge {
  position: absolute; right: -3px; bottom: -3px;
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9px; color: white;
  border: 2px solid var(--surface);
}
.srch-b-member    { background: oklch(0.55 0.16 250); }
.srch-b-org       { background: oklch(0.5 0.12 200); }
.srch-b-community { background: oklch(0.62 0.18 330); }
.srch-b-blog      { background: oklch(0.55 0.13 160); }
.srch-b-hub       { background: oklch(0.58 0.19 305); }
.srch-b-astro     { background: oklch(0.5 0.16 275); }
.srch-b-event     { background: oklch(0.6 0.18 30); }
.srch-b-newsroom  { background: oklch(0.58 0.15 230); }

.srch-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srch-title { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-meta { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.srch-type {
  font-size: 7.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 7px; border-radius: 5px; white-space: nowrap;
}
.srch-card:hover .srch-type, .srch-card.is-active .srch-type { color: var(--accent); border-color: var(--accent-line); }

/* Follow button sits aside the member name; compact variant from follow.css. */
.srch-item .fl-follow { flex-shrink: 0; margin-right: 6px; }

/* ── Empty state ──────────────────────────────────────────── */
.srch-empty { padding: 30px 20px; text-align: center; }
.srch-empty-orb {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 20px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.srch-empty-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 5px; }
.srch-empty-sub { font-size: 8px; letter-spacing: 0.16em; color: var(--ink-3); font-weight: 800; }

/* ── Footer ───────────────────────────────────────────────── */
.t-search-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: 9px; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700;
  background: var(--surface-2);
}
.t-search-foot[hidden] { display: none; }
.srch-kbd-mini {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  font-weight: 800; font-size: 8.5px;
}

/* ── Full results pane (newdesign.search.index) ───────────── */
.srch-page { max-width: 760px; margin: 0 auto; }
.srch-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  margin-bottom: 16px; transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.srch-back:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.srch-back .bi { font-size: 12px; }
.srch-page-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.srch-page-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: 0.16em; font-weight: 800; color: var(--ink-2); }
.srch-page-eyebrow .bi { color: var(--accent); font-size: 12px; }
.srch-page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 5px; word-break: break-word; }
.srch-page-sub { font-size: 9px; letter-spacing: 0.14em; font-weight: 800; color: var(--ink-3); }

.srch-page-group { margin-bottom: 22px; }
.srch-page-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.srch-page-group-label { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: var(--ink); text-transform: uppercase; }
.srch-page-group-count {
  font-size: 9px; font-weight: 800; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 999px;
}
.srch-page-group .srch-group-list { gap: 4px; }
/* Slightly roomier rows on the full page. */
.srch-page .srch-card { padding: 10px; }

.srch-loadmore {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  margin-top: 10px; padding: 9px 16px; border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.srch-loadmore:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.srch-loadmore .bi { font-size: 11px; }
.srch-loadmore.is-busy { pointer-events: none; color: transparent; }
.srch-loadmore.is-busy .bi { visibility: hidden; }
.srch-loadmore-spin {
  display: none; position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid var(--accent-line); border-top-color: var(--accent);
  animation: srch-spin 0.6s linear infinite;
}
.srch-loadmore.is-busy .srch-loadmore-spin { display: block; }
@keyframes srch-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .t-search-panel, .srch-sk-glow, .srch-loadmore-spin { animation: none; }
}
