/**
 * @file
 * Compact datetime widget layout: date + time on one row.
 *
 * bootstrap_barrio's datetime-form.html.twig wraps the date and time
 * sub-fields in <div class="form-inline"> — a Bootstrap 4 class that
 * Bootstrap 5 no longer styles — so the two form items stack, each taking a
 * full-width row. Lay them out inline instead.
 *
 * Scoped with :has() to real datetime widgets (containing a date/time input)
 * so the navbar's .form-inline search forms are unaffected. This also covers
 * the daterange widget, which renders two such datetime containers.
 */

.form-inline:has(input.form-date, input.form-time) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

/* Each date/time item shrinks to its content instead of filling the row. */
.form-inline:has(input.form-date, input.form-time) > .js-form-item {
  flex: 0 0 auto;
  width: auto;
  margin-bottom: 0; /* cancel Bootstrap's .mb-3 */
}

/* Inputs size to their content rather than .form-control's width: 100%. */
.form-inline > .js-form-item > input.form-date,
.form-inline > .js-form-item > input.form-time {
  width: auto;
}
