/* === Pagefind search overrides ===
   Material hides the search button and treats the search panel as a tiny
   inline bar on desktop. We force the icon visible and make the panel a
   proper centered modal on all screen sizes. */

/* 1. Force search icon visible at all breakpoints */
.md-header__button[for="__search"] {
  display: inline-block !important;
}
@media screen and (min-width: 60em) {
  .md-header__button[for="__search"] {
    display: inline-block !important;
  }
}

/* 2. Search modal — fullscreen overlay on all screen sizes */
@media screen and (min-width: 60em) {
  [data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    float: none !important;
    max-width: none !important;
  }
  .md-search__inner {
    float: none !important;
  }
}

/* 3. Search content area — centered card on the overlay */
[data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.54) !important;
  padding-top: 4rem !important;
}

#pagefind-search {
  background: var(--md-default-bg-color, #fff) !important;
  border-radius: 0.5rem !important;
  padding: 1.5rem !important;
  width: 90% !important;
  max-width: 42rem !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3) !important;
}

/* 4. Pagefind input styling to match Material theme */
#pagefind-search .pagefind-ui__search-input {
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  border: 2px solid var(--md-primary-fg-color, #4051b5) !important;
  border-radius: 0.25rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  outline: none !important;
}

#pagefind-search .pagefind-ui__search-input:focus {
  border-color: var(--md-accent-fg-color, #526cfe) !important;
  box-shadow: 0 0 0 0.1rem var(--md-accent-fg-color--transparent, rgba(82, 108, 254, 0.1)) !important;
}

/* 5. Results styling */
#pagefind-search .pagefind-ui__result-link {
  color: var(--md-primary-fg-color, #4051b5) !important;
}

#pagefind-search .pagefind-ui__result {
  padding: 0.75rem 0 !important;
  border-bottom: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.07)) !important;
}
