/*
 * Bootstrap 3 -> 5.1 compatibility layer.
 * Loaded after bootstrap-5.1/bootstrap.min.css and before libs.css / main.css.
 * main.css was written against Bootstrap 3, so this restores the BS3 base metrics
 * and the BS3-only helpers/components the markup still relies on.
 */

/* ---- Base metrics (BS3: 10px root, 14px body, 30px gutters) ---- */
html { font-size: 10px; }
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
}
h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.1; margin-bottom: 10px; }
h1, h2, h3 { margin-top: 20px; }
h4, h5, h6 { margin-top: 10px; }
h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }
p { margin: 0 0 10px; }
ul, ol { margin-bottom: 10px; padding-left: 40px; }
a { color: #337ab7; text-decoration: none; }
a:hover, a:focus { color: #23527c; text-decoration: underline; }
label { margin-bottom: 5px; font-weight: 700; }

.container, .container-fluid, .row { --bs-gutter-x: 30px; }
@media (min-width: 576px)  { .container { max-width: none; } }
@media (min-width: 768px)  { .container { max-width: 750px; } }
@media (min-width: 992px)  { .container { max-width: 970px; } }
@media (min-width: 1200px) { .container { max-width: 1170px; } }

/* Horizontally scrolling track rows used inline-block items + white-space:nowrap on BS3's block rows */
.grid-tracks .grid-tracks-row:not(.linear-list) { flex-wrap: nowrap; }

/* ---- Utility classes removed in BS5 ---- */
.hide { display: none !important; }
.hidden { display: none !important; }
/* BS3 had .show{display:block!important}; server-rendered modals use "modal show" to be visible on load */
.modal.show { display: block; }

/* ---- Components with no BS5 equivalent ---- */
.close {
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .2;
}
.close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: .5; }
button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; appearance: none; }

.btn { font-size: 14px; padding: 6px 12px; line-height: 1.42857143; border-radius: 4px; }
.btn-default { color: #333; background-color: #fff; border-color: #ccc; }
.btn-default:hover, .btn-default:focus, .btn-default.active { color: #333; background-color: #e6e6e6; border-color: #adadad; }

.radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; }
.radio label, .checkbox label { min-height: 20px; margin-bottom: 0; font-weight: 400; cursor: pointer; }

/* ---- Modals: BS5 makes header/footer flex rows and sizes everything in rem ---- */
.modal-header { display: block; padding: 15px; }
.modal-header .close { margin-top: -2px; }
.modal-title { margin: 0; line-height: 1.42857143; }
.modal-body { padding: 15px; }
.modal-footer { display: block; padding: 15px; text-align: right; }
.modal-dialog { margin: 10px; }
@media (min-width: 576px) { .modal-dialog { max-width: none; margin: 10px; } }
@media (min-width: 768px) { .modal-dialog { max-width: 600px; margin: 30px auto; } }

.popover { font-size: 14px; }
.tooltip { font-size: 12px; }

/* ---- Navbar: the site uses a custom BS3-style navbar (no navbar-expand-*) ---- */
.navbar { display: block; position: relative; min-height: 50px; margin-bottom: 20px; padding: 0; border: 1px solid transparent; }
.navbar.fixed-top { margin-bottom: 0; border-width: 0 0 1px; }
.navbar-header::before, .navbar-header::after,
.navbar-collapse::before, .navbar-collapse::after { content: " "; display: table; }
.navbar-header::after, .navbar-collapse::after { clear: both; }
.navbar-collapse { flex-basis: auto; flex-grow: 0; align-items: initial; padding-right: 15px; padding-left: 15px; }
.navbar-toggle {
    position: relative;
    float: right;
    padding: 9px 10px;
    margin-right: 15px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: transparent;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}
.navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; }
.navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; }
.navbar-default .navbar-toggle .icon-bar { background-color: #888; }
.navbar-nav { display: block; margin: 7.5px -15px; padding-left: 0; list-style: none; }
.navbar-nav > li { position: relative; display: block; }
.navbar-nav > li > a { position: relative; display: block; padding: 10px 15px; line-height: 20px; }
@media (min-width: 768px) {
    .navbar { border-radius: 4px; }
    .navbar.fixed-top { border-radius: 0; }
    .navbar-header { float: left; }
    .navbar-toggle { display: none; }
    .navbar-collapse { width: auto; border-top: 0; box-shadow: none; }
    .navbar-nav { float: left; margin: 0; }
    .navbar-nav > li { float: left; }
    .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; }
}
.navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; }
.navbar-default .navbar-nav > li > a { color: #777; }
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333; background-color: transparent; }

/* BS5 only positions .dropdown-menu via Popper; the site opens its menus with CSS/own JS */
.dropdown-menu { top: 100%; left: 0; min-width: 160px; padding: 5px 0; margin: 2px 0 0; font-size: 14px; }
.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; }
