/////// COLUMNS
@mixin columns($number: 2, $width: 10em) {
    columns: $width $number;
}

/////// BREAK INSIDE (usato con columns)
@mixin break-inside($value) {
    // value: auto | avoid
    -webkit-column-break-inside: $value;
    page-break-inside: $value;
    break-inside: $value;
}

@mixin break-before($value) {
    // value: auto | avoid
    -webkit-column-break-before: $value;
    page-break-before: $value;
    break-before: $value;
}

/////// USER-SELECT
@mixin user-select($value) {
    -webkit-user-select: $value;
    -moz-user-select: $value;
    -ms-user-select: $value;
}

/////// ICONE
@mixin make-ita($code, $color: inherit) {
    display: inline-block;
    font-family: ita;
    content: $code;
    color: $color;
    @include antialias();
}

@mixin antialias() {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

// bootstrap container
@mixin make-container($gutter: $grid-gutter-width) {
    @include container-fixed($gutter);
    width: 100%;

    @media (min-width: $screen-sm-min) {
        max-width: $container-sm;
    }
    @media (min-width: $screen-md-min) {
        max-width: $container-md;
    }
    @media (min-width: $screen-lg-min) {
        max-width: $container-lg;
    }
}

// center vertical
@mixin align-vertical() {
    margin: 0;
    position: absolute;
    top: 50%;
    transform: translate(0, -50%);
}

@mixin align-center() {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%);
}

@mixin box-ellipsis($height, $rows: 5) {
    display: block; /* Fallback for non-webkit */
    display: -webkit-box;
    height: $height; /* Fallback for non-webkit */
    -webkit-line-clamp: $rows;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

@mixin ellipsis() {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

@mixin sr-only() {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@mixin sfumagiu($height: 44px, $bg: #fff) {
    overflow: hidden;
    position: relative;

    &:after {
        content: '';
        //pointer-events: none;
        position: absolute;
        width: 100%;
        height: $height;
        bottom: 0;
        left: 0;
        @include gradient-vertical(transparentize($bg, 0.5), $bg, 0, 70%);
    }
}

@mixin gradiente-opaco() {
    background: transparent; /* Old browsers */
    @include gradient-vertical(
        transparentize(#000, 1),
        transparentize(#000, 0.7)
    );
}
