/* Space above the search UI */
#search {
  margin-top: 1.5em;
}

/* Pagefind UI: match site typography — LIGHT MODE */
.pagefind-ui__search-input {
  font-family: Georgia, serif !important;
  font-size: 1rem;
  font-weight: 400 !important;
  text-shadow: none !important;
  padding: 0.6em 0.8em;
  border-radius: 6px;
  background-color: #F5F2EC !important;
  border: 1px solid #ccc !important;
  color: inherit !important;
}

.pagefind-ui__search-input:focus {
  outline: 2px solid #C2B8A3 !important;
  outline-offset: 2px;
}

/* Pagefind results styling — LIGHT MODE */
.pagefind-ui__results,
.pagefind-ui__results *,
.pagefind-ui__result,
.pagefind-ui__result-inner,
.pagefind-ui__results li {
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background-image: none !important;
}
.pagefind-ui__results-area {
  padding-bottom: 5rem !important;
}

/* Remove all Pagefind text shadows — LIGHT MODE */
.pagefind-ui__result-title,
.pagefind-ui__result-link,
.pagefind-ui__result-excerpt,
.pagefind-ui__result-excerpt *,
.pagefind-ui__search-clear,
.pagefind-ui__search-clear *,
.pagefind-ui__message {
  text-shadow: none !important;
}

.pagefind-ui__message {
  margin-top: 1em !important;
}

.pagefind-ui__result {
  background: transparent;
  border-bottom: none !important;
  padding: 0.95em 0 !important;
}

.pagefind-ui__result-title {
  font-weight: bold;
  color: inherit;
  text-decoration: none;
}

.pagefind-ui__result-excerpt {
  font-size: 1rem;
  line-height: 1.5;
  color: inherit;
}

.pagefind-ui__result-excerpt mark {
  background-color: #EADFAF !important;
  color: #4A3F2A !important;
  text-shadow: none !important;
  border-radius: 3px !important;
  padding: 0 2px !important;  /* keeps the rounded corners from clipping the text */
}

.pagefind-ui__result-link {
  color: #144334 !important;
  text-decoration: none !important;
}

.pagefind-ui__result-link:hover {
  color: #23610D !important;
  text-decoration: none !important;
}

.pagefind-ui__search-clear {
  background: none !important;
  color: #144334 !important;
  border: none !important;
}

/* Pagefind "Load more" button — LIGHT MODE */
.pagefind-ui__button {
  background-color: #F5F2EC !important;
  border: 1px solid #ccc !important;
  color: #144334 !important;
  padding: 0.6em 1em !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

.pagefind-ui__button:hover {
  background-color: #DDDBD9 !important;
  color: #23610D !important;
}

/* DARK MODE adjustments */
@media (prefers-color-scheme: dark) {

  /* Search bar — DARK MODE */
  .pagefind-ui__search-input::placeholder {
    color: #C9B99A !important;
    opacity: 0.35 !important;
  }
  .pagefind-ui__search-input {
    background-color: #1A1613 !important;
    color: #C9B99A !important;
    text-shadow: none !important;
    border: 2px solid #4A453F !important;
  }

  .pagefind-ui__search-clear,
  .pagefind-ui__search-clear * {
    color: #C9B99A !important;
    text-shadow: none !important;
}

  /* "xx results for xx" — DARK MODE */
  .pagefind-ui__message {
    color: #C9B99A !important;
  }

/* Remove Pagefind's subtle text-shadow — DARK MODE */
.pagefind-ui__result-title,
.pagefind-ui__result-link,
.pagefind-ui__result-excerpt,
.pagefind-ui__result-excerpt *,
.pagefind-ui__search-clear,
.pagefind-ui__search-clear *,
.pagefind-ui__message {
  text-shadow: none !important;
}

  /* Result titles — DARK MODE */
  .pagefind-ui__result-link {
    color: #7C8A5A !important;
  }
  .pagefind-ui__result-link:hover {
    color: #8C9961 !important;
  }

  /* Excerpt text — DARK MODE */
  .pagefind-ui__result-excerpt {
    color: #A0937C !important;
  }

  /* Highlighted search terms — DARK MODE */
  .pagefind-ui__result-excerpt mark {
  background-color: #3A3328 !important;  /* color of the highlighting */
  color: #E8DCC2 !important;  /* color of the text underneath the highlighter */
  text-shadow: none !important;
  border-radius: 3px !important;
  padding: 0 2px !important;  /* keeps the rounded corners from clipping the text */
}

  /* Load more button — DARK MODE */
  .pagefind-ui__button {
    background-color: #3A342F !important;
    border: 1px solid #4A453F !important;
    color: #9BAA8F !important;
  }
  .pagefind-ui__button:hover {
    background-color: #2A2622 !important;
    color: #B7C6A9 !important;
  }
}
