/**
 * Exposed Views filters only: do not affect other form layouts.
 * Keep labels in normal flow, including after Bootstrap floating-label JS.
 */
.views-exposed-layout {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.views-exposed-layout > .views-exposed-widgets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin: 0;
}

.views-exposed-layout > .views-exposed-widgets > .form-item,
.views-exposed-layout > .views-exposed-widgets > .form-wrapper {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  float: none;
}

.views-exposed-layout .form-group {
  margin-bottom: 0;
}

.views-exposed-layout .form-item > label:not(.visually-hidden):not(.option) {
  display: block;
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 0.5rem;
  padding: 0;
  transform: none;
  line-height: 1.5;
  font-size: 1rem;
  white-space: normal;
}

.views-exposed-layout input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='submit']),
.views-exposed-layout select,
.views-exposed-layout textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Preserve day/month/year controls and submit names from the existing theme. */
.views-exposed-layout .js-form-type-datelist > .container-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.views-exposed-layout .js-form-type-datelist .form-item {
  width: auto;
  min-width: 0;
  margin: 0;
}

.views-exposed-layout > .views-exposed-widgets > .form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  /* Override Bootstrap spacing utilities supplied by the parent theme. */
  margin: 0 !important;
}

@media (min-width: 768px) {
  .views-exposed-layout > .views-exposed-widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .views-exposed-layout > .views-exposed-widgets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
