/* Search and Resource Center only: shared mobile filter disclosure. */
.catalog-filter-toggle { display: none; }
.catalog-filter-body { display: contents; }
body.search-results-page .result-card { border-radius: 0 !important; }

/* Keep the added search field and every desktop facet within reach. */
@media (min-width: 992px) {
  body.search-results-page .filters.site-filter-rail {
    top: var(--catalog-nav-bottom, 88px) !important;
    height: calc(100dvh - var(--catalog-nav-bottom, 88px) - 24px) !important;
    min-height: 0 !important;
  }
  body.search-results-page .filters .panel.site-filter-panel {
    height: 100% !important; min-height: 0 !important; overflow: hidden;
  }
  body.search-results-page .filters .site-filter-panel-scroll {
    height: 100%; max-height: 100%; overflow-y: auto;
    overscroll-behavior: contain; scrollbar-gutter: stable;
  }
}

@media (max-width: 991.98px) {
  html.search-results-document, html.resource-center-document,
  body.search-results-page, body.resource-center-page {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }
  body.search-results-page main.search-page {
    margin-top: var(--catalog-nav-bottom, 68px) !important;
    overflow: visible !important;
  }
  body.search-results-page .search-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 260px;
    padding: 64px 0 56px !important;
    background: #2B303A;
  }
  body.search-results-page .search-hero .count {
    text-transform: none;
    letter-spacing: normal;
    opacity: 1;
  }
  body.search-results-page .search-hero .query { overflow-wrap: anywhere; }
  body.search-results-page .search-main,
  body.resource-center-page main,
  body.resource-center-page .resource-center-catalog {
    overflow: visible !important;
  }
  body.resource-center-page .resource-center-catalog { padding-top: 0; }
  body.search-results-page .search-layout,
  body.resource-center-page .resource-center-catalog > .container {
    width: 100%; max-width: none; padding-left: 0 !important; padding-right: 0 !important;
  }
  body.search-results-page .search-layout,
  body.resource-center-page .resource-center-layout {
    display: flex; flex-direction: column; gap: 0; overflow: visible !important;
  }
  body.search-results-page .search-layout > :not(.site-filter-rail),
  body.resource-center-page .resource-center-results-column {
    width: 100%; min-width: 0; padding-left: 24px; padding-right: 24px;
  }
  body.resource-center-page .resource-center-results-column { padding-top: 40px; }
  body.search-results-page .filters.site-filter-rail,
  body.resource-center-page .resource-center-filters.site-filter-rail {
    position: sticky !important;
    top: var(--catalog-nav-bottom, 68px) !important;
    z-index: 20;
    order: -1; align-self: stretch;
    width: 100%; max-width: none; min-height: 0; height: auto;
    margin: 0; background: #FFFFFF;
  }
  body.search-results-page .site-filter-panel .site-filter-panel-scroll,
  body.resource-center-page .site-filter-panel .site-filter-panel-scroll {
    padding: 0; height: auto; overflow: visible;
  }
  .catalog-filters-ready .site-filter-heading { display: none; }
  .catalog-filters-ready .catalog-filter-toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 72px; padding: 20px 24px;
    border: 0; border-radius: 0; background: #FFFFFF; color: #2B303A;
    font: inherit; text-align: left; cursor: pointer;
  }
  .catalog-filter-toggle img { width: 20px; height: 20px; object-fit: contain; }
  .catalog-filter-chevron { margin-left: auto; flex: none; transition: transform .15s; }
  .catalog-filter-toggle[aria-expanded="true"] .catalog-filter-chevron { transform: rotate(180deg); }
  .catalog-filter-toggle:focus-visible { outline: 2px solid #0F766E; outline-offset: -4px; }
  .catalog-filter-body {
    display: block;
    padding: 0 24px 20px;
    max-height: calc(100dvh - var(--catalog-nav-bottom, 68px) - 72px);
    overflow-y: auto; overscroll-behavior: contain;
    border-top: 1px solid #CFD3D7;
  }
  .catalog-filter-body[hidden] { display: none; }
  .catalog-filters-ready .site-filter-group > summary::after {
    transform: translateY(-50%) rotate(0deg) !important;
  }
  .catalog-filters-ready .site-filter-group[open] > summary::after {
    transform: translateY(-50%) rotate(180deg) !important;
  }
}

/* Search header and card treatment across desktop and mobile. */
body.search-results-page .search-hero {
  background: #2B303A;
  position: relative; isolation: isolate; overflow: hidden;
}
body.search-results-page .search-hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: 0; right: -70px; width: clamp(300px, 45vw, 560px); height: 100%;
  background: url('/assets/images/search-header-background.svg') center / cover no-repeat;
}
body.search-results-page .result-card,
body.search-results-page .result-card:hover,
body.search-results-page .result-card:focus-within {
  transform: none !important; box-shadow: none !important; transition: none !important;
}
body.search-results-page .result-card * { animation: none !important; transition: none !important; }
body.search-results-page .result-card-footer svg { display: block; flex: none; }
