/*
 * Bootstrap 4 -> 5 compatibility shims.
 * bs.css was upgraded to Bootstrap 5 (which renamed/removed these classes),
 * but templates across the site still use the Bootstrap 4 names. Rather than
 * rewrite every template, restore the old class names here.
 */
.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;
}

.no-gutters {
  margin-right: 0;
  margin-left: 0;
}
.no-gutters > .col,
.no-gutters > [class*='col-'] {
  padding-right: 0;
  padding-left: 0;
}

.badge-pill {
  border-radius: 10rem;
}

.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-5 { margin-left: 3rem !important; margin-right: 3rem !important; }

/*
 * The Bootstrap 5 rebuild set --bs-link-color to Bootstrap's default blue
 * instead of the site's theme purple (--bs-primary: #609). Restore it.
 */
:root {
  --bs-link-color: #609;
  --bs-link-color-rgb: 102, 0, 153;
  --bs-link-hover-color: #33006a;
  --bs-link-hover-color-rgb: 51, 0, 106;
}

/* A list-group-item link should still look/act like a link (purple, underlined) */
a.list-group-item {
  color: var(--bs-link-color);
  text-decoration: underline;
}
a.list-group-item:hover {
  color: var(--bs-link-hover-color);
}

/* More Bootstrap 4 utility classes dropped/renamed by the Bootstrap 5 rebuild */
.text-danger { color: var(--bs-red) !important; }
.text-dark { color: var(--bs-gray-dark) !important; }
.text-light { color: var(--bs-gray-100) !important; }
.text-right { text-align: right !important; }
.float-right { float: right !important; }
.border-right { border-right: 1px solid var(--bs-border-color) !important; }
.bg-dark { background-color: var(--bs-gray-dark) !important; }
.bg-light { background-color: var(--bs-gray-100) !important; }

