/*******************************************************************************************
*   ___  _          ______                     _ _                _                        *
*  / _ \| |         | ___ \                   | (_)              | |              © 2024   *
* / /_\ | | _____  _| |_/ /_ __ __ _ _ __   __| |_ _ __   __ _   | |_ ___  __ _ _ __ ___   *
* |  _  | |/ _ \ \/ / ___ \ '__/ _` | '_ \ / _` | | '_ \ / _` |  | __/ _ \/ _` | '_ ` _ \  *
* | | | | |  __/>  <| |_/ / | | (_| | | | | (_| | | | | | (_| |  | ||  __/ (_| | | | | | | *
* \_| |_/_|\___/_/\_\____/|_|  \__,_|_| |_|\__,_|_|_| |_|\__, |  \___\___|\__,_|_| |_| |_| *
*                                                         __/ |                            *
*                                                        |___/                             *
* ---------------------------------------------------------------------------------------- *
* This is commercial software, only users who have purchased a valid license and accept    *
* to the terms of the License Agreement can install and use this program.                  *
* ---------------------------------------------------------------------------------------- *
* website: https://cs-cart.alexbranding.com                                                *
*   email: info@alexbranding.com                                                           *
*******************************************************************************************/

.ab__sfb-aside {
    position: sticky;
    top: calc(~"var(--ab-sfb-top, 0px) - var(--content-top, 0) * 1px");

    @media(min-width: 769px) {
        .ab__sfb-contents  ul {
            max-height: max(~"50vh, 250px");
            overflow: auto;
        }
    }
}

.ab--sfb-tof {
    ul {
        padding-left: 10px;
    }

    li {
        position: relative;
    }

    a::before {
        content: "";
        position: absolute;
        height: 6px;
        width: 6px;
        left: -6px;
        transform: translateY(100%);
        border-radius: 50%;
        background-color: #ff7125;
    }

}

.ab__sfb-contents {

    @media (max-width: 767px) {
        ul {
            margin-left: .5rem;
        }
    }


    &.ab--sfb-active-scroll {
        position: relative;
        padding-left: min(1.2em, 20px);

        &:before, &:after {
            display: block;
            background-color: fade(@font, 20%);
            width: 5px;
            position: absolute;
            left: 0;
            top: 0;
            height: calc(~"100% - 0.5ch");
            content: '';
            border-radius: 4ch;
            z-index: 1;
        }

        &:after {
            background-color: @primary_button;
            height: calc(~"var(--ab-sfb-read, 0) * 100% - 0.5ch");
            transition: height 0.1s linear;
            will-change: height;
        }
    }

    li {
        padding: initial;
    }

    li > ul {
        margin-left: 1em;
        flex: 0 1 100%;
    }

    li + li {
        margin-top: 5px;
    }

    a {
        color: fade(@font, 60%);
    }


    .ab--sfb {
        &-toggle {
            cursor: pointer;
            border-radius: 4px;
            padding: 2px;
            align-self: center;

            &.open:before {
                transform: scaleY(-1);
            }

            &:hover {
                background-color: fade(@font, 10%);
            }

            &:before {
                content: '';
                display: inline-block;
                background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTEwIDEyLjgzMy01LTUgMS4xNjctMS4xNjZMMTAgMTAuNWwzLjgzMy0zLjgzM0wxNSA3LjgzM2wtNSA1eiIgZmlsbD0iIzc4Nzk3OSIvPjwvc3ZnPg==");
                width: 20px;
                height: 20px;
                vertical-align: middle;
            }
        }

        &-nav-item {
            display: flex;
            flex-wrap: wrap;
            column-gap: 1.5em;
        }

        &-nav-link {
            font-size: 16px;
            display: inline-block;
            flex-grow: 1;
            max-width: calc(~"100% - 1.5em - 24px");
            padding-block: 0.25em;

            &.active {
                color: @font;
            }

            &:hover {
                color: @font;
                text-decoration: underline;
            }
        }
    }
}

.ab--sfb-articles hr {
    margin-block: 30px;
    @media (max-width: 560px) {
        display: none;
    }
}

.ab--sfb__date {
    color: fade(@font, 60%);
    margin-bottom: 0.5em;
}

.ab--sfb__item {
    display: flex;
    gap: 15px 30px;


    .ab--sfb-author-img {
        width: 30px;
        height: 30px;
        margin-block: initial;
        overflow: hidden;

        &:before {
            font-size: 32px;
        }
    }

    @media (max-width: 560px) {
        flex-wrap: wrap;
        &:not(:last-child) {
            margin-bottom: 60px;
        }
    }

    .ab--sfb-post-image {
        flex: 1 1 100%;
        min-width: 40%;

        @media(min-width: 769px){
            max-width: 350px;
        }

        .ab--sfb__img-block {
            margin-block: 0;
            @media (max-width: 560px) {
                img {
                    margin-block: 0;
                }
            }

            img {
                border-radius: 8px;
            }
        }
    }

    .ty-wysiwyg-content {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding-block: 0;
    }
}

.ab--sfb__post-title {
    display: block;
    font-size: inherit;
}

.ab--sfb-post-info span {
    color: fade(@font, 60%);
}

.ab--sfb-author {
    margin-bottom: 20px;

    &.author-inline {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 30px;
        margin-block: 30px;
        padding-bottom: 30px;
        border-bottom: solid 1px fade(@font, 30%);
        width: 100%;

        > * {
            grid-column: 2;
        }

        .ab--sfb-author-img {
            grid-row-start: 1;
            grid-row-end: span 5;
            grid-column: 1;
            width: 120px;
            height: 120px;
            overflow: hidden;

            &:before {
                font-size: 130px;
            }
        }

        @media (max-width: 560px) {
            grid-template-columns: 1fr;
            .ab--sfb-author-img {
                grid-row: auto;
            }

            > * {
                grid-column: auto;
            }
        }
    }

    &-img {
        width: 90px;
        height: 90px;
        object-fit: cover;
        border-radius: 50%;
        border: solid 1px #33333355;
        overflow: hidden;

        &.ty-icon {
            display: inline-block;
            vertical-align: middle;
        }

        &:before {
            font-size: 100px;
        }
    }

    &-name {
        font-size: 16px;
        font-weight: 700;
        margin-top: 10px;
    }

    &-about-short, &-about {
        margin-top: 10px;
        color: #787979;
    }

    &-rank, &-appointment {
        margin-top: 5px;

        span {
            color: #787979;
        }
    }

    &-link {
        margin-top: 10px;
        display: inline-block;
        text-decoration: underline;

        svg {
            height: 1em;
            width: auto;
            vertical-align: middle;
            display: inline-block;
            margin-left: 0.5em;
        }
    }
}
