// Bootstrap 4 compatibility for bootstrapbased themes.
// Disable some stylelint rules which are necessary these compatbility classses.
/* stylelint-disable declaration-no-important, block-no-empty */

// Add support for card. We map it to well.
// This is not meant to be perfect - but at least applies some styles to a bs4 card.
.card:extend(.well) {
}

// Due to lessphp limitations, the following classes must be declared statically without use of a loop.
.p-l-1 {
    padding-left: 1 * @font-size-base !important;
}
.p-r-1 {
    padding-right: 1 * @font-size-base !important;
}
.p-t-1 {
    padding-top: 1 * @font-size-base !important;
}
.p-b-1 {
    padding-bottom: 1 * @font-size-base !important;
}
.p-x-1 {
    padding-left: 1 * @font-size-base !important;
    padding-right: 1 * @font-size-base !important;
}
.p-y-1 {
    padding-top: 1 * @font-size-base !important;
    padding-bottom: 1 * @font-size-base !important;
}
.p-a-1 {
    padding: 1 * @font-size-base !important;
}

.m-l-1 {
    margin-left: 1 * @font-size-base !important;
}
.m-r-1 {
    margin-right: 1 * @font-size-base !important;
}
.m-t-1 {
    margin-top: 1 * @font-size-base !important;
}
.m-b-1 {
    margin-bottom: 1 * @font-size-base !important;
}
.m-x-1 {
    margin-left: 1 * @font-size-base !important;
    margin-right: 1 * @font-size-base !important;
}
.m-y-1 {
    margin-top: 1 * @font-size-base !important;
    margin-bottom: 1 * @font-size-base !important;
}
.m-a-1 {
    margin: 1 * @font-size-base !important;
}

.p-l-2 {
    padding-left: 2 * @font-size-base !important;
}
.p-r-2 {
    padding-right: 2 * @font-size-base !important;
}
.p-t-2 {
    padding-top: 2 * @font-size-base !important;
}
.p-b-2 {
    padding-bottom: 2 * @font-size-base !important;
}
.p-x-2 {
    padding-left: 2 * @font-size-base !important;
    padding-right: 2 * @font-size-base !important;
}
.p-y-2 {
    padding-top: 2 * @font-size-base !important;
    padding-bottom: 2 * @font-size-base !important;
}
.p-a-2 {
    padding: 2 * @font-size-base !important;
}

.m-l-2 {
    margin-left: 2 * @font-size-base !important;
}
.m-r-2 {
    margin-right: 2 * @font-size-base !important;
}
.m-t-2 {
    margin-top: 2 * @font-size-base !important;
}
.m-b-2 {
    margin-bottom: 2 * @font-size-base !important;
}
.m-x-2 {
    margin-left: 2 * @font-size-base !important;
    margin-right: 2 * @font-size-base !important;
}
.m-y-2 {
    margin-top: 2 * @font-size-base !important;
    margin-bottom: 2 * @font-size-base !important;
}
.m-a-2 {
    margin: 2 * @font-size-base !important;
}

.p-l-3 {
    padding-left: 3 * @font-size-base !important;
}
.p-r-3 {
    padding-right: 3 * @font-size-base !important;
}
.p-t-3 {
    padding-top: 3 * @font-size-base !important;
}
.p-b-3 {
    padding-bottom: 3 * @font-size-base !important;
}
.p-x-3 {
    padding-left: 3 * @font-size-base !important;
    padding-right: 3 * @font-size-base !important;
}
.p-y-3 {
    padding-top: 3 * @font-size-base !important;
    padding-bottom: 3 * @font-size-base !important;
}
.p-a-3 {
    padding: 3 * @font-size-base !important;
}

.m-l-3 {
    margin-left: 3 * @font-size-base !important;
}
.m-r-3 {
    margin-right: 3 * @font-size-base !important;
}
.m-t-3 {
    margin-top: 3 * @font-size-base !important;
}
.m-b-3 {
    margin-bottom: 3 * @font-size-base !important;
}
.m-x-3 {
    margin-left: 3 * @font-size-base !important;
    margin-right: 3 * @font-size-base !important;
}
.m-y-3 {
    margin-top: 3 * @font-size-base !important;
    margin-bottom: 3 * @font-size-base !important;
}
.m-a-3 {
    margin: 3 * @font-size-base !important;
}

.d-inline {
    display: inline !important;
}
.d-block {
    display: block !important;
}
.d-inline-block {
    display: inline-block !important;
}

// Horizontal centering.
.m-x-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

// Support img-fluid.
.img-fluid:extend(.img-responsive) {
}

// Text danger
.text-danger:extend(.text-error) {
}

.btn-secondary {
    background-color: @white;
    background-image: none;
    color: @black;
}

// Tags
.tag:extend(.label) {
    // Important (red)
    &-danger {
        background-color: @brand-danger;
    }
    &-danger[href] {
        background-color: darken(@brand-danger, 10%);
    }
    // Warnings (orange)
    &-warning {
        background-color: @brand-warning;
    }
    &-warning[href] {
        background-color: darken(@brand-warning, 10%);
    }
    // Success (green)
    &-success {
        background-color: @brand-success;
    }
    &-success[href] {
        background-color: darken(@brand-success, 10%);
    }
    // Info (turquoise)
    &-info {
        background-color: @brand-info;
    }
    &-info[href] {
        background-color: darken(@brand-info, 10%);
    }
    // Primary (blue)
    &-primary {
        background-color: @brand-primary;
    }
    &-primary[href] {
        background-color: darken(@brand-primary, 10%);
    }
}

// Floats
.pull-xs-left:extend(.pull-left) {
}

.pull-xs-right:extend(.pull-right) {
}

.text-nowrap {
    white-space: nowrap !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden-xs-up {
    @media (min-width: @screen-xs) {
      display: none !important;
    }
}
.hidden-sm-up {
    @media (min-width: @screen-sm) {
      display: none !important;
    }
}
.hidden-md-up {
    @media (min-width: @screen-md) {
      display: none !important;
    }
}


.hidden-xs-down {
    @media (max-width: @screen-xs-max) {
      display: none !important;
    }
}
.hidden-sm-down {
    @media (max-width: @screen-sm-max) {
      display: none !important;
    }
}
.hidden-md-down {
    @media (max-width: @screen-md-max) {
      display: none !important;
    }
}
