/* ============ SITE SEARCH ============ */

/* Trigger button in the header */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #4a4d53;
  background: #f5f6f8;
  border: 1px solid #e1e3e8;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: color .18s, border-color .18s, background .18s, box-shadow .18s;
}
.nav-search-btn:hover {
  color: #14181f;
  border-color: #cdd0d6;
  background: #fff;
  box-shadow: 0 4px 14px rgba(20, 24, 31, 0.07);
}
.nav-search-btn svg { color: #559986; flex-shrink: 0; }
.nav-search-btn kbd {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #8a8f97;
  background: #fff;
  border: 1px solid #e1e3e8;
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 2px;
}

/* Overlay + modal */
html.rs-open { overflow: hidden; }
.rs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 20px;
  background: rgba(15, 20, 18, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .16s ease;
}
.rs-overlay.is-open { display: flex; opacity: 1; }

.rs-modal {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 20, 18, 0.34);
  overflow: hidden;
  transform: translateY(-8px) scale(.985);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.rs-overlay.is-open .rs-modal { transform: none; }

.rs-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #eef0f2;
}
.rs-mag { color: #559986; flex-shrink: 0; }
.rs-input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  color: #1a1a1a;
  background: transparent;
}
.rs-input::placeholder { color: #9aa0a8; }
.rs-esc {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #8a8f97;
  background: #f5f6f8;
  border: 1px solid #e7e7ea;
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
}

.rs-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 56vh;
  overflow-y: auto;
}
.rs-item { margin: 0; }
.rs-item > a {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.rs-item.is-active > a { background: #f0f6f4; }
.rs-item.is-active { box-shadow: inset 3px 0 0 #559986; border-radius: 10px; }
.rs-sec {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8c2f12;
  margin-bottom: 3px;
}
.rs-title {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16.5px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}
.rs-snippet {
  display: block;
  font-size: 13px;
  color: #6a6f76;
  line-height: 1.5;
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rs-item mark {
  background: rgba(184, 67, 28, 0.16);
  color: #8c2f12;
  border-radius: 2px;
  padding: 0 1px;
}

.rs-empty {
  padding: 28px 18px 34px;
  text-align: center;
  color: #8a8f97;
  font-size: 15px;
}
.rs-foot {
  display: flex;
  gap: 18px;
  padding: 11px 18px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
  font-size: 12px;
  color: #9aa0a8;
}
.rs-foot kbd {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #6a6f76;
  background: #fff;
  border: 1px solid #e1e3e8;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 2px;
}

@media (max-width: 720px) {
  .nav-search-label, .nav-search-btn kbd { display: none; }
  .nav-search-btn { padding: 8px; }
  .rs-overlay { padding: 8vh 14px 14px; }
  .rs-foot { display: none; }
  .rs-results { max-height: 64vh; }
}
