/**
 * Applied to frontend and editor views.
 */

$bg: #F6F8FA;
$text-gray-dark: #24292E;
$text-gray: #586069;
$text-gray-light: #6A737D;
$btn-border: #d4d8da;
$btn-background: #f6f8fa;
$border-color: #EAEDF0;
$mobile_width: 500px;
$font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

div[id^="bfg-wrap-"] {
    background: #FFF;
    font-family: $font-family;
    color: $text-gray-dark;
    margin: 0 auto 2rem;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
    border: 1px solid $border-color;
    border-radius: 5px;
    line-height: 1.5rem;
    max-width: 750px;


    // Resets for theme and gutenberg styles.
    h3, a, ul, li, ol, li, p {
        font-family: $font-family;
        color: $text-gray-dark;
        margin: 0;
        padding: 0;
    }

    a {
        text-decoration: none;

        &:focus {
            outline: none;
        }

        &:hover {
            text-decoration: underline;
        }
    }

    .bfg-header {
        background-size: cover;
        border-radius: 5px 5px 0 0;
        margin: 0 0 3rem;
        height: 130px;
        text-align: center;
    }

    // Avatar
    .bfg-avatar {
        margin: 1.5rem 0 0;
        display: inline-block;
        border-radius: 50%;
        border: 6px solid #FFF;
        filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.25));
        overflow: hidden;
        background: #DDD;
        line-height: 0;

        img {
            height: 130px;
            width: 130px;
        }
    }

    // Title
    .bfg-subheader-content {
        text-align: center;
        padding: 0 2rem;

        h3 {
            margin: 0 0 0.8rem;
        }
    }

    // Follow button.
    .bfg-follow-me {
        transition: .2s cubic-bezier(0.3, 0, 0.5, 1);
        border: 1px solid $btn-border;
        border-radius: 6px;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.8rem;
        color: #000;
        height: 30px;
        display: inline-flex;
        box-shadow: rgba(27, 31, 36, 0.04) 0 1px 0 0;
        margin: 0 0 2rem;

        span {
            display: flex;
            align-items: center;
        }

        &:hover {
            border: 1px solid darken($btn-border, 3%);
            text-decoration: none;
        }

        &__inner {
            padding: 0 10px;
            background: $btn-background;
            border-right: 1px solid $btn-border;
            border-radius: 5px 0 0 5px;
            box-shadow: rgba(255, 255, 255, 0.25) 0 1px 0 0 inset;

            &:hover {
                background: #e8e9ea;
            }

            &--svg svg {
                width: 20px;
                padding: 0 6px 0 0;
            }

        }

        &__count {
            border-radius: 0 5px 5px 0;
            padding: 0 10px;
            background: #FFF;
        }
    }

    // Bio
    .bfg-bio-wrap, .bfg-repo-description {
        background: $bg;
        border-radius: 6px;
        padding: 1rem;
        margin: -0.3rem 3rem 2rem;
        text-align: center;
        position: relative;

        @media(max-width: $mobile_width) {
            padding: 1rem;
            margin-left: 2rem;
            margin-right: 2rem;
        }

        &:before {
            content: ' ';
            height: 0;
            width: 0;
            position: absolute;
            top: -0.9rem;
            transform: translate(-50%, 0%);
            border-right: solid 15px transparent;
            border-left: solid 15px transparent;
            border-bottom: solid 15px $bg;
        }
    }

    // Meta list.
    .bfg-meta-list {
        background: $bg;
        margin: 0;
        padding: 0.5rem 1rem;
        display: flex;


        justify-content: space-around;
        flex-flow: row wrap;
        border-top: 1px solid $border-color;
        border-bottom: 1px solid $border-color;

        li, a {
            display: flex;
            align-items: center;
            line-height: 1.4rem;
            font-weight: 400;
            font-size: 1rem;
        }

        li {
            list-style-type: none;
            padding: 0.5rem;
        }

        svg {
            margin-right: 0.25rem;

            path {
                fill: $text-gray-dark;
            }
        }

    }

    .bfg-bottom-wrap {
        padding: 2rem;
    }

    // Repository / Gist lists
    .bfg-github-list {
        list-style-type: none;
        margin: 0;
        padding: 0;

        li {
            border: 1px solid $border-color;
            padding: 0.9rem 1.25rem;
            border-radius: 5px;
            margin: 0 0 1rem;

            &:last-of-type {
                margin-bottom: 0;
            }
        }

        .bfg-top-repo {

            &__top {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin: 0 0 0.7rem;

                @media(max-width: $mobile_width) {
                    display: block;
                }

            }

            &__link {
                font-size: 1.1rem;
                font-weight: 500;
                @media(max-width: $mobile_width) {
                    display: block;
                    margin: 0 0 0.5rem;
                }
            }

            &__description {
                font-style: italic;
                font-size: 1rem;
                line-height: 1.4rem;
            }
        }

        .bfg-top-repo-pill-wrap {
            display: flex;
            white-space: nowrap;
            align-items: flex-start;
        }

        .bfg-top-repo-pill {
            color: $text-gray;
            border-radius: 1rem;
            padding: 0 0.6rem;
            font-size: 0.9rem;

            &--purple {
                background: #f5f3ff;
                margin-right: 0.1rem;
            }

            &--blue {
                background: #F1F8FF;
                margin-right: 0.1rem;
            }

            &--gold {
                background: #FFFDEF;
            }

            svg {
                fill: $text-gray
            }
        }

    }


    // Errors and Notices
    .bfg-notice-wrap {
        font-family: $font-family;
        background: #F6F8FA;
        border: 1px solid #EAEDF0;
        display: flex;
        align-items: center;
        padding: 0;
        border-radius: 6px;
        text-align: center;

        .bfg-notice-inner {
            margin: 0 auto;
            padding: 20px;
            max-width: 750px;
        }

        .bfg-info-emoji {
            font-size: 40px;
        }

        h2 {
            font-weight: 500;
            margin: 0 0 0.4rem;
        }

        .bfg-error {
            color: black;
            font-size: 13px;
            background: #FFF;
            padding: 8px 10px;
            border-left: 5px solid red;
            max-width: 750px;
            margin: 20px auto;
            box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
        }
    }


}


