/* ============================================================================
   Pagefind Search - Custom Styling for Better UX
   ============================================================================ */

/* Search Container Wrapper */
.pagefind-ui {
  width: 100% !important;
  max-width: 100% !important;
}

/* Search Form */
.pagefind-ui__form {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Search Input */
.pagefind-ui__search-input {
  width: 100% !important;
  padding: 16px 100px 16px 50px !important; /* Left padding increased to make room for search icon */
  font-size: 18px !important;
  border: 2px solid #ddd !important;
  border-radius: 12px !important;
  background: white !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  box-sizing: border-box !important;
}

.pagefind-ui__search-input:focus {
  outline: none !important;
  border-color: #8b4513 !important;
  box-shadow: 0 4px 16px rgba(139, 69, 19, 0.2) !important;
}

/* Clear Button */
.pagefind-ui__search-clear {
  padding: 10px 18px !important;
  background: #cd853f !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
}

.pagefind-ui__search-clear:hover {
  background: #b8733d !important;
}

/* Results Count Message */
.pagefind-ui__message {
  font-size: 16px !important;
  color: #666 !important;
  margin: 24px 0 !important;
  padding: 16px !important;
  background: #faf8f5 !important;
  border-radius: 8px !important;
  border-left: 4px solid #cd853f !important;
}

/* Individual Search Result */
.pagefind-ui__result {
  background: white !important;
  border: 2px solid #e8e8e8 !important;
  border-radius: 12px !important;
  padding: 18px !important;
  margin-bottom: 12px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

.pagefind-ui__result:hover {
  border-color: #8b4513 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px) !important;
}

/* Result Link */
.pagefind-ui__result-link {
  text-decoration: none !important;
  display: block !important;
}

/* Result Title */
.pagefind-ui__result-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #8b4513 !important;
  margin-bottom: 8px !important;
  line-height: 1.3 !important;
  display: block !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.pagefind-ui__result:hover .pagefind-ui__result-title {
  color: #6d3710 !important;
}

/* Result Excerpt */
.pagefind-ui__result-excerpt {
  font-size: 14px !important;
  color: #666 !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  display: block !important;
  padding: 0 !important;
}

/* Highlight Search Terms */
.pagefind-ui__result-excerpt mark,
mark {
  background: #fff8dc !important;
  color: #333 !important;
  font-weight: 600 !important;
  padding: 3px 6px !important;
  border-radius: 3px !important;
  border: 1px solid #f4e4c1 !important;
}

/* Remove the "Read this recipe" footer */
.pagefind-ui__result-link::after {
  display: none !important;
}

/* Hide sub-results completely */
.pagefind-ui__result-nested,
.pagefind-ui__result-tags {
  display: none !important;
}

/* Load More Button */
.pagefind-ui__button {
  background: #8b4513 !important;
  color: white !important;
  border: none !important;
  padding: 14px 32px !important;
  border-radius: 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: block !important;
  margin: 32px auto !important;
}

.pagefind-ui__button:hover {
  background: #6d3710 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3) !important;
}

/* Loading State */
.pagefind-ui__loading {
  text-align: center !important;
  padding: 40px !important;
  color: #666 !important;
  font-size: 18px !important;
}
