/*------------------------------------------------------------------
[ Bootstrap 5 overrides ]

Loaded right after bootstrap.min.css and before the theme stylesheets.
Keeps behaviour the CMS templates and scripts relied on in Bootstrap 3
for which Bootstrap 5 has no direct equivalent.
-------------------------------------------------------------------*/

/* Bootstrap 3 sizing: components were sized for a 14px base */
html {
  font-size: 14px;
}

/* Bootstrap 3 links: same blue, not underlined (menus and buttons are links too) */
:root {
  --bs-link-color-rgb: 51, 122, 183;
  --bs-link-hover-color-rgb: 35, 82, 124;
}
a {
  text-decoration: none;
}

/* The themes set a fixed .container width; don't cap it at Bootstrap 5's max-width */
@media (min-width: 1200px) {
  .container {
    max-width: none;
  }
}

/*
 * Visibility helpers toggled throughout the CMS JS (.hide/.hidden/.show).
 * As in Bootstrap 3, .hidden is not !important so jQuery .show()/.toggle()
 * can still reveal it (e.g. the campaign wizard steps).
 */
.hide {
  display: none !important;
}
.hidden {
  display: none;
}
.show:not(.dropdown-toggle):not(.dropdown-menu):not(.nav-link):not(.navbar-collapse):not(.collapse):not(.fade) {
  display: block !important;
}

/* Navbar: Bootstrap 3 height, spacing and right-aligned menus */
.navbar {
  --bs-navbar-padding-y: 0;
}
@media (min-width: 768px) {
  .navbar-right {
    float: right !important;
  }
  .navbar-text {
    margin-left: 15px;
    margin-right: 15px;
  }
}

/* Bootstrap 3 bold form labels */
label {
  font-weight: 700;
}
.form-check-label {
  font-weight: 400;
}

/* Form rows */
.form-group {
  margin-bottom: 15px;
}
@media (min-width: 768px) {
  .form-horizontal .col-form-label {
    text-align: right;
  }
  .form-inline .form-group {
    display: inline-block;
    margin-bottom: 0;
    vertical-align: middle;
  }
  .form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
  }
}

/* Selects use .form-control (and get it added from JS); keep the native arrow */
select.form-control {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
}

/*
 * Grid columns outside a .row: Bootstrap 3 gave every column its own
 * gutter and floated it, Bootstrap 5 relies on the parent .row for both.
 */
:not(.row) > [class^="col-"],
:not(.row) > [class*=" col-"] {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
}
:not(.row) > [class^="col-"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]),
:not(.row) > [class*=" col-"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]) {
  float: left;
}
@media (min-width: 576px) {
  :not(.row) > [class*="col-sm-"] { float: left; }
}
@media (min-width: 768px) {
  :not(.row) > [class*="col-md-"] { float: left; }
}
@media (min-width: 992px) {
  :not(.row) > [class*="col-lg-"] { float: left; }
}
.form-group::after {
  content: "";
  display: table;
  clear: both;
}

/* The dolphin sub-menu uses .navbar-collapse outside a .navbar; keep it open on desktop */
@media (min-width: 768px) {
  #dolphinnav11.navbar-collapse.collapse {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .navbar-toggler.dolphin {
    display: none;
  }
}

/*
 * In Bootstrap 3 the dolphin menu's top margin overlapped the floated page
 * title; in Bootstrap 5 the title row is flex and the margin adds a gap.
 */
#contentBody > #dolphincontainer {
  margin-top: 0;
}

/* Main menu dropdowns open on hover and never showed a caret */
.mainnav .dropdown-toggle::after {
  display: none;
}

/*
 * Dropdown menus: the CMS menus (MenuWidget) use plain <li><a> items without
 * .dropdown-item and are opened by CSS on hover, not positioned by Popper.
 */
.dropdown-menu {
  --bs-dropdown-min-width: 160px;
  --bs-dropdown-padding-y: 5px;
  --bs-dropdown-font-size: 14px;
  top: 100%;
  left: 0;
  margin: 2px 0 0;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.dropdown-menu > li > a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: 400;
  line-height: 1.42857143;
  color: #333;
  white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: #262626;
  text-decoration: none;
  background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  color: #fff;
  background-color: #337ab7;
}

/* Bootstrap 3 tables: theme text colour, light borders and stripes, compact rows */
.table {
  --bs-table-color: currentcolor;
  --bs-table-bg: transparent;
  --bs-table-border-color: #ddd;
  --bs-table-striped-color: currentcolor;
  --bs-table-striped-bg: #f9f9f9;
  --bs-table-active-color: currentcolor;
  --bs-table-hover-color: currentcolor;
  --bs-table-hover-bg: #f5f5f5;
  border-color: #ddd;
}
.table > :not(caption) > * {
  border-color: #ddd;
}
.table > :not(caption) > * > * {
  padding: 8px;
  line-height: 1.42857143;
  border-top-color: #ddd;
  border-bottom-color: #ddd;
}
.table-sm > :not(caption) > * > * {
  padding: 5px;
}

/* Bootstrap 3 panel/label look */
.card {
  margin-bottom: 20px;
}
.badge {
  font-size: 75%;
}
