/*
 * design-system/components/global-search.css
 * Editorial Calm — GlobalSearch (Cmd-K). ТЗ 4.9.
 *
 * Триггер — кнопка в AppHeader. Активация по клику / ⌘K / Ctrl+K.
 * Открывается модальный оверлей с инпутом и сгруппированными результатами.
 *
 * Группы (ТЗ 4.9):
 *   • Города
 *   • Активные исследования
 *   • Разделы (Пульс, Тарифы, Профиль)
 *   • История последних 5 запросов
 */

/* ─── Trigger в хедере ─────────────────────────────────────────────── */
[data-theme="editorial"] .ed-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  height: 36px;
  padding: 0 var(--s-3);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  min-width: 220px;
  transition: border-color var(--motion-fast) var(--ease);
}
[data-theme="editorial"] .ed-search-trigger:hover { border-color: var(--ink); }
[data-theme="editorial"] .ed-search-trigger:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }
[data-theme="editorial"] .ed-search-trigger > span { flex: 1; text-align: left; }

[data-theme="editorial"] .ed-kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--paper-edge);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
}

/* ─── Overlay + dialog ─────────────────────────────────────────────── */
[data-theme="editorial"] .ed-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

[data-theme="editorial"] .ed-search-dialog {
  width: min(640px, 92%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--paper-edge);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

[data-theme="editorial"] .ed-search-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--rule);
}
[data-theme="editorial"] .ed-search-input-wrap svg {
  width: 20px; height: 20px; stroke-width: 1.5; color: var(--ink-3); flex-shrink: 0;
}
[data-theme="editorial"] .ed-search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
}
[data-theme="editorial"] .ed-search-input::placeholder { color: var(--ink-3); }

[data-theme="editorial"] .ed-search-results {
  overflow-y: auto;
  flex: 1;
}

/* Группа результатов */
[data-theme="editorial"] .ed-search-group {
  border-bottom: 1px solid var(--rule-2);
}
[data-theme="editorial"] .ed-search-group:last-child { border-bottom: 0; }

[data-theme="editorial"] .ed-search-group__title {
  padding: var(--s-3) var(--s-4) var(--s-1);
  font-family: var(--font-sans);
  font-size: var(--t-eyebrow-size);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

[data-theme="editorial"] .ed-search-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  border: 0;
  width: 100%;
  background: transparent;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color var(--motion-fast) var(--ease);
}
[data-theme="editorial"] .ed-search-item:hover,
[data-theme="editorial"] .ed-search-item.is-selected {
  background: var(--paper-2);
  color: var(--ink);
}
[data-theme="editorial"] .ed-search-item__title {
  flex: 1;
  font-weight: 500;
}
[data-theme="editorial"] .ed-search-item__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

[data-theme="editorial"] .ed-search-empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* Footer-подсказка по горячим клавишам */
[data-theme="editorial"] .ed-search-footer {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--rule-2);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
}
[data-theme="editorial"] .ed-search-footer .ed-kbd {
  margin-right: var(--s-2);
}
