/*
 * bs4-compat.css
 * Keeps Journey looking the way it did on Bootstrap 4.3 after the move to Bootstrap 5.3.
 * Loaded after bootstrap / blazorise and before site.css. Each rule notes the BS4 behaviour it restores.
 */

/* BS5 underlines all links by default; BS4 only underlined on hover. */
a {
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

    a.btn:hover, a.nav-link:hover, a.dropdown-item:hover, a.badge:hover, a.card-link:hover {
        text-decoration: none;
    }

/* BS4 reboot gave labels inline-block + a bottom margin; BS5 removed both. */
label {
    display: inline-block;
    margin-bottom: .5rem;
}

/* BS4 <small> was 80%; BS5 is .875em which makes small print wrap differently. */
small, .small {
    font-size: 80%;
}

/* BS4 used a 30px grid gutter (BS5: 1.5rem / 24px). */
.row, .container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
    --bs-gutter-x: 30px;
}

/* BS4 table cells used .75rem padding and a top border (BS5: .5rem, bottom border). */
.table > :not(caption) > * > * {
    padding: .75rem;
}

.table-sm > :not(caption) > * > * {
    padding: .3rem;
}

/* BS4 badges: 75% font size and tighter padding. */
.badge {
    font-size: 75%;
    padding: .25em .4em;
}

    .badge.rounded-pill {
        padding-right: .6em;
        padding-left: .6em;
    }

/* BS4 card subtitle sat closer to the title. */
.card-subtitle {
    margin-top: -.375rem;
}

/* BS4 <hr> was a solid 10% black line; BS5 uses currentColor at 25% opacity. */
hr {
    opacity: 1;
    border-top: 1px solid rgba(0, 0, 0, .1);
    color: inherit;
}

/* BS5 paints every table cell with --bs-table-bg (white), hiding row background colours set on <tr>. BS4 tables were transparent. */
.table {
    --bs-table-bg: transparent;
}

/* Blazorise 0.9 tooltips wrapped their content in an inline-block, position:relative element (badges were positioned against it)
   and used a grey balloon. Blazorise 2.x renders a block-level .tooltip-host with a dark Bootstrap tooltip. */
.tooltip-host {
    position: relative;
    display: inline-block;
    --bs-tooltip-bg: rgb(128, 128, 128);
    --bs-tooltip-color: #fff;
    --bs-tooltip-opacity: .9;
    --bs-tooltip-max-width: 15rem;
}

/* Blazorise 0.9 wrapped AddonType.Start content in .input-group-prepend, so an input placed there kept its natural width.
   BS5 has no prepend wrapper and the input would stretch across the whole input-group. */
.input-group > .form-control.bs4-prepend {
    flex: 0 1 auto;
    width: auto;
}

/* BS4 .btn-secondary painted its own colours; in BS5 it only sets variables that .btn consumes.
   A few "OR" separators use class="btn-secondary" on a plain <div>. */
