
body{
    &.emulsion-has-sidebar{

        .sidebar-widget-area{

            font-size:var(--thm_meta_data_font_size);
            text-transform:var(--thm_meta_data_font_transform);

            position:relative;
            z-index:1;
            flex-basis:var( --thm_sidebar_width, 400px );
            width:var( --thm_sidebar_width, 400px );
            max-width:var( --thm_sidebar_width, 400px );
            flex:1 0;
            margin-top:0;
            margin-bottom:0;

            .sidebar-widget-area-lists{

                padding-left:0;
                padding-right:0;
                list-style: none;
                margin-top:0;
                margin-left: auto;
                margin-right: auto;

                & > li{
                    &:first-child{
                        margin-top:0;
                    }
                    padding-left:0;
                    padding-right:0;
                }

                li{

                    line-height:calc( var(--thm_common_font_size) * var( --thm_content_line_height, 1.5 ) );
                    font-size:var(--thm_meta_data_font_size);
                    text-transform:var(--thm_meta_data_font_transform);

                    #wp-calendar caption,
                    .widgettitle{
                        margin-top:1em;
                        margin-bottom:1em;
                        font-size:20px;
                    }

                }
            }
        }

        .post-navigation{

            padding-left:var(--thm_content_gap);
            padding-right:var(--thm_content_gap);
            padding-top: .1rem;
            padding-bottom: 0.75em;
            box-sizing: border-box;
            max-width:100%;

        }

        .has-column{

            display:flex;
            flex-direction: row;
            max-width:100%;
            flex-wrap:wrap;

        }
        .pagination,
        .page-title-block,
        .nav-links{

            margin-left:auto;//ie
            margin-right:auto;//ie
            max-width:100%;

        }
        .banner{
            margin-top:0;
        }
        .page-wrapper{
            order:1;
            flex:1 1 auto;
            min-width:var( --thm_content_width );
            flex-basis:var(--thm_content_width);
            box-sizing:border-box;
        }
        .side-right .sidebar-widget-area{
            /**
             * sidebar position control
             * order:0 left sidebar
             * order:2 right sidebar
             * breack point 1249px responsive order issue (sidebar page first)
             */
            order:2;
            .widget{
                overflow:hidden;
            }
        }
        .side-left .sidebar-widget-area{
            /**
             * sidebar position control
             * order:0 left sidebar
             * order:2 right sidebar
             * breack point 1249px responsive order issue (sidebar page first)
             */
            order:0;
            .widget{
                overflow:hidden;
            }
        }
    }

}

.enable-alignfull{
    &.emulsion-has-sidebar{
        .emulsion-full{
            @extend %has-sidebar-alignfull;
            clear:both;
            float:none;
        }
    }

    //article
    &.emulsion-has-sidebar{
        article{
            .alignfull{
                max-width:none;
                position:relative;
            }
        }
    }
}

/**
 * Sidebar Sequential Control
 * ========================================================================== */
body{
    &.search-no-results,
    &.error404{
        .sidebar-widget-area{
            display:none;
            .sidebar-widget-area-lists{
                display:none;
            }
        }
        .footer-widget-area{
            display:none;
            position:static;
            .footer-widget-area-lists{
                display:none;
            }
        }
    }
    &.emulsion-has-sidebar{
        .sidebar-widget-area {
            min-height:calc(100vh - 80px);
            padding-bottom:80px;
        }
        .has-column{
            max-width:calc( var(--thm_sidebar_width) + var(--thm_main_width) );
            margin-left:auto;
            margin-right:auto;
        }
    }
    .emulsion-no-sidebar{
        .sidebar-widget-area{
            display:none;
        }
    }
    &:not(.emulsion-has-sidebar) .sidebar-widget-area{
        visibility:hidden;
        position:absolute;
        right:0;
    }
}

/**
 * Sidebar fallback
 * ========================================================================== */
