/*!
 * BS3-to-BS5 compatibility shim for the legacy "wep" templates.
 * Loaded after bootstrap.min.css (BS 5.3.x) to bridge classes that
 * Bootstrap 5 removed or renamed, plus a drop-in Glyphicons Halflings
 * font so the 26 .glyphicon-* references across the codebase still render.
 *
 * Why this file exists: legacy templates emit BS3 markup; rewriting all
 * of them would be wasted work because the codebase is being ported to
 * Symfony. This shim lets BS5 ship today without touching templates.
 */

/* ============================================================
 * Glyphicons Halflings  (BS3 icon font, dropped in BS4/5)
 * Font files already live under /_design/fonts/ — see the
 * twbs/bootstrap@v3.4.1 dist for the standard mapping.
 * ============================================================ */
@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('/_design/fonts/glyphicons-halflings-regular.woff') format('woff'),
       url('/_design/fonts/glyphicons-halflings-regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
.glyphicon {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.glyphicon-arrow-left:before    { content: "\e091"; }
.glyphicon-arrow-up:before      { content: "\e093"; }
.glyphicon-ban-circle:before    { content: "\e090"; }
.glyphicon-bullhorn:before      { content: "\e122"; }
.glyphicon-cloud-upload:before  { content: "\e198"; }
.glyphicon-envelope:before      { content: "\2709"; }
.glyphicon-erase:before         { content: "\e221"; }
.glyphicon-eye-open:before      { content: "\e105"; }
.glyphicon-filter:before        { content: "\e138"; }
.glyphicon-flash:before         { content: "\e162"; }
.glyphicon-home:before          { content: "\e021"; }
.glyphicon-link:before          { content: "\e144"; }
.glyphicon-map-marker:before    { content: "\e062"; }
.glyphicon-off:before           { content: "\e017"; }
.glyphicon-pencil:before        { content: "\270f"; }
.glyphicon-plus:before          { content: "\2b"; }
.glyphicon-question-sign:before { content: "\e085"; }
.glyphicon-record:before        { content: "\e165"; }
.glyphicon-remove:before        { content: "\e014"; }
.glyphicon-rub:before           { content: "\20bd"; }
.glyphicon-sort:before          { content: "\e150"; }
.glyphicon-star:before          { content: "\e006"; }
.glyphicon-star-empty:before    { content: "\e007"; }
.glyphicon-trash:before         { content: "\e020"; }
.glyphicon-user:before          { content: "\e008"; }
.glyphicon-warning-sign:before  { content: "\e107"; }

/* ============================================================
 * BS3 → BS5 utility aliases
 * ============================================================ */

/* col-xs-N — BS5 calls it just col-N */
.col-xs-1  { flex: 0 0 auto; width:  8.3333333%; }
.col-xs-2  { flex: 0 0 auto; width: 16.6666666%; }
.col-xs-3  { flex: 0 0 auto; width: 25%; }
.col-xs-4  { flex: 0 0 auto; width: 33.3333333%; }
.col-xs-5  { flex: 0 0 auto; width: 41.6666666%; }
.col-xs-6  { flex: 0 0 auto; width: 50%; }
.col-xs-7  { flex: 0 0 auto; width: 58.3333333%; }
.col-xs-8  { flex: 0 0 auto; width: 66.6666666%; }
.col-xs-9  { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.3333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.6666666%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

/* visibility utilities (BS3 used breakpoint-prefixed display rules).
 * Use `revert` so the element keeps its natural display value
 * (block for h3, inline for span, etc.) instead of CSS's `initial` = inline. */
.hidden-xs { display: none !important; }
@media (min-width: 576px) { .hidden-xs { display: revert !important; } }
.visible-xs { display: none !important; }
@media (max-width: 575.98px) { .visible-xs { display: revert !important; } }

/* sr-only — renamed to .visually-hidden in BS5 */
.sr-only,
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* button defaults — BS5 renamed btn-default to btn-secondary */
.btn-default {
  color: #212529;
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active {
  color: #212529;
  background-color: #e2e6ea;
  border-color: #adb5bd;
}

/* navbar — BS3 .navbar-toggle / .icon-bar (we also patch the navbar markup
 * to use BS5 .navbar-toggler in head.inc.php, but keep these aliases so any
 * stray BS3-classed buttons still render correctly). */
.navbar-default {
  background-color: #f8f9fa;
  border-color: #e7e7e7;
}
.navbar-toggle {
  padding: .25rem .75rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: .25rem;
  position: relative;
  float: right;
  margin-right: 15px;
  margin-top: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
@media (min-width: 768px) {
  .navbar-toggle { display: none; }
}
.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #888;
  border-radius: 1px;
  margin: 0 auto;
}
.navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; }

/* form-group — BS5 dropped this; restore basic vertical spacing */
.form-group { margin-bottom: 1rem; }

/* input-group-btn — BS5 removed the wrapper; render children inline */
.input-group-btn { display: flex; }

/* panel — not currently used in this project, but cheap insurance */
.panel { background-color: #fff; border: 1px solid #ddd; border-radius: .25rem; margin-bottom: 1rem; }
.panel-heading { padding: .75rem 1.25rem; background-color: #f7f7f7; border-bottom: 1px solid #ddd; }
.panel-body { padding: 1rem; }
.panel-default { border-color: #ddd; }
