@mixin overflow-ellipsis() {
    overflow: hidden;
    text-overflow: ellipsis;
}

@mixin typography-header() {
    :global(.hero-header), h1, h2, h3, h4, h5, h6 {
        margin: 0;
    }

    :global(.hero-header) {
        font-family: var(--font-promo);
        margin: 30px 0;
        font-size: 66px;
        line-height: 72px;
    }

    :global(.hero-header), :global(.promo-header) {
        color: var(--uui-text-brand);
        text-align: center;
    }

    :global(.promo-header), h1, h2, h3 {
        font-family: var(--font-primary);
    }

    h4, h5, h6 {
        font-family: var(--font-semibold);
    }

    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 0.5em;
        margin-top: 1.2em;
        line-height: 1.35em;
    }

    h1 {
        font-size: 42px;
    }

    h2 {
        font-size: 30px;
        letter-spacing: 0.1px;

        &:global(.promo-header) {
            letter-spacing: 2px;
        }
    }

    h3 {
        font-size: 24px;
    }

    h4 {
        font-size: 18px;
        letter-spacing: 0.1px;
    }

    h5 {
        font-size: 16px;
    }

    h6 {
        font-size: 14px;
    }
}

@mixin typography-inline() {
    b, strong {
        font-family: var(--font-semibold);
    }

    i, em {
        font-family: var(--font-italic);
    }

    a {
        display: inline-flex;
        align-items: center;
        color: var(--uui-primary-50);
        text-decoration: underline;

        &:visited {
            color: #5214CC; // TODO: need variables

            &:hover {
                color: #3F0F9E; // TODO: need variables
            }
        }

        &:hover {
            color: var(--uui-primary-60);
        }
    }

    code {
        padding: 0.125em 0.25em;
        color: var(--uui-text-primary);
        background-color: var(--uui-secondary-20);
        font-family: var(--font-mono);
        white-space: pre-wrap;
        word-wrap: normal;
    }
}

@mixin typography-block() {
    ol, ul {
        padding: 0;
    }

    li {
        margin-left: 1.25em;
        line-height: 1.5;
    }

    pre {
        padding: 1.25em;
        color: var(--uui-text-contrast);
        background-color: var(--uui-secondary-70);
        font-family: monospace;
        white-space: pre-wrap;
        word-wrap: normal;
    }

    img {
        max-width: 100%;
    }

    figure {
        margin: 0;

        figcaption {
            font-size: 0.9em;
            opacity: 0.9;
            text-align: center;
        }
    }

    p {
        margin: 0.5em 0;
        line-height: 1.5;
    }
}

@mixin typography-12() {
    font-size: 12px;
}

@mixin typography-14() {
    font-size: 14px;
}

@mixin typography-16() {
    font-size: 16px;
}

@mixin typography-uui() {
    @include typography-header();
    @include typography-block();
    @include typography-inline();
    font-family: var(--font-regular);
    color: var(--uui-text-primary);
}
