/**
 * Blog + Events autosuggest search.
 * Two variants share the same dropdown markup:
 *   .blog-search-hero    — wide, used inside the archive hero / page top
 *   .blog-search-sidebar — compact, used in single-post / single-event sidebar widgets
 */

.blog-search { position: relative; width: 100%; font-family: var(--font); }

.blog-search-form {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0 12px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.blog-search-form:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(31, 71, 136, 0.12);
}

.blog-search-icon { color: var(--text-muted); flex-shrink: 0; }

.blog-search-input {
  flex: 1 1 auto; min-width: 0; height: 44px;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text-primary);
}
.blog-search-input::placeholder { color: var(--text-muted); }

.blog-search-submit {
  flex-shrink: 0; height: 32px; width: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm);
  background: var(--navy); color: var(--white); cursor: pointer;
  transition: background 0.15s var(--ease);
}
.blog-search-submit:hover { background: var(--navy-dark, #102A52); }

/* ─── Hero variant ────────────────────────────────────────────────────── */
.blog-search-hero { max-width: 620px; margin: 22px auto 0; }
.blog-search-hero .blog-search-form {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

/* ─── Sidebar variant ─────────────────────────────────────────────────── */
.blog-search-sidebar { margin-bottom: 16px; }
.blog-search-sidebar .blog-search-form { padding: 0 10px; }
.blog-search-sidebar .blog-search-input { height: 40px; font-size: 13px; }
.blog-search-sidebar .blog-search-submit { height: 28px; width: 28px; }

/* ─── Suggestions dropdown ────────────────────────────────────────────── */
.blog-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  max-height: 420px; overflow-y: auto; z-index: 120;
}
.blog-search-results[hidden] { display: none; }

.blog-search-list { list-style: none; margin: 0; padding: 6px; }
.blog-search-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 10px; border-radius: var(--radius-sm); cursor: pointer;
  text-decoration: none; color: inherit;
  transition: background 0.12s var(--ease);
}
.blog-search-item:hover,
.blog-search-item.is-active { background: var(--navy-wash); }

.blog-search-thumb {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--navy-wash); object-fit: cover;
}
.blog-search-thumb.is-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); font-weight: 700; font-size: 11px; font-family: var(--mono, monospace);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.blog-search-body { flex: 1; min-width: 0; }
.blog-search-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  line-height: 1.35; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-search-title mark { background: rgba(232, 168, 56, 0.28); color: inherit; padding: 0 1px; border-radius: 2px; }
.blog-search-meta {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.blog-search-meta .pill {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 999px; background: var(--navy-wash); color: var(--navy);
}
.blog-search-meta .pill.is-event { background: rgba(232, 168, 56, 0.16); color: #B47100; }

.blog-search-empty {
  padding: 18px 14px; text-align: center; font-size: 13px; color: var(--text-muted);
}
.blog-search-all {
  display: block; text-align: center; padding: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--navy);
  text-decoration: none; border-top: 1px solid var(--border-light);
}
.blog-search-all:hover { background: var(--navy-wash); }

/* ─── Loading state ───────────────────────────────────────────────────── */
.blog-search.is-loading .blog-search-icon {
  animation: blog-search-pulse 0.9s ease-in-out infinite;
}
@keyframes blog-search-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── Mobile tweaks ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-search-hero { margin: 18px 0 0; max-width: 100%; }
  .blog-search-input { height: 40px; font-size: 13.5px; }
  .blog-search-results { max-height: 360px; }
}
