/* BAHS search widget — plain CSS, no build step required. */

.bahs-search {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 760px;
  color: #1a1a1a;
  line-height: 1.4;
}

.bahs-search * {
  box-sizing: border-box;
}

/* --- Search box row --- */

.bahs-search__row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.bahs-search__input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
}

.bahs-search__input:focus {
  outline: none;
  border-color: #2f5d8a;
  box-shadow: 0 0 0 2px rgba(47, 93, 138, 0.2);
}

.bahs-search__button {
  padding: 10px 20px;
  font-size: 15px;
  background: #2f5d8a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.bahs-search__button:hover {
  background: #244a6e;
}

.bahs-search__hint {
  font-size: 12.5px;
  color: #666;
  margin: 0 0 16px;
}

/* --- Scope controls --- */

.bahs-search__scope {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #fafafa;
}

.bahs-search__scope-option {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  cursor: pointer;
}

.bahs-search__scope-option input {
  margin-right: 6px;
}

/* The explanatory line under "Search complete volumes": small and not bold,
   indented to line up with the option's own text. */
.bahs-search__scope-note {
  margin: 0 0 0 22px;
  font-size: 12.5px;
  font-weight: 400;
  color: #666;
  text-align: left;
}

.bahs-search__checkboxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 6px 0 12px 22px;
}

.bahs-search__checkboxes label {
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
}

.bahs-search__checkboxes input {
  margin-right: 6px;
}

/* --- Results --- */

.bahs-search__status {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

.bahs-search__group {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.bahs-search__group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
}

.bahs-search__group-header:hover {
  background: #f5f7fa;
}

.bahs-search__group-title {
  font-size: 14.5px;
}

.bahs-search__group-title .bahs-search__type-label {
  font-weight: 700;
  color: #2f5d8a;
}

.bahs-search__group-count {
  flex-shrink: 0;
  font-size: 13px;
  color: #777;
  white-space: nowrap;
}

.bahs-search__group-hits {
  display: none;
  border-top: 1px solid #eee;
  padding: 4px 14px 10px;
}

.bahs-search__group.is-expanded .bahs-search__group-hits {
  display: block;
}

.bahs-search__hit {
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
}

.bahs-search__hit:last-child {
  border-bottom: none;
}

/* PDF link and page links ("p. 246") share one look and behaviour: same
   colour, size, weight and hover underline. Change them here, once.
   The selectors cover :link and :visited explicitly so that a site-wide
   link rule can never make a link you have already clicked look different. */
.bahs-search a.bahs-search__hit-page:link,
.bahs-search a.bahs-search__hit-page:visited,
.bahs-search a.bahs-search__pdf-link:link,
.bahs-search a.bahs-search__pdf-link:visited {
  font-size: 13px;
  color: #2f5d8a;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.bahs-search a.bahs-search__hit-page:hover,
.bahs-search a.bahs-search__pdf-link:hover {
  color: #2f5d8a;
  font-weight: 600;
  text-decoration: underline;
}

.bahs-search__hit-snippet {
  font-size: 13.5px;
  color: #333;
  margin: 3px 0 0;
}

.bahs-search__hit-snippet mark {
  background: #fff1a8;
  padding: 0 1px;
}

.bahs-search__group-footer {
  padding: 8px 0 4px;
  border-bottom: 1px dashed #eee;
}

/* --- Sort control --- */

.bahs-search__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13.5px;
}

.bahs-search__sort label {
  font-weight: 600;
  color: #333;
}

/* Dressed as one of the blue buttons (same colour, size, corners, hover as
   Search). Still a real <select>, so phones keep their native picker; the
   white arrow is drawn here because appearance:none removes the browser's. */
.bahs-search__sort select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 10px 38px 10px 20px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background-color: #2f5d8a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.bahs-search__sort select:hover {
  background-color: #244a6e;
}

.bahs-search__sort select:focus-visible {
  outline: 2px solid #244a6e;
  outline-offset: 2px;
}

.bahs-search__sort select option {
  color: #1a1a1a;
  background: #fff;
}

.bahs-search__empty {
  color: #777;
  font-size: 14px;
  padding: 20px 0;
}

.bahs-search__version {
  margin-top: 24px;
  font-size: 10.5px;
  color: #bbb;
}
