#search {
  position: relative;
}

/* Search form container */
.pagefind-ui__form {
  position: relative;
  width: 16rem;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagefind-ui__form:focus-within {
  width: 24rem;
}

/* Search input */
.pagefind-ui__search-input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 2.5rem; /* py-2, pr for clear button, pl for icon */
  border: 1px solid #d1d5db; /* border-gray-300 */
  border-radius: 0.5rem; /* rounded-lg */
  outline: none;
  transition: all 0.2s;
}

.pagefind-ui__search-input:focus {
  border-color: #0284c7; /* primary-500 */
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2); /* focus:ring-2 focus:ring-primary-500 */
}

.pagefind-ui__search-clear:hover {
  color: #374151; /* gray-700 */
}

/* Search icon */
.pagefind-ui__form::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

.pagefind-ui__search-input {
  padding-left: 2.5rem !important;
}

/* Drawer (dropdown results container) */
.pagefind-ui__drawer {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem; /* mt-1 */
  width: 24rem; 
  max-width: calc(100vw - 2rem);
  background: white;
  border-radius: 0.5rem; /* rounded-lg */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
  border: 1px solid #e5e7eb; /* border-gray-200 */
  max-height: 20rem; /* max-h-80 */
  overflow-y: auto;
  z-index: 20;
}

/* Results area */
.pagefind-ui__results-area {
  padding: 0.5rem;
}

/* Message text */
.pagefind-ui__message {
  padding: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280; /* gray-500 */
  margin: 0;
}

/* Results list */
.pagefind-ui__results {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Individual result item */
.pagefind-ui__result {
  margin-bottom: 0.25rem;
}

.pagefind-ui__result:last-child {
  margin-bottom: 0;
}

.pagefind-ui__result-inner {
  padding: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.pagefind-ui__result-inner:hover {
  background-color: #f9fafb; /* gray-50 */
}

/* Result title/link */
.pagefind-ui__result-title {
  margin: 0 0 0.375rem 0;
}

.pagefind-ui__result-link {
  color: #0284c7; /* primary-600 */
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  display: block;
  transition: color 0.2s;
}

.pagefind-ui__result-link:hover {
  color: #0369a1; /* primary-700 */
  text-decoration: underline;
}

/* Result excerpt */
.pagefind-ui__result-excerpt {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280; /* gray-500 */
  line-height: 1.5;
}

/* Highlighted search terms */
.pagefind-ui__result-excerpt mark,
.pagefind-ui__results-area mark {
  background-color: #fef08a; /* yellow-200 */
  color: #78350f; /* yellow-900 */
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Load more button */
.pagefind-ui__button {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #e5e7eb; /* border-gray-200 */
  border-radius: 0.375rem;
  color: #374151; /* gray-700 */
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagefind-ui__button:hover {
  background-color: #f3f4f6; /* gray-100 */
  border-color: #d1d5db; /* border-gray-300 */
}

.pagefind-ui__button:active {
  background-color: #e5e7eb; /* gray-200 */
}

.pagefind-ui__search-clear {
    display: none;
}

.pagefind-ui__hidden, .pagefind-ui__suppressed {
    display: none;
}

@media (max-width: 768px) {
  .pagefind-ui__drawer {
    width: calc(100vw - 2rem);
    max-width: 24rem; 
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}
