/*
 * Janaz Search — Front-end Styles
 * Extends the theme's .search-form styles with dropdown + results page.
 * @package JanazSearch
 */

/* ── Results page wrapper ──────────────────────────────────────── */
.jsrch-results-wrap {
  padding-top: 1.5rem;
}

.jsrch-results-meta {
  margin: 1.5rem 0 1rem;
}
.jsrch-results-meta p {
  font-size: .9rem;
  color: var(--ink-muted, #6b6b6b);
  font-weight: 500;
}
.jsrch-no-results {
  background: var(--cream, #f5f2eb);
  border: 1px solid var(--border, #d4cfc5);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  font-size: .9375rem;
  color: var(--ink-soft, #3d3d3d);
  line-height: 1.6;
}

/* ── Search form override for results page ─────────────────────── */
.jsrch-form {
  position: relative;
  z-index: 10;
}

/* ── Live suggestions dropdown ─────────────────────────────────── */
.jsrch-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border, #d4cfc5);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(45, 80, 22, .13);
  overflow: hidden;
  z-index: 9999;
  max-height: 380px;
  overflow-y: auto;
}
.jsrch-dropdown[hidden] { display: none; }

.jsrch-drop-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1.1rem;
  text-decoration: none;
  color: var(--ink, #1a1a1a);
  border-bottom: 1px solid var(--border-light, #e8e4dc);
  transition: background 150ms ease;
  cursor: pointer;
}
.jsrch-drop-item:last-child { border-bottom: none; }
.jsrch-drop-item:hover,
.jsrch-drop-item:focus,
.jsrch-drop-item[aria-selected="true"] {
  background: var(--cream, #f5f2eb);
  outline: none;
}

.jsrch-drop-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(45, 80, 22, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest, #2D5016);
  margin-top: 1px;
}
.jsrch-drop-name {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.3;
  color: var(--ink, #1a1a1a);
}
.jsrch-drop-meta {
  font-size: .78rem;
  color: var(--ink-muted, #6b6b6b);
  margin-top: .15rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.jsrch-drop-meta-item {
  display: flex;
  align-items: center;
  gap: .2rem;
}
.jsrch-drop-meta-item svg { width: 11px; height: 11px; color: var(--moss, #4a7c2a); }

/* View all results row */
.jsrch-drop-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .75rem 1.1rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--forest, #2D5016);
  text-decoration: none;
  background: rgba(45, 80, 22, .04);
  transition: background 150ms;
  letter-spacing: .01em;
}
.jsrch-drop-all:hover { background: rgba(45, 80, 22, .08); }
.jsrch-drop-all svg { width: 13px; height: 13px; }

/* Loading / status states */
.jsrch-drop-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.25rem;
  font-size: .875rem;
  color: var(--ink-muted, #6b6b6b);
}
.jsrch-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(45, 80, 22, .2);
  border-top-color: var(--forest, #2D5016);
  border-radius: 50%;
  animation: jsrch-spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes jsrch-spin { to { transform: rotate(360deg); } }

/* ── Results grid cards ────────────────────────────────────────── */
.jsrch-cards {
  margin-top: 1rem;
}

/* ── Pagination ────────────────────────────────────────────────── */
.jsrch-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 2.5rem;
  justify-content: center;
}
.jsrch-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft, #3d3d3d);
  background: var(--white, #fff);
  border: 1.5px solid var(--border, #d4cfc5);
  text-decoration: none;
  transition: all 150ms;
}
.jsrch-page:hover { border-color: var(--forest, #2D5016); color: var(--forest, #2D5016); }
.jsrch-page--active {
  background: var(--forest, #2D5016);
  color: #fff !important;
  border-color: var(--forest, #2D5016);
}
