/* ================================================================
   VORA Search Popup
   Opens when the nav-bar search icon is clicked.
   ================================================================ */

.vs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
}
.vs-overlay[data-open="true"] { display: flex; }
.vs-overlay[data-open="true"] .vs-backdrop { animation: vsFadeIn 220ms ease-out; }
.vs-overlay[data-open="true"] .vs-panel { animation: vsSlideIn 260ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes vsFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes vsSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.vs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 43, 0.35);
}

.vs-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  height: 100%;
  background: #fff;
  border-radius: 0;
  box-shadow: -16px 0 48px -12px rgba(14, 40, 65, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Header ---------- */
.vs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #EEE8E0;
}
.vs-head .vs-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #0E2841;
  cursor: pointer;
  transition: background 160ms ease;
}
.vs-head .vs-close:hover { background: #F5F5F5; }
.vs-head .vs-close svg { width: 18px; height: 18px; }
.vs-head h2 {
  font-family: var(--font-body, system-ui);
  font-size: 18px;
  font-weight: 700;
  color: #0E2841;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- Search row ---------- */
.vs-search-row {
  display: flex;
  gap: 10px;
  padding: 18px 20px 6px;
  align-items: stretch;
}
.vs-filter-btn {
  flex: none;
  width: 44px;
  height: 44px;
  background: #E8590C;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms ease;
}
.vs-filter-btn:hover { background: #A53F09; }
.vs-filter-btn svg { width: 20px; height: 20px; }
.vs-search-input-wrap {
  flex: 1;
  position: relative;
  background: #F5F5F5;
  border: 1px solid #EEE8E0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
}
.vs-search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  color: #0E2841;
  height: 100%;
}
.vs-search-input-wrap input::placeholder { color: #909CA8; }

.vs-hits {
  padding: 4px 20px 12px;
  font-family: var(--font-body, system-ui);
  font-size: 12px;
  color: #5E6F80;
  text-align: right;
}

/* ---------- Results ---------- */
.vs-results {
  flex: 1;
  padding: 0 20px 12px;
  min-height: 0;
  overflow-y: auto;
}
.vs-result {
  display: block;
  padding: 16px 0;
  border-bottom: 1px dashed #EEE8E0;
  text-decoration: none;
  position: relative;
}
.vs-result:last-child { border-bottom: none; }
.vs-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.vs-result-title {
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  font-weight: 700;
  color: #E8590C;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 0;
  flex: 1;
}
.vs-result:hover .vs-result-title { text-decoration: underline; }
.vs-result-tag {
  flex: none;
  font-family: var(--font-body, system-ui);
  font-size: 11px;
  font-weight: 600;
  color: #E8590C;
  background: #FDEEE7;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.vs-result-snippet {
  font-family: var(--font-body, system-ui);
  font-size: 13px;
  color: #3E5367;
  line-height: 1.5;
  margin: 6px 0 0;
}

.vs-empty {
  padding: 32px 0;
  text-align: center;
  font-family: var(--font-body, system-ui);
  font-size: 14px;
  color: #909CA8;
}

/* ---------- Pagination ---------- */
.vs-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px 20px;
  border-top: 1px solid #EEE8E0;
}
.vs-pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #F5F5F5;
  border: none;
  display: grid;
  place-items: center;
  font-family: var(--font-body, system-ui);
  font-size: 13px;
  font-weight: 600;
  color: #0E2841;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.vs-pager-btn:hover:not([disabled]):not(.is-active) { background: #EEE8E0; }
.vs-pager-btn.is-active {
  background: #0E2841;
  color: #fff;
  cursor: default;
}
.vs-pager-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.vs-pager-btn svg { width: 14px; height: 14px; }
.vs-pager-ellipsis {
  width: 20px;
  text-align: center;
  color: #909CA8;
  font-size: 13px;
  user-select: none;
}

@media (max-width: 520px) {
  .vs-panel { max-width: none; }
}
