/* ── Search Overlay ──────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 319;
  display: none;
}
.search-overlay.active {
  display: block;
}

/* ── Search Modal ───────────────────────────────────────── */
.search-modal {
  position: fixed;
  top: 15vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 580px;
  max-height: 70vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  z-index: 320;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ── Input Wrap ─────────────────────────────────────────── */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrap svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ── Keyboard Shortcut Badges ───────────────────────────── */
.search-kbd-close {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

/* ── Results Area ───────────────────────────────────────── */
.search-results {
  overflow-y: auto;
  flex: 1;
  padding: 0.75rem;
}

/* ── Empty State ────────────────────────────────────────── */
.search-empty-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 1rem;
}

/* ── Quick Links (empty state) ──────────────────────────── */
.search-quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

.search-quick-link:hover {
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* ── Group Headers ──────────────────────────────────────── */
.search-group-header {
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
}

/* ── Result Items ───────────────────────────────────────── */
.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result:hover,
.search-result-active {
  background: var(--accent-dim);
}

/* ── Type Badges ────────────────────────────────────────── */
.search-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-type-blog {
  background: var(--accent-dim);
  color: var(--accent);
}

.search-type-tool {
  background: var(--green-dim, rgba(34, 197, 94, 0.1));
  color: var(--green, #22c55e);
}

.search-type-faq {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}

/* ── Result Info ────────────────────────────────────────── */
.search-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.search-result-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── FAQ Section (faq_section.njk) ──────────────────────── */
.faq-section {
  margin-top: 3rem;
}

.faq-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  content: '\2212';
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer p {
  margin: 0;
}

/* ── Search Trigger (nav bar) ───────────────────────────── */
.search-trigger {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  transition: border-color 0.25s, background 0.25s;
  color: var(--text-muted);
}

.search-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.search-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-trigger svg {
  width: 18px;
  height: 18px;
}

.search-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .search-modal {
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .search-kbd,
  .search-kbd-close {
    display: none;
  }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .search-modal,
  .search-overlay {
    transition: none;
  }
}
