/**
 * @file
 * Compact layout for the text-format widget footer.
 *
 * Places the "Text format" label + select and the "About text formats" link
 * on a single row (the link pushed to the end), and drops the format
 * guidelines onto their own full-width row below. CSS only — the DOM is left
 * intact so core's filterGuidelines behaviour keeps showing the tips for the
 * selected format.
 */

.js-filter-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  margin-top: 0.25rem;
}

/* Label + select share one compact line. */
.js-filter-wrapper .js-form-type-select {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0; /* cancel Bootstrap's .mb-3 */
}

.js-filter-wrapper .js-form-type-select > label {
  margin: 0;
  white-space: nowrap;
}

.js-filter-wrapper .js-filter-list {
  width: auto;
  min-width: 12rem;
  max-width: 100%;
}

/* "About text formats" link sits at the end of the same row. */
.js-filter-wrapper > div:has(a[href$="filter/tips"]) {
  order: 2;
  margin: 0 0 0 auto;
}

/* Format guidelines wrap onto their own row underneath. */
.js-filter-wrapper .js-filter-guidelines {
  order: 3;
  flex-basis: 100%;
  width: 100%;
}
