/* ── On-site search ────────────────────────────────────────────────────────
   A first-party search over a build-time index (see layouts/index.searchindex.json).
   The index is only fetched when a visitor opens the box, so nothing is paid on
   page load, and no request leaves this domain. */

/* Trigger, sitting in the main navigation next to the menu items. */
.site-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.site-search-toggle:hover,
.site-search-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}
.site-search-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.site-search-toggle svg { width: 1em; height: 1em; fill: currentColor; }
.site-search-toggle-text { display: none; }
@media screen and (min-width: 60em) { .site-search-toggle-text { display: inline; } }
/* Below the flex-l breakpoint the nav stacks; keep the button left-aligned. */
@media screen and (max-width: 59.99em) {
  .site-search-toggle { margin-top: 0.75rem; }
}

/* ── Dialog ───────────────────────────────────────────────────────────── */
.site-search[hidden] { display: none !important; }
.site-search {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 1rem 1rem;
}
.site-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 17, 0.6);
}
.site-search-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.site-search-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef0f3;
}
.site-search-head svg { width: 1.1em; height: 1.1em; fill: #9aa1a9; flex: 0 0 auto; }
.site-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  color: #111;
  padding: 0.25rem 0;
}
.site-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.site-search-close {
  flex: 0 0 auto;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  background: #f8f9fb;
  color: #6b7280;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}
.site-search-close:hover { color: #c01632; border-color: #ED1A3B; }

.site-search-status {
  margin: 0;
  padding: 0.6rem 1rem 0;
  font-size: 0.82rem;
  color: #6b7280;
}
.site-search-status:empty { display: none; }

.site-search-results {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.site-search-result { margin: 0; }
.site-search-result a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s ease;
}
.site-search-result a:hover,
.site-search-result.is-active a { background: #f4f6f8; }
.site-search-result-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.site-search-result-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
}
.site-search-result-section {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  background: #f1f3f6;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.site-search-result-snippet {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #4b5563;
}
.site-search-result-snippet mark {
  background: #fde8ec;
  color: #a3122c;
  border-radius: 2px;
  padding: 0 1px;
}
.site-search-empty { padding: 1rem 1.25rem 1.25rem; }
.site-search-empty p { margin: 0 0 0.75rem; font-size: 0.92rem; color: #4b5563; }
.site-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.site-search-chip {
  border: 1px solid #e2e6eb;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.site-search-chip:hover { border-color: #ED1A3B; color: #c01632; }
.site-search-faq-link { font-size: 0.9rem; font-weight: 600; color: #ED1A3B; text-decoration: none; }
.site-search-faq-link:hover { text-decoration: underline; }

@media screen and (max-width: 40em) {
  .site-search { padding: 4vh 0.5rem 0.5rem; }
  .site-search-panel { max-height: 88vh; }
}
