/*
 * search.css — the in-nav search button + the floating search overlay used
 * across every help-guide page (and the /search results page). Self-contained:
 * colours are hard-coded to the brand palette (purple #593df3) so the component
 * never depends on a given page's :root tokens.
 */

/* ---- Nav: group the right-hand actions (search + Back to Eventogy) ---- */
.topnav-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topnav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1a1d23;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.topnav-search-btn:hover { background: #f8f9fb; border-color: #d8dae1; }
.topnav-search-btn:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.topnav-search-btn svg { width: 15px; height: 15px; color: #4b5260; flex-shrink: 0; }

@media (max-width: 560px) {
  /* Collapse to an icon-only button to save room next to the CTA. */
  .topnav-search-btn .ev-label { display: none; }
  .topnav-search-btn { padding: 8px; }
}

/* ---- Floating overlay ---- */
.ev-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.ev-search-overlay[hidden] { display: none; }

.ev-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 40, .40);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: ev-fade-in .16s ease;
}

.ev-search-panel {
  position: relative;
  margin: 11vh 16px 16px;
  width: min(640px, 100%);
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .28);
  overflow: hidden;
  animation: ev-pop-in .16s ease;
}

@keyframes ev-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ev-pop-in {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.ev-search-form {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid #eef0f4;
}
.ev-search-form > svg { width: 20px; height: 20px; color: #593df3; flex-shrink: 0; }

.ev-search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  border: none;
  outline: none;
  background: none;
  color: #1a1d23;
}
.ev-search-input::placeholder { color: #9aa0ac; }
.ev-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.ev-search-close {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #4b5260;
  background: #f1f2f5;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.ev-search-close:hover { background: #e8e9ee; }

.ev-search-suggestions {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 56vh;
  overflow-y: auto;
}
.ev-search-suggestions:empty { display: none; }

.ev-search-option {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.ev-search-option[aria-selected="true"],
.ev-search-option:hover { background: #f4f3fd; }

.ev-opt-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: #1a1d23;
}
.ev-opt-title .ev-opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-opt-section {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #593df3;
  background: #eceafb;
  padding: 2px 7px;
  border-radius: 999px;
}
.ev-opt-snippet {
  font-size: 12.5px;
  color: #4b5260;
  line-height: 1.4;
  margin-top: 3px;
}
.ev-search-option mark,
.ev-result mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }

.ev-search-empty {
  padding: 18px 16px;
  font-size: 13.5px;
  color: #4b5260;
}
.ev-search-empty strong { color: #1a1d23; }

.ev-search-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #eef0f4;
  font-size: 12px;
  color: #6b7280;
}
.ev-search-foot kbd {
  font: inherit;
  font-size: 11px;
  background: #f1f2f5;
  border: 1px solid #e4e7ec;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: #4b5260;
}

body.ev-search-open { overflow: hidden; }

/* ---- /search results page ---- */
.ev-search-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.ev-search-page h1 { font-family: var(--font-head, inherit); font-size: 26px; margin: 0 0 6px; color: #1a1d23; }
.ev-search-page .ev-search-meta { color: #4b5260; font-size: 14px; margin: 0 0 24px; }

.ev-search-pageform {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 28px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.ev-search-pageform:focus-within { border-color: #593df3; box-shadow: 0 0 0 3px rgba(89, 61, 243, .15); }
.ev-search-pageform > svg { width: 19px; height: 19px; color: #593df3; flex-shrink: 0; }
.ev-search-pageform input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px;
  border: none; outline: none; background: none; color: #1a1d23;
}
.ev-search-pageform button {
  font: inherit; font-size: 13px; font-weight: 500; color: #fff;
  background: #593df3; border: none; border-radius: 8px;
  padding: 8px 16px; cursor: pointer; transition: background .12s ease;
}
.ev-search-pageform button:hover { background: #4a30d0; }

.ev-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ev-result {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.ev-result:hover { border-color: #c9c4ed; box-shadow: 0 8px 24px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.ev-result .ev-opt-title { font-size: 17px; }
.ev-result .ev-opt-snippet { font-size: 13.5px; margin-top: 6px; }
.ev-result .ev-result-url { font-size: 12px; color: #593df3; margin-top: 8px; }

.ev-noresults { color: #4b5260; font-size: 15px; line-height: 1.6; }
.ev-noresults a { color: #593df3; }
