////
/// Alignment classes.
///
/// Primarily, we use this to build out style rules for the core WordPress
/// `.align*` classes.
///
/// @group  Utilities
/// @author Sky Shabatura <theme@sky.camp>
/// @link   https://taproot-theme.com
////

// Block level alignment
.align {
    @media (min-width: 480px) {
        &left,
        &right {
            max-width: 50%;
            margin-top: 0;
        }
        &left {
            float: left;
            margin-right: var(--text-spacing);
        }
        &right {
            float: right;
            margin-left: var(--text-spacing);
        }
    }

    &center {
        margin-left: auto;
        margin-right: auto;
        clear: both;
    }
}

// Text alignment classes
.has-text-align {
    &-left {
        text-align: left;
    }
    &-right {
        text-align: right;
    }
    &-center {
        text-align: center;
    }
}

// Flex container alignment classes
.has-flex-align {
    &-left {
        justify-content: flex-start;
    }
    &-right {
        justify-content: flex-end;
    }
    &-center {
        justify-content: center;
    }
}

// Flex item alignment classes
.align-self {
    &--left {
        align-self: flex-start;
    }
    &--right {
        align-self: flex-end;
    }
    &--center {
        align-self: center;
    }
}

// Grid item alignment
.is-vertically-aligned {
    &-top {
        align-items: start;
    }

    &-center {
        align-items: center;
    }

    &-bottom {
        align-items: end;
    }
}
