/**
 * Bootstrap 3 "xs" grid tier compatibility for Bootstrap 5.
 *
 * Drupal 11.4 core ships Bootstrap-less markup and this theme migrated to
 * Bootstrap 5, which removed the `-xs-` infix (BS5 uses `.col-N`). Legacy
 * editor content, Views config slide markup and theme CSS still use
 * `.col-xs-*`, so redefine just those classes here with the original BS3
 * float-based semantics. Loaded before styles.css so custom rules win.
 *
 * Only col-xs-12 / -6 / -4 are used today; the full 1–12 set is provided
 * so newly-authored content keeps working.
 */
[class*="col-xs-"] {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
  float: left;
  box-sizing: border-box;
}
.col-xs-12 { width: 100%; }
.col-xs-11 { width: 91.66666667%; }
.col-xs-10 { width: 83.33333333%; }
.col-xs-9  { width: 75%; }
.col-xs-8  { width: 66.66666667%; }
.col-xs-7  { width: 58.33333333%; }
.col-xs-6  { width: 50%; }
.col-xs-5  { width: 41.66666667%; }
.col-xs-4  { width: 33.33333333%; }
.col-xs-3  { width: 25%; }
.col-xs-2  { width: 16.66666667%; }
.col-xs-1  { width: 8.33333333%; }

/**
 * BS5 removed `.sr-only` (now `.visually-hidden`). Legacy markup still uses
 * `.sr-only`; without this rule that screen-reader text renders visibly.
 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/**
 * BS5's reboot underlines every <a> by default; BS3 (pre-upgrade) used
 * `text-decoration: none`, so links/menus were not underlined. Restore that
 * default. Loaded before styles.css, so any intentionally-underlined links
 * defined there still win.
 */
a {
  text-decoration: none;
}

/**
 * Glyphicons Halflings font. BS3's stylesheet declared this @font-face and is
 * no longer loaded, but the font files are still vendored. styles.css uses it
 * in ~14 `content: "\eXXX"` rules (e.g. the header search magnifying glass,
 * \e003). Re-declaring it here restores those icons with exact parity.
 */
@font-face {
  font-family: "Glyphicons Halflings";
  src: url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.eot");
  src: url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"),
       url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2") format("woff2"),
       url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.woff") format("woff"),
       url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf") format("truetype"),
       url("../vendor/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
  font-weight: normal;
  font-style: normal;
}

/**
 * Header search widget alignment. BS5's .form-control (on the USP.org/USP-NF
 * <select>) forces a ~38px min-height, and BS5 treats .form-text as small
 * helper text (adds top margin / line-height). Both break the theme's
 * fixed-height, absolutely-positioned layout of the input, pill and search
 * glass. Neutralize only the BS5-injected properties the theme doesn't set,
 * so its intended heights/positions align on one baseline.
 */
.search-box .form-text,
.search-box .form-control,
.search-box select,
.search-box .form-submit {
  min-height: 0;
  line-height: normal;
  margin-top: 0;
  box-shadow: none;
  vertical-align: middle;
}

/**
 * BS5 auto-renders a caret via `.dropdown-toggle::after`. BS3 did not, and this
 * theme supplies its own caret markup (e.g. the Login/account button's
 * bi-caret-down-fill span), so BS5's produces a duplicate arrow. Suppress the
 * BS5 auto-caret to restore the single, theme-controlled caret.
 */
.dropdown-toggle::after {
  display: none;
}

/**
 * BS3's base made `.dropdown-menu` links `display: block` and
 * `white-space: nowrap`; BS5 only does that for `.dropdown-item`. The
 * account/login menu uses plain <a> links, so under BS5 they render inline and
 * wrapping — the theme's `padding: 10px 15px` no longer spaces them vertically
 * and the menu collapses narrow. Restore block + nowrap to match the original
 * spacing and width.
 */
#block-useraccountsmenu .dropdown-menu a {
  display: block;
  white-space: nowrap;
}

