/** ===== Widget ===== **/
.widget {
    padding: 30px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);

    &:not(:last-child) {
        margin-bottom: 40px;
    }

    &.widget_block ul,
    &.widget_block ol,
    ul,
    ol {
        padding: 0;
        list-style: none;
        margin: 0;

        li {
            margin: 0;
        }
    }

    .widget-title {
        font-size: 24px;
        padding: 0 0 15px;
        margin: 0 0 25px;
        position: relative;

        &::before,
        &::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 60px;
            height: 1px;
            background-color: $color-primary;
        }

        &::after {
            width: 5px;
            left: 45px;
            background-color: $color-white;
            z-index: 2;
        }
    }

    a {
        color: $color-body;

        &:hover {
            color: $color-secondary;
        }
    }

    &.widget_block .wp-block-categories,
    &.widget_block .wp-block-archives,
    &.widget_categories,
    &.widget_archive {
        li {
            line-height: 1;

            a {
                display: flex;
                justify-content: space-between;
                align-items: center;
                font-weight: 500;
                line-height: 1.6;
            }

            &:not(:last-child) {
                margin-bottom: 10px;
                padding-bottom: 10px;
                border-bottom: 1px solid rgba(0, 0, 0, 0.15);
            }

            .children {
                padding-left: 15px;

                li:first-child {
                    margin-top: 15px;
                    padding-top: 15px;
                    border-top: 1px solid rgba(0, 0, 0, 0.15);
                }
            }
        }
    }

    &.widget_calendar {
        caption {
            font: {
                size: 18px;
                weight: 500;
            }
            color: $color-heading;
            text-align: center;
            margin-bottom: 10px;
        }

        table {
            margin: 0 0 15px;
        }

        a {
            color: $color-secondary;
        }

        .wp-calendar-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font: {
                size: 15px;
                weight: 500;
            }

            a {
                color: $color-heading;

                &:hover {
                    color: $color-secondary;
                }
            }
        }
    }

    &.widget_block .wp-block-latest-posts,
    &.widget_pages,
    &.widget_meta,
    &.widget_nav_menu,
    &.widget_recent_entries {
        li {
            &:not(:last-child) {
                margin-bottom: 10px;
            }

            .children,
            .sub-menu {
                margin-top: 10px;
                padding-left: 15px;
            }

            a {
                font: {
                    size: 15px;
                    weight: 500;
                }
                line-height: 1.6;
                position: relative;

                &:hover {
                    padding-left: 5px;
                }
            }
        }
    }

    &.widget_block .wp-block-latest-comments,
    &.widget_recent_comments {
        li {
            &:not(:last-child) {
                margin-bottom: 15px;
            }

            a {
                color: $color-heading;
                font: {
                    size: 15px;
                    weight: 600;
                }
                line-height: 1.8;

                &:hover {
                    color: $color-secondary;
                }
            }

            .comment-author-link {
                a {
                    font-weight: 500;
                }
            }
        }
    }

    &.widget_rss {
        li {
            &:not(:last-child) {
                margin-bottom: 25px;
            }

            a.rsswidget {
                font: {
                    size: 18px;
                    weight: 500;
                }
                display: block;
                color: $color-heading;
                margin-bottom: 5px;
                line-height: 1.4;

                &:hover {
                    color: $color-secondary;
                }
            }

            span.rss-date,
            cite {
                display: block;
                font-size: 14px;
                margin-bottom: 5px;
                font-weight: 400;
                color: $color-heading;
            }

            cite {
                margin-top: 10px;
                margin-bottom: 0;
                display: block;
            }
        }
    }

    .wp-block-rss__item {
        &:not(:last-child) {
            margin-bottom: 20px;
        }

        .wp-block-rss__item-title a {
            font: {
                size: 18px;
                weight: 500;
            }
            display: block;
            color: $color-heading;
            margin-bottom: 5px;
            line-height: 1.4;

            &:hover {
                color: $color-secondary;
            }
        }

        .wp-block-rss__item-publish-date {
            display: block;
            font-size: 14px;
            margin-bottom: 5px;
            font-weight: 400;
            color: $color-heading;
        }

        .wp-block-rss__item-author {
            margin-bottom: 15px;
            display: block;
        }
    }

    &.widget_text {
        font-size: 15px;

        .wp-caption-text {
            padding: 0;
        }
    }

    &.widget_tag_cloud {
        .tagcloud {
            display: flex;
            flex-wrap: wrap;
            margin-right: -10px;
            margin-bottom: -10px;

            a {
                display: block;
                font-size: 16px !important;
                background-color: $color-light;
                padding: 8px 18px;
                border-radius: 25px;
                line-height: 1.5;
                margin: 0 10px 10px 0;

                &:hover {
                    background-color: $color-secondary;
                    color: $color-white;
                }
            }
        }
    }

    &.widget_search {
        form {
            position: relative;
        }

        input {
            background-color: $color-light;
            height: 50px;
            padding: 0 65px 0 20px;
            border: none;
            font-size: 15px;
            font-weight: 400;
            border-radius: 5px;
        }

        button {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 50px;
            padding: 0;
            font-size: 15px;
        }
    }

    &.widget_block.widget_search {
        .wp-block-search__label {
            display: block;
        }

        .wp-block-search__input {
            padding: 0 30px;
            border: 0;
            height: 60px;
        }

        .wp-block-search__button {
            min-width: 90px;
            height: 60px;
            position: static;
            font-size: 14px;
            padding: 0;
            transform: translateX(0);
            background-color: $color-primary;
            color: $color-white;
        }

        .wp-block-search__button-inside {
            .wp-block-search__inside-wrapper {
                border-color: $color-border;
            }

            .wp-block-search__button {
                margin: 0;
                min-width: 60px;

                svg {
                    fill: $color-white;
                }
            }
        }
    }

    .blocks-gallery-grid .blocks-gallery-image,
    .blocks-gallery-grid .blocks-gallery-item,
    .wp-block-gallery .blocks-gallery-image,
    .wp-block-gallery .blocks-gallery-item {
        margin: 0 1em 1em 0;
    }

    .blocks-gallery-grid .blocks-gallery-image:last-child,
    .blocks-gallery-grid .blocks-gallery-item:last-child,
    .wp-block-gallery .blocks-gallery-image:last-child,
    .wp-block-gallery .blocks-gallery-item:last-child {
        margin-right: 0;
    }
}

/** ===== Block Widgets Title ===== **/
.widget.widget_block {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .wp-block-search__label {
        font-size: 24px;
        padding: 0 0 15px;
        margin: 0 0 25px;
        position: relative;

        &::before,
        &::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 60px;
            height: 1px;
            background-color: $color-primary;
        }

        &::after {
            width: 5px;
            left: 45px;
            background-color: $color-white;
            z-index: 2;
        }
    }
}
