@import "../variables";
@import "../mixins";

.ValuePair {
    display: block;

    & + & {
        margin-top: $offset_main * 2;
    }

    &-horizontal {
        display: flex;
        flex-direction: row;
    }

    &-line-view {
        display: table;
    }
}

.ValuePair-horizontal {
    & + & {
        margin-top: $offset_main;
    }
}

/* stylelint-disable max-nesting-depth, no-descending-specificity */

.ValuePair-item {
    display: block;

    & + & {
        margin-top: $offset_main;

        .ValuePair-horizontal & {
            margin-left: $offset_main * 2;
            margin-top: 0;
        }

        .ValuePair-line-view & {
            margin-top: 0;
        }
    }

    .ValuePair-line-view & {
        display: table-row;
    }

    &-date {
        width: $datepicker-width;
    }
}

.ValuePair-label,
.ValuePair-value {
    .ValuePair-line-view & {
        display: table-cell;
        vertical-align: baseline;
    }

    .ValuePair-item + .ValuePair-item & {
        .ValuePair-line-view & {
            padding-top: $offset_main;
        }
    }
}

.ValuePair-label {
    @include label;

    display: block;
    font-size: $_font_size_label_medium;
    font-weight: $weight_bold;
    line-height: $line_height_default;

    &-for-list {
        margin-bottom: $offset_main;
    }

    &-one-line {
        white-space: nowrap;
    }

    .ValuePair-line-view &-top {
        vertical-align: top;
    }

    .ValuePair-line-view & {
        line-height: $line_height_control;
        padding-right: $offset_main * 2;
    }
}

.ValuePair-value {
    @include inline-middle;

    display: block;
    line-height: $line_height_control;
    margin-top: 2px;

    .ValuePair-line-view & {
        margin-top: 0;
    }
}

.ValuePair-values-list {
    list-style-type: none;
    margin: $offset_main 0;
    padding: 0;

    .ValuePair-line-view & {
        margin-bottom: 0;
        margin-top: 0;
    }
}

.ValuePair-values-item {
    & + & {
        margin-top: $offset_main;
    }
}

/* stylelint-enable max-nesting-depth, no-descending-specificity */