// Repo specific
div[id^="bfg-wrap-"].bfg-repo {
    .bfg-repo-header {
        display: grid;
        grid-template-columns: auto 1fr;

        .bfg-repo-avatar-wrap {
            grid-column: 1;
            margin: 0;
            padding: 20px 10px 20px 20px;

            img {
                height: 100px;
                width: 100px;
                margin: 0;
                padding: 0;
                border: 3px solid #FFF;
            }

        }

        .bfg-repo-content {
            grid-row: 1;
            grid-column: 2;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            margin: 0;
            padding: 20px 20px 20px 10px;

            .bfg-repo-name-wrap {
                justify-content: flex-start;

                .bfg-repo-name {
                    margin: 0 0 5px;
                }
            }

            .bfg-follow-me {
                margin: 0;
            }

            .bfg-repo-byline {
                font-style: italic;
                display: block;
                margin: 0 0 15px;
            }

        }

    }


    .bfg-repo-description-wrap {
        margin: 0 20px 20px;

        .bfg-repo-description {
            margin: 0;
            text-align: left;

            &:before {
                left: 50px;
            }
        }


    }

    .bfg-tag-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start; /* Distribute the items with space between */
        margin: 0;
        padding: 0 20px 20px;
        list-style: none;
        gap: 10px; /* Add 10px space between items */

        li {
            list-style: none;
            border-radius: 24px;
            padding: 2px 8px;
            font-size: 13px;
            background-color: #ddf4ff;
            color: $text-gray;

        }
    }


    // Repo Meta
    .bfg-meta-list {
        svg {
            width: 18px;
            height: 18px;
            margin: 0 3px 0 0;
            padding: 0;
        }
    }

}