.widget{
    h1,h2,h3,h4,h5,div,form{
        padding-left:var(--thm_content_gap);
        padding-right:var(--thm_content_gap);
    }
    &.widget_search{
        .wp-block-search__inside-wrapper{
            padding-left:0;
            padding-right:0;
            width:-moz-fit-content;
            width:fit-content;
            .wp-block-search__button{
                margin-left:3px;
                margin-right:3px;
            }
        }
    }
    p{
        line-height:1.5;
        padding-left:0;
        padding-right:0;
        img{
            margin-left:0;
            margin-right:0;
            max-width:100%;
            height:auto;
        }
    }
    &.widget_block{
        p{
            padding-left:var(--thm_content_gap);
            padding-right:var(--thm_content_gap);
        }
    }
    ul,ol{
        padding-left:0;
        padding-right:0;
    }
    li{
        position:relative;
        min-height:3rem;

    }
    img{
        max-width:100%;
        height:auto;
    }
    .widget_media_image{
        text-align:center;
    }
    .gallery{
        .gallery-item{
            margin-top:0;
            margin-bottom:var(--thm_box_gap);

            .gallery-icon{
                padding-left:0;
                padding-right:0;
            }
        }
    }
    .breadcrumbs{
        margin-top:1.5rem;
        margin-bottom:.75rem;
    }
    .wp-video{
        padding-left:0;
        padding-right:0;
        .mejs-duration,
        .mejs-time{
            white-space:pre;
        }
    }
    &.widget_rss{
        & > ul{
            padding-left:var(--thm_box_gap);
            padding-right:var(--thm_box_gap);
        }
    }
    &.widget_media_audio{
        padding-left:var(--thm_box_gap);
        padding-right:var(--thm_box_gap);
        .mejs-time{
            white-space:pre;
        }
    }
    &.textwidget{
        ol,
        ul{
            padding-left:40px;
            margin-top:1.5rem;
            margin-bottom:.75rem;
            li{
                list-style:disc;
                border:none;
                margin-top:.375rem;
                margin-bottom:.375rem;
                ol,
                ul{
                    margin-top:0;
                    margin-bottom:0;
                }
                &:empty{
                    display:none;
                }
            }
        }
        & > ul,
        &:not(ul) ul{
            list-style-type:disc;
        }
        & ul ul{
            list-style-type:circle;
        }
        & ul ul ul{
            list-style-type:square;
        }
    }
}
.footer-widget-area,
.sidebar-widget-area{
    .widget[id]{
        &:before{
            display:none;
        }
        & > .widgettitle{

        }
        & > div,
        & > ol,
        & > ul{
            overflow:hidden;
            box-sizing:border-box;
            .flex-control-nav{
                display:flex;
            }
        }
        & > ul{
            li{
                &:before{
                    display:none;
                }
            }
        }
    }
    .widget[id]{
        & > .gallery{
            padding-left:0;
            padding-right:0;
            max-width:100%;
        }
    }
}
/**
 * Widget tag cloud
 * ========================================================================== */
.widget_tag_cloud{
    .tagcloud{
        @extend %block;
        max-width:100%;
        padding-left:var(--thm_content_gap, 24px);
        padding-right:var(--thm_content_gap, 24px);
        display:flex;
        flex-wrap:wrap;
        a{
            flex:1 1 auto;
            margin-bottom:2px;
            vertical-align:middle;
            display:inline-block;
            text-align:center;
            padding:2px 3px;
            &:hover{
                background:rgba(188, 188, 188, .2);
            }
        }
    }
}
/**
 * Sidebar widget
 * ========================================================================== */
