/**
 * Bootstrap 5 compatibility layer for migrated Full HTML content.
 *
 * The GPRS theme remains the primary design system. Bootstrap is loaded first
 * and this file restores theme-owned layout boundaries while supplying a few
 * Bootstrap 3 aliases found in migrated Drupal 7 markup.
 */

/* Bootstrap containers must not add gutters to theme-owned page structure. */
.site-header .container,
.page-heading .container,
.main-content > .container,
.highlighted.container,
.content-bottom > .container,
.site-footer .container {
  max-width: none;
  padding-right: 0;
  padding-left: 0;
}

/* Theme-created feature rows are CSS Grid, not Bootstrap grid rows. */
.content-bottom .row,
.content-bottom .block-content > .row {
  margin-right: 0;
  margin-left: 0;
}

/* Preserve the established GPRS button treatment outside rich text. */
.site-shell :where(.button, input[type="submit"], .btn) {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

/* Bootstrap 3's unprefixed phone grid became Bootstrap 5's base grid. */
.gprs-bootstrap-content .col-xs-1 { flex: 0 0 auto; width: 8.33333333%; }
.gprs-bootstrap-content .col-xs-2 { flex: 0 0 auto; width: 16.66666667%; }
.gprs-bootstrap-content .col-xs-3 { flex: 0 0 auto; width: 25%; }
.gprs-bootstrap-content .col-xs-4 { flex: 0 0 auto; width: 33.33333333%; }
.gprs-bootstrap-content .col-xs-5 { flex: 0 0 auto; width: 41.66666667%; }
.gprs-bootstrap-content .col-xs-6 { flex: 0 0 auto; width: 50%; }
.gprs-bootstrap-content .col-xs-7 { flex: 0 0 auto; width: 58.33333333%; }
.gprs-bootstrap-content .col-xs-8 { flex: 0 0 auto; width: 66.66666667%; }
.gprs-bootstrap-content .col-xs-9 { flex: 0 0 auto; width: 75%; }
.gprs-bootstrap-content .col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.gprs-bootstrap-content .col-xs-11 { flex: 0 0 auto; width: 91.66666667%; }
.gprs-bootstrap-content .col-xs-12 { flex: 0 0 auto; width: 100%; }

.gprs-bootstrap-content .img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

.gprs-bootstrap-content .pull-left { float: left; }
.gprs-bootstrap-content .pull-right { float: right; }
.gprs-bootstrap-content .text-left { text-align: left; }
.gprs-bootstrap-content .text-right { text-align: right; }

.gprs-bootstrap-content .btn-default {
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333 !important;
}

/* Let an authored Bootstrap container behave as Bootstrap expects, despite
 * the theme's intentional structural `.container` rules. */
.gprs-bootstrap-content > .container {
  width: 100%;
  max-width: none;
  margin-right: auto;
  margin-left: auto;
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
}

@media (min-width: 576px) {
  .gprs-bootstrap-content > .container { max-width: 540px; }
}

@media (min-width: 768px) {
  .gprs-bootstrap-content > .container { max-width: 720px; }
}

@media (min-width: 992px) {
  .gprs-bootstrap-content > .container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .gprs-bootstrap-content > .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
  .gprs-bootstrap-content > .container { max-width: 1320px; }
}

/* Legacy floats should not escape their formatted-text field. */
.gprs-bootstrap-content::after {
  display: table;
  clear: both;
  content: "";
}
