/* -------------------------------------------
   Titles
        - Default
        - Simple
        - Line
        - Underline
        - Icon
        - Link
        - Compatibility with Elementor
---------------------------------------------- */

.title-wrapper {
    display: flex;
    align-items: center;
    --alpha-title-size: 14px;

    .link {
        display: inline-flex;
        align-items: center;
        color: var(--alpha-change-color-dark-1);

        &:hover {
            color: var(--alpha-primary-color);
        }
    }

    >a {
        color: inherit;

        .title {
            transition: inherit
        }
    }

    .divider {
        margin: 0 1.5rem;
    }

    svg {
        width: var(--alpha-title-size);
        height: var(--alpha-title-size);
    }
}


.title-wrapper a>.title:hover {
    color: var(--alpha-primary-color);
}

.title {
    margin-bottom: 0;
    max-width: 100%;

    &::before,
    &::after {
        height: 2px;
        background: var(--alpha-change-border-color);
    }
}

.title-left .title {
    margin-#{$right}: auto;
    text-align: left;
}

.title-right .title {
    margin-#{$left}: auto;
    text-align: right;
}

.title-center .title {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.rtl .title-left .u-icon-long-arrow-right:before {
    content: "\e99d";
}

.link-left {
    .title {
        margin-left: 0;
        margin-right: 0;
    }

    &.title-left {
        justify-content: if-ltr(flex-start, flex-end);
        text-align: left;
    }

    &.title-center {
        justify-content: center;
    }

    &.title-right {
        justify-content: if-ltr(flex-end, flex-start);
        text-align: right;
    }
}

// Title Cross
.title-cross {
    .title {
        display: flex;
        position: relative;
        align-items: center;
        flex: 1;

        &::before {
            margin-#{$right}: 3rem;
        }

        &::after {
            margin-#{$left}: 3rem;
        }

        &::before,
        &::after {
            flex: 1;
            content: '';
            z-index: 1;
        }
    }

    &.title-left .title::before,
    &.title-right .title::after {
        content: none
    }

    @include mq(lg, max) {

        &.title-lg-left .title:before,
        &.title-lg-right .title:after,
        &.title-lg-center .title:before,
        &.title-lg-center .title:after {
            content: '';
        }
    }

    @include mq(md, max) {

        &.title-md-left .title:before,
        &.title-md-right .title:after,
        &.title-md-center .title:before,
        &.title-md-center .title:after {
            content: '';
        }
    }
}

// Underline

.title-underline {
    position: relative;
    text-align: $left;

    &:after {
        content: '';
        margin: 0;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
        height: 2px;
        background: var(--alpha-change-border-color-light, $border-color-light);
    }

    .title {
        display: inline-block;
        flex: 0 0 auto;
        position: relative;
        padding-bottom: 15px;
        z-index: 2;

        &::after {
            content: '';
            display: block;
            position: absolute;
            left: 0;
            width: 100%;
            bottom: 0;
            background: var(--alpha-primary-color);
        }
    }
}

.title-underline2 {
    &:after {
        content: none;
    }

    .title:after {
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }

    &.title-left .title:after {
        margin-#{$left}: 0;
    }

    &.title-right .title:after {
        margin-#{$right}: 0;
    }
}

@include mq(sm, max) {
    .title-wrapper {
        flex-wrap: wrap;
    }
}

// Compatibility with Elementor
.elementor-heading-title {
    line-height: var(--alpha-heading-line-height, var(--alpha-body-line-height));
}

p.elementor-heading-title {
    line-height: var(--alpha-body-line-height);
}

.elementor .elementor-widget-heading hr {
    margin: 1rem auto;
}

.elementor-widget-heading .elementor-heading-title a {
    &:hover {
        color: var(--alpha-primary-color);
    }
}