.sidebar-widget-area{

    /**
     * sidebar position control
     * order:0 left sidebar
     * order:2 right sidebar
     * breack point 1249px responsive order issue (sidebar page first)
     */
    @if(  $sidebar_position == 'left') {
        order:0;
    }
    @if(  $sidebar_position == 'right') {
        order:2;
    }
    a[data-title]:hover:after {
        content: attr( data-title );
        max-width:100%;
        display:inline-block;
        background:var(--thm_white_color);
        color:var(--thm_black_color);
        position:absolute;
        top:3rem;
        left:6em;
        right:0;
        padding:1rem;
        z-index:2;
        z-index:10;
    }
    & > ul{
        margin-top:0;
        margin-left:auto;
        margin-right:auto;
        padding:0;
        li{
            margin-top:0;
            margin-bottom:0;
            list-style:none;
            line-height:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) );
            width:100%;
        }
    }
    .widget{
        .widgettitle{
            overflow:hidden;
        }
        & > ul{
            @include font_size(5);
            margin-bottom:0;
            & > li{
                span,
                a{
                    display:inline-block;
                    padding-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                    padding-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                    padding-left:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                    padding-right:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                    margin-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                    margin-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                    *{
                        margin-top:0;
                        margin-bottom:0;
                        padding:0;
                    }
                }
                .children,
                .sub-menu{
                    padding-left:var(--thm_content_gap);
                }
            }
        }
    }
    .current-cat{
        list-style-type:disc;
    }
    .widget_rss{
        ul{
            li{
                max-width:100%;
                a.rsswidget{
                    display:block;
                    text-align:center;
                    margin-bottom:0;
                    padding-left:var(--thm_content_gap);
                    padding-right:var(--thm_content_gap);
                    width:auto;
                    font-size:var(--thm_common_font_size);
                    font-weight:bold;
                    line-height:var(--thm_common_line_height);
                }
                .rss-date{
                    display:block;
                    margin-top:0;
                    margin-bottom:0;
                    padding-left:var(--thm_content_gap);
                    padding-right:var(--thm_content_gap);
                    width:auto;
                    text-align:center;
                }
                .rssSummary{
                    padding-left:var(--thm_content_gap);
                    padding-right:var(--thm_content_gap);
                    line-height:1.5;
                    margin-top:.75rem;
                    margin-bottom:.75rem;
                }
                .rssSummary:empty{
                    display:none;
                }
                cite{
                    padding-left:var(--thm_content_gap);
                    padding-right:var(--thm_content_gap);
                }
            }
        }
    }
    .widget_media_gallery{
        .gallery{
            padding-left:0;
            padding-right:0;
        }
    }
    .widget_archive{
        select[name="archive-dropdown"]{
            margin:1.5rem auto .75rem;
            width:calc( 100% - var( --thm_content_gap, 24px ) * 2 );
            max-width:100%;
            padding:.69rem;
        }
    }
    .widget_categories{
        .postform{
            margin-top:1.5rem;
            margin-bottom:.75rem;
            width:calc( 100% - var( --thm_content_gap, 24px ) * 2 );
            max-width:100%;
            padding:.69rem;
        }
    }
    .widget_tag_cloud{
        .tagcloud{
            @extend %block;
            margin-left:auto;
            margin-right:auto;
            //  padding-left:0;
            // padding-right:0;
        }
    }
    .widget_nav_menu{
        .menu{
            @extend %block;
            max-width:100%;
            padding-left:0;
            padding-right:0;
            & > li{
                &  > a{
                    margin-top:0;
                    margin-bottom:0;
                }
            }
        }
        & > div:not(.has-chckbox-control) {
            .menu{
                @extend %block;
                max-width:100%;
                padding-left:0;
                padding-right:0;
                & > li{
                    list-style: none;
                    padding-top: 0.71rem;
                    padding-bottom: 0.71rem;
                    line-height: calc(var(--thm_common_font_size) * var( --thm_content_line_height, 1.5 ));
                    font-size: var(--thm_meta_data_font_size);
                    text-transform: var(--thm_meta_data_font_transform);
                    &  > a{
                        padding-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                        padding-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                        padding-left:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                        padding-right:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                        margin-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                        margin-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                    }
                }
            }
        }
    }
    .wp-caption{
        &.alignnone{
            margin-top:1.5rem;
            margin-bottom:.75rem;
            margin-left:0;
            margin-right:0;
        }
    }
    .widget_calendar{
        @include font_size(5);
        width:100%;
        .calendar_wrap{
            text-align:center;
            width:calc( 100% - var(--thm_content_gap) * 2 );
            margin-left:auto;
            margin-right:auto;

        }
    }
}
/**
 * Footer Widget
 * ========================================================================== */
