/* ==========================================================
   Search matches within guideline content
   ========================================================== */

.slh-search-match {
  padding: 0.05em 0.2em;
  color: #2b2500;
  background-color: #fff1a8;
  border-radius: 0.2rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.slh-search-match--active {
  color: #1b1b1b;
  background-color: #ffd54f;
  box-shadow:
    0 0 0 3px rgba(255, 193, 7, 0.35),
    0 0 0 6px rgba(13, 110, 253, 0.18);
}

.slh-search-match--active:focus {
  outline: 3px solid var(--bs-primary);
  outline-offset: 4px;
}

/*
 * Prevent fixed or sticky headers from covering a highlighted result.
 */
.slh-search-match {
  scroll-margin-top: 8rem;
}

/* ==========================================================
   Match navigation
   ========================================================== */

.slh-search-match-navigation {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  max-width: calc(100vw - 2rem);
  color: #25313c;
  background-color: #ffffff;
  border: 1px solid #d8e0e7;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.75rem rgba(20, 40, 60, 0.18);
}

.slh-search-match-navigation__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
}

.slh-search-match-navigation__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8rem;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.slh-search-match-navigation__summary i {
  color: var(--bs-primary);
}

.slh-search-match-navigation__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.slh-search-match-navigation__controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
}

.slh-search-match-navigation__close {
  color: #52616b;
}

/* ==========================================================
   Mobile layout
   ========================================================== */

@media (max-width: 575.98px) {
  .slh-search-match-navigation {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }

  .slh-search-match-navigation__content {
    justify-content: space-between;
    gap: 0.5rem;
  }

  .slh-search-match-navigation__summary {
    min-width: 0;
    white-space: normal;
  }

  .slh-search-match-navigation__controls {
    flex-shrink: 0;
  }
}

/* ==========================================================
   Dark mode
   Update these selectors if your theme uses a different
   dark-mode class or attribute.
   ========================================================== */

body.dark-mode .slh-search-match,
body.theme-dark .slh-search-match,
html[data-theme="dark"] .slh-search-match {
  color: #191919;
  background-color: #e6c85c;
}

body.dark-mode .slh-search-match--active,
body.theme-dark .slh-search-match--active,
html[data-theme="dark"] .slh-search-match--active {
  color: #111111;
  background-color: #ffd54f;
  box-shadow:
    0 0 0 3px rgba(255, 213, 79, 0.4),
    0 0 0 6px rgba(110, 168, 254, 0.25);
}

body.dark-mode .slh-search-match-navigation,
body.theme-dark .slh-search-match-navigation,
html[data-theme="dark"] .slh-search-match-navigation {
  color: #f2f5f7;
  background-color: #1d252d;
  border-color: #46525e;
}