/* Style the search block form using flex. */
.lm-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

/* Reset fieldset styling. */
.lm-search-form .lm-search-form-target {
  padding: 0;
  margin: 0;
  border: 0;
}

/* Style target radios using flex. */
.lm-search-form .lm-search-form-target .fieldset-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
  height: 100%;
}

/* Remove default margin from search toggle radios. */
.lm-search-form .lm-search-form-target .form-check {
  margin-bottom: 0;
}

/* stylelint-disable declaration-no-important */

/* Remove superfluous margins from target radios. */
.lm-search-form .lm-search-form-target > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* stylelint-enable declaration-no-important */

/* Make the keywords input consume all free space. */
.lm-search-form > :has([data-drupal-selector="edit-input"]) {
  flex-grow: 1;
  flex-basis: 0;
  padding: 0;

  /* Remove superfluous margins from the keywords input. */
  margin: 0;
}

/* Ensure that each column is of uniform height (match the tallest element). */
.lm-search-form [data-drupal-selector="edit-target"] {
  height: 100%;
}
.lm-search-form [data-drupal-selector="edit-input"] {
  height: 100%;

  /* Remove superfluous margins from the keywords input. */
  margin: 0;
}

/* Set the size of small buttons. */
.lm-search-form [data-drupal-selector="edit-submit"][data-size="small"] {
  padding: .25rem 1rem;
}

/* Add an icon to the keywords input if the form will submit in a new tab. */
.lm-search-form[target="_blank"] div:has(> [data-drupal-selector="edit-input"]) {
  position: relative;
}
.lm-search-form[target="_blank"] div:has(> [data-drupal-selector="edit-input"])::after {
  position: absolute;
  top: 0;
  right: .5em;
  width: 1em;
  height: 100%;
  pointer-events: none;
  content: "";

  background-color: var(--lm-search-form-icon-color, #333);

  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"/></svg>');
  mask-repeat: no-repeat;
  mask-position: center;
}
.lm-search-form[target="_blank"] [data-drupal-selector="edit-input"] {
  padding-right: 2em;
}

/* Make the target column full-width on small screens. */
@media (max-width: 768px) {
  .lm-search-form .lm-search-form-target {
    min-width: 100%;
  }
}