body{
    .template-part-widget-footer{
        @extend .sidebar-widget-area;
        &.footer-widget-area{
            max-width:calc(100vw - 17px);
            width:100vw;
            max-width:100%;
            display:block;
            visibility:visible;
            position:static;
            margin-left:auto;
            margin-right:auto;
            overflow:hidden;
            padding-left:0;
            padding-right:0;

            .footer-widget-area-lists{

                @extend %block_main_wide;
                padding-left:var(--thm_content_gap);
                padding-right:var(--thm_content_gap);
                width:100%;
                display:flex;
                flex-wrap:wrap;
                margin:0 auto 0;
                padding-top:1.5rem;
                padding-bottom:.75rem;
                justify-content:center;
                & > li{
                    // Customizer relate cols
                    flex:1 1 var( --thm_footer_widget_width );
                    margin-left:auto;
                    margin-right:auto;
                    min-width:var(--thm_content_min_width);
                    list-style:none;
                    margin:var( --thm_box_gap );
                    .widgettitle{

                        overflow:hidden;
                        width:auto;
                        margin-top:1.5rem;

                    }
                    & > div:not(.gallery){

                        max-height:70vh;
                        overflow-y:scroll;
                        overflow-x:hidden;
                        @include font_size(5);
                        margin-bottom:0;
                        margin-top:0;
                        & > .menu{
                            margin-top:0;
                        }
                        &::-webkit-scrollbar {
                            width: .5rem;
                            height:100px;
                        }
                        &::-webkit-scrollbar-thumb{
                            background-color: var(--thm_black_color);
                            outline: 1px solid var(--thm_black_color);
                        }
                    }
                    & > ul{
                        max-height:70vh;
                        overflow-y:scroll;
                        overflow-x:hidden;
                        @include font_size(5);
                        margin-bottom:0;
                        &::-webkit-scrollbar {
                            width: .5rem;
                            height:100px;
                        }
                        &::-webkit-scrollbar-thumb{
                            background-color: var(--thm_black_color);
                            outline: 1px solid var(--thm_black_color);
                        }
                    }
                    ul{
                        width:auto;
                    }
                    .children,
                    .sub-menu{
                        padding-left:var(--thm_content_gap);
                    }
                }
            }
        }
        .widget_nav_menu{
            .menu{
                @extend %block;
                max-width:100%;
                padding-left:0;
                padding-right:0;
                & > li{
                    &  > a{
                        margin-top:0;
                        margin-bottom:0;
                    }
                }
            }
            & > div:not(.has-chckbox-control) {
                .menu{
                    @extend %block;
                    max-width:100%;
                    padding-left:0;
                    padding-right:0;
                    & > li{
                        list-style: none;
                        padding-top: 0.71rem;
                        padding-bottom: 0.71rem;
                        line-height: calc(var(--thm_common_font_size) * var( --thm_content_line_height, 1.5 ));
                        font-size: var(--thm_meta_data_font_size);
                        text-transform: var(--thm_meta_data_font_transform);
                        &  > a{
                            padding-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                            padding-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                            padding-left:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                            padding-right:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 2 );
                            margin-top:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                            margin-bottom:calc( var(  --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ) / 4 );
                        }
                    }
                }
            }
        }
        .wp-caption{
            &.alignnone{
                margin-top:1.5rem;
                margin-bottom:.75rem;
                margin-left:0;
                margin-right:0;
            }
        }
        .widget_calendar{
            @include font_size(5);
            width:100%;

            .calendar_wrap{
                text-align:center;
                max-width:100%;

            }
        }
    }
}
/**
 * bbpress
 */
.widget{
    &.widget_display_stats{
        display:block;
        max-width:100%;
        margin-top:0;
        margin-bottom:0;
        dt{
            float:left;
            clear:left;
            margin-top:1.5rem;
            margin-bottom:.75rem;
        }
        dd{
            float:left;
            margin-top:1.5rem;
            margin-bottom:.75rem;
        }
    }
    &.widget_display_search{
        .bbp-search-form{
            #bbp_search{
                width:calc(100% - 70px);
            }
        }
    }
}
/**
 * woocommerce
 */
.widget{
    &.widget_shopping_cart{
        .cart_list{
            li{
                a.remove{
                    line-height: calc(var(--thm_common_font_size) * var( --thm_content_line_height, 1.5 ));
                }
            }
        }
    }
}
/*
accessibility
color
gallery
comments
wp-nav-menu
effect
responsive
edge
print
*/