.btn-secondary:not(.btn) {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* BS4 table borders: a 1px top border on every cell and a 2px bottom border under thead cells.
   BS5 draws a bottom border instead. .table-borderless in BS4 also used descendant selectors,
   so it removed borders from tables nested inside it. */
.table > :not(caption) > * > * {
    border-bottom-width: 0;
    border-top: 1px solid #dee2e6;
}

.table > thead > * > th, .table > thead > * > td {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.table-bordered > :not(caption) > * > * {
    border: 1px solid #dee2e6;
}

.table-borderless td, .table-borderless th, .table-borderless thead th {
    border: 0 !important;
}

/* BS4 component spacing (BS5 tightened these). */
.card {
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    --bs-card-title-spacer-y: .75rem;
    --bs-card-cap-padding-y: .75rem;
    --bs-card-cap-padding-x: 1.25rem;
}

.alert {
    --bs-alert-padding-x: 1.25rem;
    --bs-alert-padding-y: .75rem;
}

.list-group {
    --bs-list-group-item-padding-x: 1.25rem;
    --bs-list-group-item-padding-y: .75rem;
}

.dropdown-menu {
    --bs-dropdown-item-padding-x: 1.5rem;
}

/* BS5 forces every direct child of .row to width:100% with gutter padding. In BS4 only .col* elements
   were sized; anything else in a row (plain divs, buttons, h-tags) kept its natural width. */
.row > :where(:not(.col):not([class*="col-"])) {
    flex-shrink: 1;
    width: auto;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

/* BS4 custom-control / form-check labels had no bottom margin and the wrapper no bottom margin. */
.form-check {
    margin-bottom: 0;
}

.form-check-label {
    margin-bottom: 0;
}

/* BS5 shrinks h1-h4 on small screens (responsive font sizing); BS4 used fixed sizes. */
h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }

/* Blazorise 2.x FileInput renders its own nested .input-group.form-file. Inside an Addons group it must
   stretch like BS4's .custom-file did instead of wrapping onto its own line. */
.input-group > .input-group.form-file,
.input-group > .tooltip-host:has(> .form-file) {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

    .input-group > .tooltip-host:has(> .form-file) > .form-file {
        width: 100%;
    }

/* Blazored.Modal 7 renamed its elements (.blazored-modal-header -> .bm-header, .blazored-modal-content -> .bm-content)
   and ships scoped CSS with 1.5rem padding. Re-apply Journey's v6 modal styling to the new names. */
.bm-container .blazored-modal {
    padding: 1rem !important;
}

.bm-container .bm-header {
    padding: 0 0 .75rem 0 !important;
}

.bm-container .bm-content {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* BS4 greyed out read-only inputs; BS5 leaves them white. */
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* BS4 grid columns were always position:relative with 15px side padding, even outside a .row.
   BS5 only pads them as children of .row and drops the relative positioning. */
.col, [class^="col-"]:not(.col-form-label), [class*=" col-"]:not(.col-form-label) {
    position: relative;
}

:not(.row):not(.card-deck) > .col, :not(.row):not(.card-deck) > [class^="col-"]:not(.col-form-label), :not(.row):not(.card-deck) > [class*=" col-"]:not(.col-form-label) {
    padding-right: 15px;
    padding-left: 15px;
}

/* Blazorise 2.x card-deck emulation uses .75rem gutters; BS4 card decks used 15px. */
@media (min-width: 576px) {
    .card-deck {
        margin-right: -15px;
        margin-left: -15px;
    }

        .card-deck .card {
            margin-right: 15px;
            margin-left: 15px;
        }
}

/* BS4 modal footers kept their buttons on one line (no wrapping). BS5 wraps them, so two 50%-wide
   buttons plus their margins dropped onto separate lines. */
.modal-footer {
    flex-wrap: nowrap;
}

/* BS4 custom checkboxes were drawn right next to their label, so a checkbox in a centred block sat beside
   its centred text. BS5's .form-check pins the box to the left edge of the full-width block. */
.text-center .form-check,
.text-end .form-check {
    display: inline-block;
}

/* ---------------------------------------------------------------------------------------------------------
 * Bootstrap 4 utility class names that Bootstrap 5 renamed. The app's own markup uses the BS5 names, but HTML
 * stored in the database (event footers, VPages, descriptions, custom text) was written for BS4, e.g. an event
 * footer's <p class="pl-2 pr-2">. Without these, that content loses its padding / alignment.
 * --------------------------------------------------------------------------------------------------------- */
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }
.pl-1 { padding-left: .25rem !important; }
.pr-1 { padding-right: .25rem !important; }
.ml-1 { margin-left: .25rem !important; }
.mr-1 { margin-right: .25rem !important; }
.pl-2 { padding-left: .5rem !important; }
.pr-2 { padding-right: .5rem !important; }
.ml-2 { margin-left: .5rem !important; }
.mr-2 { margin-right: .5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pr-3 { padding-right: 1rem !important; }
.ml-3 { margin-left: 1rem !important; }
.mr-3 { margin-right: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }
.pr-5 { padding-right: 3rem !important; }
.ml-5 { margin-left: 3rem !important; }
.mr-5 { margin-right: 3rem !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.ml-n1 { margin-left: -.25rem !important; }
.mr-n1 { margin-right: -.25rem !important; }
.ml-n2 { margin-left: -.5rem !important; }
.mr-n2 { margin-right: -.5rem !important; }
.ml-n3 { margin-left: -1rem !important; }
.mr-n3 { margin-right: -1rem !important; }
.ml-n4 { margin-left: -1.5rem !important; }
.mr-n4 { margin-right: -1.5rem !important; }
.ml-n5 { margin-left: -3rem !important; }
.mr-n5 { margin-right: -3rem !important; }
.float-left { float: left !important; }
.float-right { float: right !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
@media (min-width: 576px) {
    .pl-sm-0 { padding-left: 0 !important; }
    .pr-sm-0 { padding-right: 0 !important; }
    .ml-sm-0 { margin-left: 0 !important; }
    .mr-sm-0 { margin-right: 0 !important; }
    .pl-sm-1 { padding-left: .25rem !important; }
    .pr-sm-1 { padding-right: .25rem !important; }
    .ml-sm-1 { margin-left: .25rem !important; }
    .mr-sm-1 { margin-right: .25rem !important; }
    .pl-sm-2 { padding-left: .5rem !important; }
    .pr-sm-2 { padding-right: .5rem !important; }
    .ml-sm-2 { margin-left: .5rem !important; }
    .mr-sm-2 { margin-right: .5rem !important; }
    .pl-sm-3 { padding-left: 1rem !important; }
    .pr-sm-3 { padding-right: 1rem !important; }
    .ml-sm-3 { margin-left: 1rem !important; }
    .mr-sm-3 { margin-right: 1rem !important; }
    .pl-sm-4 { padding-left: 1.5rem !important; }
    .pr-sm-4 { padding-right: 1.5rem !important; }
    .ml-sm-4 { margin-left: 1.5rem !important; }
    .mr-sm-4 { margin-right: 1.5rem !important; }
    .pl-sm-5 { padding-left: 3rem !important; }
    .pr-sm-5 { padding-right: 3rem !important; }
    .ml-sm-5 { margin-left: 3rem !important; }
    .mr-sm-5 { margin-right: 3rem !important; }
    .ml-sm-auto { margin-left: auto !important; }
    .mr-sm-auto { margin-right: auto !important; }
    .ml-sm-n1 { margin-left: -.25rem !important; }
    .mr-sm-n1 { margin-right: -.25rem !important; }
    .ml-sm-n2 { margin-left: -.5rem !important; }
    .mr-sm-n2 { margin-right: -.5rem !important; }
    .ml-sm-n3 { margin-left: -1rem !important; }
    .mr-sm-n3 { margin-right: -1rem !important; }
    .ml-sm-n4 { margin-left: -1.5rem !important; }
    .mr-sm-n4 { margin-right: -1.5rem !important; }
    .ml-sm-n5 { margin-left: -3rem !important; }
    .mr-sm-n5 { margin-right: -3rem !important; }
    .float-sm-left { float: left !important; }
    .float-sm-right { float: right !important; }
    .text-sm-left { text-align: left !important; }
    .text-sm-right { text-align: right !important; }
}
@media (min-width: 768px) {
    .pl-md-0 { padding-left: 0 !important; }
    .pr-md-0 { padding-right: 0 !important; }
    .ml-md-0 { margin-left: 0 !important; }
    .mr-md-0 { margin-right: 0 !important; }
    .pl-md-1 { padding-left: .25rem !important; }
    .pr-md-1 { padding-right: .25rem !important; }
    .ml-md-1 { margin-left: .25rem !important; }
    .mr-md-1 { margin-right: .25rem !important; }
    .pl-md-2 { padding-left: .5rem !important; }
    .pr-md-2 { padding-right: .5rem !important; }
    .ml-md-2 { margin-left: .5rem !important; }
    .mr-md-2 { margin-right: .5rem !important; }
    .pl-md-3 { padding-left: 1rem !important; }
    .pr-md-3 { padding-right: 1rem !important; }
    .ml-md-3 { margin-left: 1rem !important; }
    .mr-md-3 { margin-right: 1rem !important; }
    .pl-md-4 { padding-left: 1.5rem !important; }
    .pr-md-4 { padding-right: 1.5rem !important; }
    .ml-md-4 { margin-left: 1.5rem !important; }
    .mr-md-4 { margin-right: 1.5rem !important; }
    .pl-md-5 { padding-left: 3rem !important; }
    .pr-md-5 { padding-right: 3rem !important; }
    .ml-md-5 { margin-left: 3rem !important; }
    .mr-md-5 { margin-right: 3rem !important; }
    .ml-md-auto { margin-left: auto !important; }
    .mr-md-auto { margin-right: auto !important; }
    .ml-md-n1 { margin-left: -.25rem !important; }
    .mr-md-n1 { margin-right: -.25rem !important; }
    .ml-md-n2 { margin-left: -.5rem !important; }
    .mr-md-n2 { margin-right: -.5rem !important; }
    .ml-md-n3 { margin-left: -1rem !important; }
    .mr-md-n3 { margin-right: -1rem !important; }
    .ml-md-n4 { margin-left: -1.5rem !important; }
    .mr-md-n4 { margin-right: -1.5rem !important; }
    .ml-md-n5 { margin-left: -3rem !important; }
    .mr-md-n5 { margin-right: -3rem !important; }
    .float-md-left { float: left !important; }
    .float-md-right { float: right !important; }
    .text-md-left { text-align: left !important; }
    .text-md-right { text-align: right !important; }
}
@media (min-width: 992px) {
    .pl-lg-0 { padding-left: 0 !important; }
    .pr-lg-0 { padding-right: 0 !important; }
    .ml-lg-0 { margin-left: 0 !important; }
    .mr-lg-0 { margin-right: 0 !important; }
    .pl-lg-1 { padding-left: .25rem !important; }
    .pr-lg-1 { padding-right: .25rem !important; }
    .ml-lg-1 { margin-left: .25rem !important; }
    .mr-lg-1 { margin-right: .25rem !important; }
    .pl-lg-2 { padding-left: .5rem !important; }
    .pr-lg-2 { padding-right: .5rem !important; }
    .ml-lg-2 { margin-left: .5rem !important; }
    .mr-lg-2 { margin-right: .5rem !important; }
    .pl-lg-3 { padding-left: 1rem !important; }
    .pr-lg-3 { padding-right: 1rem !important; }
    .ml-lg-3 { margin-left: 1rem !important; }
    .mr-lg-3 { margin-right: 1rem !important; }
    .pl-lg-4 { padding-left: 1.5rem !important; }
    .pr-lg-4 { padding-right: 1.5rem !important; }
    .ml-lg-4 { margin-left: 1.5rem !important; }
    .mr-lg-4 { margin-right: 1.5rem !important; }
    .pl-lg-5 { padding-left: 3rem !important; }
    .pr-lg-5 { padding-right: 3rem !important; }
    .ml-lg-5 { margin-left: 3rem !important; }
    .mr-lg-5 { margin-right: 3rem !important; }
    .ml-lg-auto { margin-left: auto !important; }
    .mr-lg-auto { margin-right: auto !important; }
    .ml-lg-n1 { margin-left: -.25rem !important; }
    .mr-lg-n1 { margin-right: -.25rem !important; }
    .ml-lg-n2 { margin-left: -.5rem !important; }
    .mr-lg-n2 { margin-right: -.5rem !important; }
    .ml-lg-n3 { margin-left: -1rem !important; }
    .mr-lg-n3 { margin-right: -1rem !important; }
    .ml-lg-n4 { margin-left: -1.5rem !important; }
    .mr-lg-n4 { margin-right: -1.5rem !important; }
    .ml-lg-n5 { margin-left: -3rem !important; }
    .mr-lg-n5 { margin-right: -3rem !important; }
    .float-lg-left { float: left !important; }
    .float-lg-right { float: right !important; }
    .text-lg-left { text-align: left !important; }
    .text-lg-right { text-align: right !important; }
}
@media (min-width: 1200px) {
    .pl-xl-0 { padding-left: 0 !important; }
    .pr-xl-0 { padding-right: 0 !important; }
    .ml-xl-0 { margin-left: 0 !important; }
    .mr-xl-0 { margin-right: 0 !important; }
    .pl-xl-1 { padding-left: .25rem !important; }
    .pr-xl-1 { padding-right: .25rem !important; }
    .ml-xl-1 { margin-left: .25rem !important; }
    .mr-xl-1 { margin-right: .25rem !important; }
    .pl-xl-2 { padding-left: .5rem !important; }
    .pr-xl-2 { padding-right: .5rem !important; }
    .ml-xl-2 { margin-left: .5rem !important; }
    .mr-xl-2 { margin-right: .5rem !important; }
    .pl-xl-3 { padding-left: 1rem !important; }
    .pr-xl-3 { padding-right: 1rem !important; }
    .ml-xl-3 { margin-left: 1rem !important; }
    .mr-xl-3 { margin-right: 1rem !important; }
    .pl-xl-4 { padding-left: 1.5rem !important; }
    .pr-xl-4 { padding-right: 1.5rem !important; }
    .ml-xl-4 { margin-left: 1.5rem !important; }
    .mr-xl-4 { margin-right: 1.5rem !important; }
    .pl-xl-5 { padding-left: 3rem !important; }
    .pr-xl-5 { padding-right: 3rem !important; }
    .ml-xl-5 { margin-left: 3rem !important; }
    .mr-xl-5 { margin-right: 3rem !important; }
    .ml-xl-auto { margin-left: auto !important; }
    .mr-xl-auto { margin-right: auto !important; }
    .ml-xl-n1 { margin-left: -.25rem !important; }
    .mr-xl-n1 { margin-right: -.25rem !important; }
    .ml-xl-n2 { margin-left: -.5rem !important; }
    .mr-xl-n2 { margin-right: -.5rem !important; }
    .ml-xl-n3 { margin-left: -1rem !important; }
    .mr-xl-n3 { margin-right: -1rem !important; }
    .ml-xl-n4 { margin-left: -1.5rem !important; }
    .mr-xl-n4 { margin-right: -1.5rem !important; }
    .ml-xl-n5 { margin-left: -3rem !important; }
    .mr-xl-n5 { margin-right: -3rem !important; }
    .float-xl-left { float: left !important; }
    .float-xl-right { float: right !important; }
    .text-xl-left { text-align: left !important; }
    .text-xl-right { text-align: right !important; }
}
.font-weight-bold { font-weight: 700 !important; }
.font-weight-bolder { font-weight: bolder !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-light { font-weight: 300 !important; }
.font-weight-lighter { font-weight: lighter !important; }
.font-italic { font-style: italic !important; }
.border-left { border-left: 1px solid #dee2e6 !important; }
.border-right { border-right: 1px solid #dee2e6 !important; }
.border-left-0 { border-left: 0 !important; }
.border-right-0 { border-right: 0 !important; }
.rounded-left { border-top-left-radius: .25rem !important; border-bottom-left-radius: .25rem !important; }
.rounded-right { border-top-right-radius: .25rem !important; border-bottom-right-radius: .25rem !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.no-gutters { margin-right: 0; margin-left: 0; }
.no-gutters > .col, .no-gutters > [class*="col-"] { padding-right: 0; padding-left: 0; }
.form-group { margin-bottom: 1rem; }
.badge-primary { color: #fff; background-color: #007bff; }
.badge-secondary { color: #fff; background-color: #6c757d; }
.badge-success { color: #fff; background-color: #28a745; }
.badge-danger { color: #fff; background-color: #dc3545; }
.badge-warning { color: #212529; background-color: #ffc107; }
.badge-info { color: #fff; background-color: #17a2b8; }
.badge-light { color: #212529; background-color: #f8f9fa; }
.badge-dark { color: #fff; background-color: #343a40; }
.badge-pill { border-radius: 10rem; }
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: .5rem; }
.embed-responsive { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; }
.embed-responsive::before { display: block; content: ""; }
.embed-responsive-21by9::before { padding-top: 42.857143%; }
.embed-responsive-16by9::before { padding-top: 56.25%; }
.embed-responsive-4by3::before { padding-top: 75%; }
.embed-responsive-1by1::before { padding-top: 100%; }
.embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; }
.jumbotron { padding: 4rem 2rem; margin-bottom: 2rem; background-color: #e9ecef; border-radius: .3rem; }

/* Activity Reports chart rows (Shared/Reports.razor). Blazorise 2 wraps each card of a CardDeck in a <div class="col">,
   so the card's own min-width: 400px no longer sets the column's minimum. The column's minimum then becomes its widest
   content: the chart canvas, whose pixel width Chart.js fixes when it draws. Once a chart had been drawn wider than half
   the row (window widened, zoom, a sidebar closing), the columns could not shrink back and the charts stayed stacked one
   above the other. A fixed minimum keeps BS4's behaviour: side by side, and stacked only when the row is narrower than
   two 400px charts. */
.chart-deck > .col {
    min-width: 400px;
}

.chart-deck canvas {
    max-width: 100%;
}

/* Card rows (CardDeck). Blazorise 2 puts each card in a <div class="col"> and gives it height: 100%, so a card's own
   bottom margin (e.g. the Hub's "mb-2" cards) hung outside its column and the next row sat right against it. In BS4 the
   cards were the row's flex items: equal heights, with their margins kept. Make the column a flex column and let the
   card grow inside it: same equal heights, margins respected. */
.card-deck > .col {
    display: flex;
    flex-direction: column;
}

    .card-deck > .col > .card {
        height: auto;
        flex: 1 1 auto;
    }