.font-weight-bold { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-light { font-weight: 300 !important; }

.badge-secondary {
  color: #000;
  background-color: var(--bs-secondary);
}
.badge-outline-danger {
  color: var(--bs-red);
  background-color: transparent;
  border: 1px solid var(--bs-red);
}
.badge-outline-success {
  color: var(--bs-green);
  background-color: transparent;
  border: 1px solid var(--bs-green);
}

/* Bootstrap 4 custom form controls (Bootstrap 5 replaced these with .form-check-*) */
.custom-control {
  position: relative;
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5rem;
}
.custom-control-input {
  position: absolute;
  left: 0;
  z-index: -1;
  width: 1rem;
  height: 1.25rem;
  opacity: 0;
}
.custom-control-label {
  margin-bottom: 0;
}
.custom-control-label::before {
  position: absolute;
  top: 0.25rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  content: "";
  background-color: #fff;
  border: 1px solid var(--bs-border-color, #adb5bd);
}
.custom-checkbox .custom-control-label::before {
  border-radius: 0.25rem;
}
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* Bootstrap 4's modal close "x" button (Bootstrap 5 renamed to .btn-close) */
.close {
  padding: 0;
  background-color: transparent;
  border: 0;
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  cursor: pointer;
}
.close:hover {
  opacity: 0.75;
}

/* Bootstrap 4 search-form layout helpers (removed in Bootstrap 5) */
.form-inline {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
}
.form-row > .col,
.form-row > [class*='col-'] {
  padding-right: 5px;
  padding-left: 5px;
}
.input-group-append {
  display: flex;
  margin-left: -1px;
}

.bmb-hero {
  color: black;
  background-color: #eee;
  /* background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    url(https://sites.manchester.ac.uk/bmbase/wp-content/uploads/sites/223/2020/01/membrane-montage.jpg); */
  background-size: cover;
  background-position: center;
}

.bmb-hero .bmb-hero-hidden {
  display: none !important;
}

.bmb-text-title {
  opacity: 0.67;
}

.bmb-navbar {
  font-size: 1.25rem;
  font-weight: lighter;
  padding: 5px 0;
}

.bmb-navbar .nav-link {
  font-weight: 400;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.bmb-help-icon {
  display: inline-block;
  font-size: 0.5rem;
  background-color: rgba(127,127,127, 0.5);
  width: 1rem;
  padding: 0.125rem 0.33rem;
  border-radius: 50%;
  vertical-align: text-top;
  cursor: help;
}

.bmb-help-icon:hover {
  background-color: rgba(127,127,127, 0.75);
}

.bmb-break-word {
  overflow-wrap: break-word;
}

.bmb-table-head tr th {
  vertical-align: top;
}

.bmb-checkbox-multiselect {
  height: 10rem;
  overflow-y: scroll;
  padding: 0.25rem 0;
}

.bmb-checkbox-multiselect__actions {
  padding: 0 1rem;
  padding-bottom: 0.25rem;
}

.bmb-checkbox-multiselect__option {
  padding: 0 1rem;
  user-select: none;
}

.bmb-checkbox-multiselect__option:hover {
  background-color: #f2f2f2;
}

/* Resets font size. */
.bmb-text-normal {
  font-size: 1rem;
}

/* Properly align OpenIconic icons in badges. */
.badge .oi {
  vertical-align: text-top;
}

/* Missing (empty) value indicator */
.bmb-missing::before {
  content: '---';
  color: #888;
}

/* Makes the badge a little taller so that it can contain other badges in it */
.bmb-badge-lg {
  padding: 0.5rem 1rem;
}

.bmb-badge-lg.bmb-bordered {
  border-radius: 160px;
  border: 1px solid var(--primary);
}

/* The .badges in a .bmb-badge-group stick together similarly
 * to how .btns do with .btn-group */
.bmb-badge-group {
  display: inline-block;
  padding: 0;
}

.bmb-badge-group.bmb-bordered {
  border-radius: 160px;
  border: 1px solid var(--primary);
}

.bmb-badge-group > .badge {
  padding: 0.25rem 0.5rem;
}

.bmb-badge-group > .bmb-badge-lg {
  padding: 0.5rem 1rem;
}

.bmb-badge-group > .badge:not(:first-child):not(:last-child):not(:only-child) {
  border-radius: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.bmb-badge-group > .bmb-badge-lg:not(:first-child):not(:last-child):not(:only-child) {
  border-radius: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.bmb-badge-group > .badge:first-child:not(:only-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.25rem;
}

.bmb-badge-group > .bmb-badge-lg:first-child:not(:only-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.5rem;
}

.bmb-badge-group > .badge:last-child:not(:only-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 0.25rem;
}

.bmb-badge-group > .bmb-badge-lg:last-child:not(:only-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 0.5rem;
}

/* Puts emphasis on blocks with explainations. */
.bmb-info-block {
  border-left: 2px solid #609;
}

/* Table used on gene details view */
.bmb-kvp__row {
  padding: 0.5rem 0;
}

.bmb-kvp__row__head {
  font-weight: bold;
}

/* .bmb-kvp-hover conditionally highlights rows */
.bmb-kvp-hover .bmb-kvp__row:hover {
  background-color: rgba(0,0,0,.05);
}

/* Thumbnails */
.bmb-thumbnail {
  cursor: pointer;
  display: inline-block;
}

.bmb-thumbnail__image {
  height: 128px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  transition: 0.2s all ease-in-out;
}

.bmb-thumbnail:hover .bmb-thumbnail__image {
  opacity: 0.75;
}

/* Network diagrams: show full detail uncropped, not a cover-cropped photo thumbnail */
.bmb-network-image {
  height: 450px;
  background-color: #fff;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 4px;
  transition: 0.2s all ease-in-out;
}

.bmb-thumbnail:hover .bmb-network-image {
  opacity: 0.85;
}

/* Legend key shown under Interaction Network Images */
.bmb-network-legend {
  column-gap: 1.25rem;
}

.bmb-network-legend__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.bmb-network-legend__line {
  display: inline-block;
  width: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Highlights text */
.bmb-highlight {
  background-color: #FFF9C4;
}

.bmb-divider {
  height: 1px;
  background-color: #CCC;
}

.bmb-anchor {
  opacity: 0.33;
}

.bmb-anchor:hover {
  opacity: 1;
}

.bmb-sortable-column {
  display: flex;
  justify-content: space-between;
}

.bmb-sortable-column .bmb-order-by {
  margin-left: 0.25rem;
}

.bmb-limited-height-container {
  max-height: 250px;
  overflow-y: auto;
}

.bmb-limited-height-container > * {
  box-shadow: 0 0 8px rgba(0,0,0,.2) inset;
}

.pagination .page-item:not(:nth-of-type(1)):not(:nth-last-of-type(1)):not(:nth-of-type(2)):not(:nth-last-of-type(2)):not(.active) .page-link {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
