/*
 * Bootstrap 5 -> Bootstrap 4 compatibility layer.
 *
 * The theme (style.css) and App.css were written against Bootstrap 4. This file restores the
 * Bootstrap 4 defaults they rely on. It is loaded right after bootstrap.min.css and before
 * style.css, so theme rules still override it exactly as they overrode Bootstrap 4.
 */

:root {
  --bs-body-color: #353c4e;
  --bs-border-radius: 0.25rem;
  --bs-border-radius-sm: 0.2rem;
  --bs-border-radius-lg: 0.3rem;
}

/* Grid: Bootstrap 4 used 30px gutters and only padded/stretched column children of .row */
.container,
.container-fluid,
.row {
  --bs-gutter-x: 30px;
}

.row > :where(:not([class*="col-"]):not(.col)) {
  flex-shrink: 1;
  width: auto;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Bootstrap 4 padded .col-* even outside a .row */
.card.col-md-12 {
  padding-left: 15px;
  padding-right: 15px;
}

a {
  text-decoration: none;
}

label {
  margin-bottom: 0.5rem;
}

/* Line heights from Bootstrap 4.0.0-beta, which the app used before */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  line-height: 1.1;
}

.btn {
  --bs-btn-line-height: 1.25;
  white-space: nowrap;
}

.form-control {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.25;
}

/* Tables: transparent cells, 0.75rem padding, top borders and a 2px header border */
.table {
  --bs-table-color: currentColor;
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 0.75rem;
  border-bottom-width: 0;
  border-top: var(--bs-border-width) solid var(--bs-table-border-color);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--bs-table-border-color);
}

.pagination {
  --bs-pagination-font-size: inherit;
  --bs-pagination-padding-y: 0.5rem;
}

/* Forms: Bootstrap 4 input colors, and the native select arrow Bootstrap 5 hides on .form-control */
.form-control,
.form-select {
  color: #495057;
}

.form-control::placeholder {
  color: #868e96;
  opacity: 1;
}

select.form-control {
  -webkit-appearance: auto;
  appearance: auto;
}
