/* -------------------------------------------
   Titles
        - Default
        - Simple
        - Line
        - Underline
        - Icon
        - Link
        - Compatibility with Elementor
---------------------------------------------- */

.title-wrapper {
    display: flex;
    align-items: center;
    .link {
        display: inline-flex;
        align-items: center;
        color: var(--alpha-change-color-dark-1);
        &:hover {
            color: var(--alpha-primary-color);
        }
    }
    > a:hover .title {
        color: inherit
    }
    .divider {
        margin: 0 1.5rem;
    }

    svg {
        width: 14px;
        height: 14px;
    }
}
.title {
    margin-bottom: 0;
    max-width: 100%;

    &::before,
    &::after {
        height: 2px;
        background: var(--alpha-change-border-color);
    }
}
.title-left .title {
    margin-#{$right}: auto;
}
.title-right .title {
    margin-#{$left}: auto;
    text-align: right;
}
.title-center .title {
    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: '';
        }
    }
    &.title-left .title::before,
    &.title-right .title::after { content: none }
}

// 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);
    }
}