/* Site search — header button, dialog, and results. Forest-green palette from existing CRS styles. */

.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  color: #fff;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.search-btn:hover,
.search-btn:focus-visible {
  background: #254433;
  border-color: #cfe4bb;
  color: #cfe4bb;
  outline: 2px solid #cfe4bb;
  outline-offset: 2px;
}
.search-icon {
  display: block;
  flex: none;
}
.search-btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 701px) {
  .search-btn {
    margin-left: auto;
    margin-right: 0.75rem;
  }
}

@media (max-width: 700px) {
  .navbar {
    grid-template-columns: auto auto 1fr;
  }
  .search-btn {
    grid-column: 2;
    justify-self: start;
    width: 2.2rem;
    height: 2.2rem;
    margin: 0;
  }
  .mobile-phone {
    grid-column: 3;
    justify-self: end;
  }
}

.search-dialog {
  width: min(640px, calc(100vw - 24px));
  max-width: 640px;
  max-height: min(80vh, 720px);
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #f6f8f3;
  color: #183924;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.search-dialog::backdrop {
  background: rgba(24, 57, 36, 0.72);
}
.search-dialog-bar {
  padding: 16px 16px 12px;
  border-bottom: 2px solid #254433;
  background: #cfe4bb;
}
.search-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-form label {
  font-size: 13px;
  font-weight: 800;
  color: #183924;
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #183924;
  background: #fff;
  border: 1.5px solid #254433;
  border-radius: 8px;
  padding: 8px 12px;
}
.search-form input[type="search"]:focus {
  outline: 2px solid #254433;
  outline-offset: 1px;
}
.search-go,
.search-close {
  flex: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1.5px solid #254433;
}
.search-go {
  background: #254433;
  color: #fff;
}
.search-close {
  background: transparent;
  color: #254433;
}
.search-go:hover,
.search-go:focus-visible {
  background: #183924;
  border-color: #183924;
  outline: none;
}
.search-close:hover,
.search-close:focus-visible {
  background: #254433;
  color: #fff;
  outline: none;
}
.search-status {
  margin: 0;
  padding: 10px 16px 0;
  font-size: 13px;
  font-weight: 700;
  color: #183924;
}
.search-results {
  padding: 8px 10px 16px;
  overflow: auto;
}
.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-hit {
  display: block;
  text-decoration: none;
  color: #183924;
  background: #fff;
  border: 1.5px solid #88a078;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 6px;
}
.search-hit:hover,
.search-hit:focus-visible {
  border-color: #254433;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 68, 51, 0.28);
}
.search-hit-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #254433;
  margin: 0 0 2px;
}
.search-hit-count {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4b5d48;
  margin: 0 0 6px;
}
.search-hit-snippet {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}
.search-hit mark {
  background: #cfe4bb;
  color: #183924;
  font-weight: 800;
  padding: 0 0.12em;
  border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: 16px;
}

@media (max-width: 700px) {
  .search-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px;
  }
}

@media print {
  .search-btn,
  .search-dialog {
    display: none !important;
  }
}
