/**
 * Exposed-filter rules carried over from Drupal 7's views module (css/views.css).
 *
 * Drupal 8 rewrote that stylesheet and dropped the .views-exposed-widget rules
 * entirely, so the search pages lost the layout they had on D7 even though the
 * markup still carries the classes.
 *
 * The one that matters most is the padding reset below. The widgets also carry
 * Bootstrap's col-xs-6/col-sm-4, whose 15px side padding indents their contents.
 * D7's rule has padding-left 0 and outranks Bootstrap (two classes against one),
 * pulling the boxes flush with the row edge — which is where the bare
 * <h2>Filter by:</h2> sits, since it has no col class of its own to re-add that
 * padding. Without this, the heading hangs 15px to the left of the boxes.
 *
 * Loaded before style.css, mirroring D7 where module CSS preceded theme CSS.
 */

.views-exposed-form .views-exposed-widget {
  float: left;
  padding: 0.5em 1em 0 0;
}

.views-exposed-form .views-exposed-widget .form-submit {
  margin-top: 1.6em;
}

.views-exposed-form .form-item,
.views-exposed-form .form-submit {
  margin-top: 0;
  margin-bottom: 0;
}

.views-exposed-form label {
  font-weight: bold;
}

.views-exposed-widgets {
  margin-bottom: 0.5em;
}

/**
 * Drupal 7 labelled each filter with a plain <label>. Better Exposed Filters on
 * Drupal 11 wraps its checkboxes in a <fieldset> and puts the label in a
 * <legend> instead, which Bootstrap styles as a section header:
 *
 *   legend { width: 100%; font-size: 21px; margin-bottom: 20px;
 *            border-bottom: 1px solid #e5e5e5 }
 *
 * That border is the stray horizontal rule above each filter box, and the 21px
 * size dwarfs the D7 label. Reset the legend to Bootstrap's own <label> styling
 * so it reads as the D7 one did.
 */
.views-exposed-form legend {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-bottom: 5px;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: 0;
}

.views-exposed-form .fieldset-legend {
  font-weight: bold;
}