//wp-nav-menu
.emulsion-has-sidebar{
    .primary-menu-wrapper{
        display:flex;
        flex-direction: row;
        margin-left:auto;
        margin-right:auto;
        position:relative;
        nav[class|="menu"]{
            order:1;
            flex:1 1 auto;
            position:relative;
            width: var(--thm_content_width);
            box-sizing: border-box;
            flex-wrap:wrap;
        }
        &.menu-inactive{
            display:none;
            .menu-placeholder{
                display:none;
            }
        }
        .menu-placeholder:empty{
            display:none;
        }
        .menu-placeholder{
            position:relative;
            z-index:1;
            flex-basis:var( --thm_sidebar_width, 400px );
            width:var( --thm_sidebar_width, 400px );
            max-width:100%;
            flex:0 0;
            text-align:right;
        }
        &.side-right{
            .menu-placeholder{
                order:2;
            }
        }
        &.side-left{
            .menu-placeholder{
                order:0;
            }
        }
    }
    .header-layer{
        .menu-simple-container{
            .menu{
                margin-top:0;
            }
        }
    }
}
//effect
/**
 * Sticky Sidebar
 * =================================================================== */
.emulsion-has-sidebar{
    &.disable-sidebar-sticky{
        .sidebar-widget-area .widget:last-child{
            position: static;
        }
    }
    .sidebar-widget-area-lists{
        height:100%;
    }
    .sidebar-widget-area .widget:last-child{
        position: -webkit-sticky;
        position: sticky;
        top: 100px;
        align-self: flex-start;
    }
    &.on-scroll{
        &.logged-in{
            .menu-inactive{
                & ~ .has-column{
                    .sidebar-widget-area{
                        top:32px;
                    }
                }
            }
        }
    }
}
.emulsion-has-sidebar{
    .menu-inactive{
        &.primary-menu-wrapper{
            display:none;
        }
    }
}

/**
 * Widget Navigation Menu
 * ========================================================================== */
.widget_nav_menu{
    & > div{
        &.has-chckbox-control{
            .menu{
                width:100%;
                & > li{
                    list-style:none;
                    margin:0 var( --thm_box_gap ) 0;
                    &:not(.menu-item-has-children) a{
                        display:inline-block;
                    }
                    ul{
                        @include clip;
                        width:100%;
                        text-align:left;
                        display:none;//EDGE
                    }
                }
                li{
                    list-style:none;
                    padding-top:.71rem;
                    padding-bottom:.71rem;
                    .nav-menu-child-opener:checked ~ .children .menu-item-has-children,
                        .nav-menu-child-opener:checked ~ .children,
                        .nav-menu-child-opener:checked ~ .sub-menu{
                        clip:auto;
                        height:auto;
                        clip-path: none;
                        display:block; //EDGE
                        visibility:visible;
                    }
                }
            }
        }
    }
}

.noscript{
    nav[class|="menu"]{
        .widget_nav_menu{
            & > div{
                .menu{
                    @include font_size(5);
                    & > li{
                        &  > a{
                            display:inline-block;
                            font-weight:bold;
                            margin:1.5rem auto .75rem;
                            line-height: calc(var( --thm_common_font_size, 16px ) * var( --thm_content_line_height, 1.5 ));
                            &:after{
                                content:none;
                            }
                        }
                    }
                    li{
                        display:list-item;
                        width:100%;
                        position:relative;
                        list-style:none;
                        a{
                            &:after{
                                content:none;
                            }
                        }
                        .sub-menu,
                        .children{
                            width:auto;
                            overflow:visible;
                            max-width:var(--thm_sidebar_width, 400px);
                            min-width:100%;
                            margin-top:0!important;
                            margin-bottom:0;
                            padding-left:.5rem;
                            padding-right:.5rem;
                            position:relative;
                            left:0;
                            z-index:9999;
                            margin-top:0;
                            li{
                                padding:.5rem;
                            }
                            & > li{
                                border-bottom:1px solid rgba(222,222,222,.3);
                            }
                            .menu-item-has-children{
                                font-weight:700;
                                .menu-item-has-children{
                                    border:none;
                                }
                                .sub-menu,
                                .children{
                                    font-weight:normal;
                                }
                            }
                            .sub-menu,
                            .children{
                                padding-left:.0;
                                padding-right:0;
                                margin-left:0;
                                margin-right:0;
                                width:100%;
                                position:relative;
                                .sub-menu,
                                .children{
                                    width:100%;
                                    margin-left:0;
                                    margin-right:0;
                                    left:0;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
