/*
  Pagefind UI overrides
  Loaded after /pagefind/pagefind-ui.css to ensure these values win by source order.
*/

/* Scope Pagefind CSS variables to the search mount point */
#search {
  --pagefind-ui-primary: #5789b2;
  --pagefind-ui-text: #374151;
  --pagefind-ui-background: #ffffff;
  --pagefind-ui-border: #e5e7eb;
  --pagefind-ui-tag: #f3f4f6;
  --pagefind-ui-font: "Montserrat", sans-serif;
  --pagefind-ui-border-radius: 0.5rem;
  --pagefind-ui-image-border-radius: 0;
}

/* Search input styling */
#search .pagefind-ui__search-input {
  border: 2px solid #e5e7eb;
  font-family: "Montserrat", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search .pagefind-ui__search-input:focus {
  border-color: #5789b2;
  box-shadow: 0 0 0 3px rgba(87, 137, 178, 0.1);
  outline: none;
}

/* Result styling */
#search .pagefind-ui__result {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

#search .pagefind-ui__result:hover {
  border-color: #5789b2;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Result title */
#search .pagefind-ui__result-title {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  color: #2d4a62;
  font-size: 1.125rem;
}

#search .pagefind-ui__result-link:hover .pagefind-ui__result-title {
  color: #5789b2;
}

/* Result excerpt */
#search .pagefind-ui__result-excerpt {
  font-family: "Montserrat", sans-serif;
  color: #4b5563;
  line-height: 1.625;
}

/* Highlight matches */
#search .pagefind-ui__result-excerpt mark {
  background-color: #f9cd77;
  color: #2d323a;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Tags/metadata */
#search .pagefind-ui__result-tag {
  background-color: #f3f4f6;
  color: #4b5563;
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-family: "Montserrat", sans-serif;
}

/* Loading state */
#search .pagefind-ui__message {
  font-family: "Montserrat", sans-serif;
  color: #6b7280;
}

/* Clear button */
#search .pagefind-ui__search-clear {
  color: #6b7280;
  transition: color 0.2s;
}

#search .pagefind-ui__search-clear:hover {
  color: #5789b2;
}

/* Button styling */
#search .pagefind-ui__button {
  background-color: #5789b2;
  color: #ffffff;
  border-radius: 0.375rem;
  font-family: "Montserrat", sans-serif;
  transition: background-color 0.2s;
}

#search .pagefind-ui__button:hover {
  background-color: #2d4a62;
}

/* Result image spacing */
#search .pagefind-ui__result-image {
  margin-left: 0.75rem;
}
