/**
 * default CSS variables values
 * If you want to enable @variables, please refer to the following URL
 * @see https://www.tenman.info/wp3/emulsion/en/2020/03/23/scss-%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e7%b7%a8%e9%9b%86%e3%82%92%e8%a1%8c%e3%81%86%e5%a0%b4%e5%90%88%e3%81%ab/
 */
@if $heading_font_scale == 'xxx' {
    :root{
        --thm_h6_font_size:calc(var(--thm_heading_font_base) * 0.6875px);
        --thm_h5_font_size:calc(var(--thm_heading_font_base) * 0.8125px);
        --thm_h4_font_size:calc(var(--thm_heading_font_base) * 1px);
        --thm_h3_font_size:calc(var(--thm_heading_font_base) * 1.5px);
        --thm_h2_font_size: calc(var(--thm_heading_font_base) * 2px);
        --thm_h1_font_size: calc(var(--thm_heading_font_base) * 3px);
    }
} @else {
    :root{
        --thm_h6_font_size:calc(var(--thm_heading_font_base) * 0.6875px);
        --thm_h5_font_size:calc(var(--thm_heading_font_base) * 0.8125px);
        --thm_h4_font_size:calc(var(--thm_heading_font_base) * 1px);
        --thm_h3_font_size:calc(var(--thm_heading_font_base) * 1.17px);
        --thm_h2_font_size:calc(var(--thm_heading_font_base) * 1.4px);
        --thm_h1_font_size:calc(var(--thm_heading_font_base) * 2px);
    }
}
// METADATA
@if $heading_font_scale == 'xxx' {
    //--thm_meta_data_font_size has unit px
    aside{
        --thm_h6_font_size:calc(var(--thm_meta_data_font_size, 13px) * 0.6875);
        --thm_h5_font_size:calc(var(--thm_meta_data_font_size, 13px) * 0.8125);
        --thm_h4_font_size:calc(var(--thm_meta_data_font_size, 13px) * 1);
        --thm_h3_font_size:calc(var(--thm_meta_data_font_size, 13px) * 1.5);
        --thm_h2_font_size: calc(var(--thm_meta_data_font_size, 13px) * 2);
        --thm_h1_font_size: calc(var(--thm_meta_data_font_size, 13px) * 3);
    }
} @else {
    aside{
        --thm_h6_font_size:calc(var(--thm_meta_data_font_size, 13px) * 0.6875);
        --thm_h5_font_size:calc(var(--thm_meta_data_font_size, 13px) * 0.8125);
        --thm_h4_font_size:calc(var(--thm_meta_data_font_size, 13px) * 1);
        --thm_h3_font_size:calc(var(--thm_meta_data_font_size, 13px) * 1.17);
        --thm_h2_font_size:calc(var(--thm_meta_data_font_size, 13px) * 1.4);
        --thm_h1_font_size:calc(var(--thm_meta_data_font_size, 13px) * 2);
    }
}

.has-border-custom{
    --thm_common_border:var(--thm_border_global, rgba(188,188,188,.5));
    --thm_common_border_style:var(--thm_border_global_style, solid);
    --thm_common_border_width:var(--thm_border_global_width, 1px);
}
.is-dark{
    --thm_social_icon_bg_color:#000000;
}
.is-light{
    --thm_social_icon_bg_color:#ffffff;
}

//fallback minimam color style

body{
    /**
     * Editor Color Palette
     * ========================================================================== */
    @each $color_pallet in $editor_color_palettes {
        $slug: nth($color_pallet, 1);
        $color: nth($color_pallet, 2);

        .has-#{$slug}-color {
            // OW over write global-styles-inline-css
            //error is not string
            //color:#{str-replace($color,'.4','1')} ! important;
            color:#{set-nth($color, .4, 1)} ! important;
        }


        .has-#{$slug}-background-color{
            background:#{$color};
            background-image:linear-gradient( #{$color, $color}  ), linear-gradient(  var(--thm_white_color, #ffffff), var(--thm_white_color, #ffffff) );
            background-size:cover;
        }


        .wp-block-columns.has-#{$slug}-background-color{
            &:before{
                display:none;
            }
        }

    }

    article .has-my-color {
        color:var(--thm_favorite_color_palette);
    }
    article .has-my-color-background-color {
        background:var(--thm_favorite_color_palette);
    }
}

/**
 * Image sizes
 */

@each $size in $image_sizes {

    $class: nth($size, 1);
    $width: nth($size, 2);
    $height: nth($size, 3);

    @if( $width < var(--thm_main_width) / 2 - var(--thm_content_gap, 24px) - 1rem){
        div.wp-block-image{

            &.alignright,
            &.alignleft{
                &.size-#{$class}{
                    width:#{$width}px;
                    height:auto;
                    &.keep-area{
                        width: calc(50% - var(--thm_content_gap, 24px) - 1rem);
                        max-width: calc(50% - var(--thm_content_gap, 24px) - 1rem);
                        @media screen and (max-width: 720px) {
                            width:100%;
                            max-width:100%;
                        }
                        .size-#{$class}{
                            margin:0 auto;
                            img{
                                display:block;
                                margin:0 auto;
                            }
                        }
                    }
                    .size-#{$class}{
                        width:#{$width}px;
                        margin:0;
                        img{
                            width:#{$width}px;
                            height:auto;

                            @if $height != 0 {
                                // height:#{$height}px;
                            }
                        }
                    }
                    &.is-style-shrink{
                        width:auto;
                        max-width: calc(var(--thm_content_width, 720px) / 2 - 1rem);
                        @media screen and (max-width: 720px) {
                            max-width:100%;
                        }
                        .size-#{$class}{
                            width:auto;
                            img{
                                width:auto;
                            }
                        }
                    }
                    &.is-resized{
                        width:auto;
                        @media screen and (max-width: 720px) {
                            max-width:100%;
                        }
                        .size-#{$class}{
                            width:auto;
                            img{
                                width:auto;
                            }
                        }
                    }
                    img{
                        object-fit:cover;
                    }
                }
            }
        }

        &.is-style-shrink{

            &.alignleft{
                &.size-#{$class}{
                    width:calc( var(--thm_content_width, 720px) / 2);
                    margin-left: calc((var(--thm_main_width, 1280px) - var(--thm_content_width, 720px)) / 2 - var(--thm_content_gap, 24px));
                    @media screen and (max-width: 720px) {
                        width:auto;
                        margin-right:auto;
                    }
                    &.size-thumbnail{
                        width:150px;
                        padding:0;
                    }
                    figure{
                        width:100%;
                    }
                }
            }
            &.alignright{
                &.size-#{$class}{
                    width:calc( var(--thm_content_width) / 2);
                    margin-right: calc((var(--thm_main_width, 1280px) - var(--thm_content_width, 720px)) / 2 - var(--thm_content_gap, 24px));
                    &.size-thumbnail{
                        width:150px;
                        padding:0;
                    }
                    figure{
                        width:100%;
                    }
                    @media screen and (max-width: 720px) {
                        width:auto;
                        margin-right:auto;
                    }
                }
            }
        }
    }
    .emulsion-has-sidebar.is-presentation-transitional,
    .emulsion-has-sidebar.is-presentation-theme{
        .wp-block-image{
            &.alignright,
            &.alignleft{
                &.size-#{$class}{
                    &.is-style-shrink{
                        width:auto;
                        max-width: calc(var(--thm_content_width, 720px) / 2 - var(--thm_content_gap, 24px) - 1.1rem);
                        @media screen and (max-width: 720px) {
                            max-width:100%;
                        }

                    }
                }
            }
        }

    }
    .emulsion-no-sidebar,
    .is-presentation-fse{
        div.wp-block-image{
            &.is-style-shrink{

                &.alignleft{
                    &.size-#{$class}{
                        width:calc( var(--thm_content_width, 720px) / 2 - var(--thm_content_gap, 24px) - 1rem);
                        margin-left: calc((100% - var(--thm_content_width, 720px)) / 2 + var(--thm_content_gap, 24px));
                        @media screen and (max-width: 720px) {
                            width:auto;
                            margin-right:auto;
                        }
                        &.size-thumbnail{
                            width:150px;
                            overflow:visible;
                            .size-thumbnail{
                                padding:0;
                                padding-right:1rem;
                            }
                        }
                        figure{
                            width:100%;
                        }
                    }
                }
                &.alignright{
                    &.size-#{$class}{
                        width:calc( var(--thm_content_width, 720px) / 2 - var(--thm_content_gap, 24px) - 1rem);
                        margin-right: calc((100% - var(--thm_content_width, 720px)) / 2 + var(--thm_content_gap, 24px));
                        @media screen and (max-width: 720px) {
                            width:auto;
                            margin-right:auto;
                        }
                        &.size-thumbnail{
                            width:150px;
                            .size-thumbnail{
                                padding:0;
                                padding-left:1rem;
                            }
                        }
                        figure{
                            width:100%;
                        }
                    }
                }
            }
        }
    }
}




/**
 * For System Theme Color
 * default false
 * @see wp_localize_script( 'emulsion-js', 'emulsion_script_vars', array(...) );
 */

@media (prefers-color-scheme: dark) {
    // example
    .prefers-color-scheme-dark {
        --thm_general_text_color:#eee;
        --thm_general_link_color:#bbb;
        --thm_general_link_hover_color:#eee;
        --thm_background_color:#333;
        --thm_sub_background_color_lighten:#A9A9A9;
        --thm_sub_background_color_darken:#000;
        --thm_primary_menu_background:#000;
        --thm_primary_menu_link_color:#bbb;
        --thm_primary_menu_color:#eee;
        --thm_sidebar_bg_color:#000;
        --thm_sidebar_text_color:#eee;
        --thm_sidebar_link_color:#bbb;
        background:var(--thm_background_color);
    }
}
@media (prefers-color-scheme: light) {
    // example
    .prefers-color-scheme-light{
        --thm_general_text_color:#333;
        --thm_general_link_color:#666;
        --thm_general_link_hover_color:#333;
        --thm_background_color:#eee;
        --thm_sub_background_color_lighten:#fff;
        --thm_sub_background_color_darken:#aaa;
        --thm_primary_menu_background:#333;
        --thm_primary_menu_link_color:#bbb;
        --thm_primary_menu_color:#eee;
        --thm_sidebar_bg_color:#333;
        --thm_sidebar_link_color:#bbb;
        --thm_sidebar_text_color:#eee;
        --thm_social_icon_color:#666;
        background:var(--thm_background_color);
    }
}
/**
 * Exception setting when background image is specified
 *
 * Background images are difficult to achieve automatic contrast,
 * such as images that are close to the background color or completely different from the background color
 *.
 * The following is the style when white is selected as the text color
 * in the background image settings in the customizer settings.
 */
#document{
    .is-singular.emulsion-has-custom-background-image.has-background-img-text-white:not(.noscript){
        header.header-layer ~ .layout-block .page-wrapper .post-navigation,
        header.header-layer ~ .page-wrapper .post-navigation{
            color:#eee;
            text-shadow: #000 1px 0 10px;
            background:transparent;
            a{
                color:#bbb;
            }
            .nav-previous,.nav-next{
                .text{
                    color:#eee;
                }
                &:hover{
                    background: rgba(0,0,0,.2);
                }
            }
        }
        .wp-block-latest-comments article{
            background:transparent;
            .wp-block-latest-comments__comment-date{
                background:transparent;
            }
        }
        .comment-wrapper{
            .comment-body{
                text-shadow:none;
                a{
                    text-shadow:none;
                }
            }
        }
        .emulsion-current-color{
            text-shadow:none;
        }
        .wp-block-latest-posts__post-full-content{
            .wp-block-group{
                position:relative ! important;
                .wp-block-table table{
                    background:transparent;
                }
                .wp-block-pullquote{
                    color: var(--thm_black_color);
                }
            }
            code,
            .wp-block-code,
            // .wp-block-table td,
            .emulsion-current-color,
            .mark-cool,
            .mark-notice,
            .mark-gray,
            .mark-info,
            .nark-alert,
            .wp-block-calendar th,
            .wp-block-calendar td,
            .product,
            .skin-button,
            pre,
            .has-background:not(.has-text-color){
                color: var(--thm_black_color);
                text-shadow:none;
                a{
                    color:var(--thm_gray_color);
                    text-shadow:none;
                }
            }
            .has-background:not(.has-text-color){
                color: var(--thm_black_color);
                text-shadow:none;
                a{
                    color:var(--thm_gray_color);
                    text-shadow:none;
                }
                figcaption{
                    color: var(--thm_black_color);
                    text-shadow:none;
                }
            }
        }
        .emulsion-current-color{
            box-sizing:border-box;
        }
    }
    .is-light.is-singular.emulsion-has-custom-background-image.has-background-img-text-white:not(.noscript){
        /**
         * has background image
         */
        &.custom-background[class].is-dark .layout article *:not(.wp-block-separator),
            &.custom-background[class].is-light .layout article *:not(.wp-block-separator){
            border-color: rgba(188,188,188,.3);
        }
        [data-block],
        .entry-content{
            & > .wp-block-group[style|="background"],
            & > .wp-block-group.has-background,
            & > .wp-block-table > table,
            & > .shortcode-wrapper > div:not(.gallery),
                &  > p:not(.has-text-color),
                & > div:not([class|="wp-block"]):not(.shortcode-wrapper):not(.transparent-block) {
                &.emulsion-initial-color{
                    padding:1rem;
                    color:var(--thm_black_color);
                    a{
                        color:var(--thm_gray_color);
                    }
                    *{
                        color:var(--thm_black_color);
                    }
                }
                &.emulsion-current-color{
                    /**
                     * exception todo
                     */
                    &:not(.has-background){
                        color:var(--thm_general_text_color);
                        background:transparent;
                        a{
                            color: var(--thm_general_link_color);
                            &:hover{
                                color: var(--thm_general_link_hover_color);
                            }
                        }
                    }
                    .wp-block-group__inner-container *:not(.has-background){
                        color:var(--thm_general_text_color);
                    }
                    &.woocommerce,
                    &.wc-block-grid{
                        color:var(--thm_general_text_color);
                        background:transparent;
                        a{
                            color:var(--thm_general_link_color);
                        }
                    }
                }
                &.wp-block-table{
                    &.emulsion-current-color{
                        background:transparent;
                    }
                }
                &.emulsion-add-light-color{
                    color:var(--thm_black_color) ! important;
                    a{
                        color:var(--thm_gray_color);
                    }
                }
                &.emulsion-add-dark-color{
                    color:var(--thm_white_color, #ffffff);
                    a{
                        color:#ccc;
                    }
                    p{
                        color:var(--thm_white_color, #ffffff);
                        &.has-background:not(.has-text-color){
                            color:var(--thm_white_color, #ffffff);
                        }
                    }
                    .post-password-form .message,
                    .wp-block-code,
                    .wp-block-table td,
                    .wp-block-calendar th,
                    .wp-block-calendar td,
                    .product,
                    .skin-button,
                    pre,
                    .has-background:not(.has-text-color){
                        color: var(--thm_black_color);
                        text-shadow:none;
                        a{
                            color:var(--thm_gray_color);
                            text-shadow:none;
                        }
                    }
                }
            }
        }
        &:not(.bbpress) {
            // bbpress css backgroud image remove
            [data-block],
            article,
            .entry-content,
            .emulsion-prepend-page-wrapper{
                *:not(.has-background){
                    --thm_social_icon_color:#ffffff;
                    --thm_general_text_color:#eee;
                    --thm_general_link_color:#bbb;
                    --thm_general_link_hover_color:#eee;
                    --thm_sub_background_color_lighten:#666;
                    --thm_sub_background_color_darken:#000;
                }
                text-shadow: #000 1px 0 10px;
                a{
                    color:var(--thm_silver_color);
                    text-shadow: #000 1px 0 10px;
                }
                .wp-block-navigation-item__content{
                    text-shadow:none;
                }

                .post-password-form .message,
                .wp-block-categories,
                .wp-block-verse,
                .social-navigation{
                    color:var(--thm_white_color, #ffffff);
                }
                .wp-block-code,
                .wp-block-table td,
                .wp-block-calendar th,
                .wp-block-calendar td,
                .product,
                .skin-button,
                pre,
                .has-background:not(.has-text-color){
                    color: var(--thm_black_color);
                    text-shadow:none;
                    a{
                        color:var(--thm_silver_color);
                        text-shadow:none;
                    }
                }
                .mark-cool,
                .mark-notice,
                .mark-gray,
                .mark-info,
                .nark-alert{
                    text-shadow:none;
                    a{
                        text-shadow:none;
                    }
                }
                .has-background,
                blockquote,
                .wp-block-table{
                    text-shadow:none;
                }
                .wp-block-latest-posts li:hover{
                    background:transparent!important;
                }
            }
        }
    }
}
/**
 * No Script Presentation
 */

//body{
body.noscript{

    &.single-post.custom-background.emulsion-has-custom-background-image,
    &.page.custom-background.emulsion-has-custom-background-image{
        background-color:var(--thm_background_color)!important;
        background-image:none;
    }
    .header-layer.header-image-active{
        background:var(--thm_header_bg_color);
        .header-text,
        .entry-text{
            *{
                text-shadow:none ! important;
            }
            &:before{
                display:none;
            }
        }
        .wp-post-image{
            //visibility:hidden;
        }
    }
    figure.wp-block-gallery{
        margin-right:auto;
        margin-left:auto;
    }
    &.enable-alignfull{

        .wp-block-image{
            &.alignwide,
            &.alignfull{
                position:static;
                max-width:100%;
                margin-right:auto;
                margin-left:auto;
            }
        }
        .wp-block-embed{
            height:auto;
            &:after{
                display:block;
                width:100%;
                margin-top:1.5rem;
                margin-bottom:.75rem;
                text-align:center;
                content:'required javascript';
            }
        }
        .wp-block-pullquote.has-background{
            background:#eee!important;
        }
        .wp-block-group.has-background{
            background:#eee;
        }
        .wp-block-button.wp-block-button__link,
        [class*="mark-"]{
            color:#333;
            // .has-background{ //@since 1.1.2 remove
            background:#eee;
        }
        .badge{
            background:#eee;
        }
        .layout ul:not(.list-style-initial):not([id]):not(.is-style-list-style-initial) li:before,
            .layout ol:not(.list-style-initial):not([id]):not(.is-style-list-style-initial) li:before{
            background:var(--thm_default_bullet_color);
        }
        &.is-singular.emulsion-has-custom-background-image.has-background-img-text-white{
            .post-navigation{
                .nav-links{
                    .nav-next:hover,
                        .nav-previous:hover{
                        background:#eee;
                    }
                    *{
                        text-shadow:none;
                    }
                    .prev,.next{
                        color:var(--thm_general_text_color);
                    }
                    a{
                        color:var(--thm_general_text_color);
                    }
                }
            }
        }
    }

    /**
     * when disabled javascript
     */
    .show-content{
        display:none;
    }
    .menu-item-has-children > a:after{
        display:inline-block;
        width: calc(var(--thm_meta_data_font_size) * 1.5);
        height: calc(var(--thm_meta_data_font_size) * 1.5);
        margin-left:.25rem;
        vertical-align:middle;
        //content:'\1f847';
        content:'';
        background: url(../images/svg/arrow-down.svg);
        background-repeat:no-repeat;
        background-position:center;
        background-size:1rem;
    }
    .menu-item-has-children .menu-item-has-children > a:after{
        margin-top:-.5rem;
        margin-left:1rem;
        vertical-align:top;
        transform: rotate(270deg);
    }
    .menu-item-has-children .menu-item-has-children.show-left > a:after{
        margin-top:0.2rem;
        transform: rotate(90deg);
    }
    .search-drawer .search-info{
        display:none;
    }
    .template-part-header{
        .menu-item-has-children .menu-item-has-children > a:after{
            vertical-align:top;
            transform: rotate(90deg);
        }
    }
}
//}
.emulsion-has-sidebar{
    .has-column{
        .page-wrapper{
            main{
                max-width:100%;
            }
        }
        .wp-nav-menu{
            --thm_main_width:calc(100vw - var(--thm_sidebar_width) - 48px );
        }
    }
}
body:not(.emulsion-removed-presentation):not(.emulsion-not-support-presentation){
    .has-column{
        main{
            .stream{
                --thm_content_width:410px;
            }

        }
    }

}
.wp-customizer{
    // for customizer
    .grid{
        --thm_content_width: 300px;
        article{
            --thm_content_width: 100%;
        }
    }
    .stream{
        --thm_content_width: 400px;
        article{
            --thm_content_width: 100%;
        }
    }
}
.layout-stream,
.layout-grid{
    &:not(.emulsion-removed-presentation):not(.emulsion-not-support-presentation){

        .has-column{
            main{
                .stream{
                    --thm_content_width:410px;
                }
            }
        }
        main{
            & > .grid{
                --thm_content_width: 300px;
                article{
                    --thm_content_width: 100%;

                    .entry-meta{
                        display:none;
                    }
                }
            }
            .stream{
                --thm_content_width: 400px;
                article{
                    --thm_content_width: 100%;
                    .content{
                        display:block;
                    }
                    .entry-content{
                        display:none;
                    }
                    &.preview-is-active{
                        .content{
                            display:none;
                        }
                        .entry-content{
                            display:block;
                        }
                    }
                    &:not(.preview-is-active){
                        .content{
                            display:block;
                        }
                        .entry-content{
                            display:none;
                        }
                    }

                }
            }
        }
    }
}
/**
 * Template gallery main width
 */
#document{
    .enable-alignfull{
        &.emulsion-no-sidebar{
            &.post-template-gallery{
                --thm_main_width:100vw;
            }
        }
    }
}
/**
 * Extend block group
 * ========================================================================== */
//body{
body.emulsion-has-sidebar{
    .layout{
        &.has-column{
            .wp-block-group{
                &.grid{
                    @media screen and (max-width: 1120px) {
                        --thm_main_width: calc(100vw);
                        .wp-block-group__inner-container{
                            display:block;
                            &:not(.centered):not(.vertically){
                                height:100%;
                            }
                            [class|="wp-block"]{
                                margin-right:auto;
                                margin-left:auto;
                            }
                        }
                    }
                }
            }
        }
    }
}

body.emulsion-no-sidebar{
    .layout{
        .wp-block-group{

            &.grid{
                &:not(.centered):not(.vertically){
                    height:100%;
                }
                .wp-block-group__inner-container{

                    @media screen and (max-width: 768px) {
                        display:block;
                        [class|="wp-block"]{
                            margin-right:auto;
                            margin-left:auto;
                        }
                    }
                }
            }
        }
    }
}

body.emulsion-gb-phase-site .editor-styles-wrapper .block-editor-block-list__layout.is-root-container{

    .wp-block-group.grid{
        --thm_content_width:720px;
        .wp-block-group__inner-container{
            margin-right:auto;
            margin-left:auto;
        }
    }
    .wp-block-group{
        //.layout{
        &.grid{
            & > .wp-block-group__inner-container{

                display:flex;
                flex-wrap:wrap;
                gap:0;
                padding-top:var(--thm_box_gap, 3px);
                overflow:visible;
                .wp-block-group__inner-container{
                    display:block;
                }
                & > .wp-block{
                    // editor class
                    h1,h2,h3,h4,h5,h6{
                        padding-right:var(--thm_content_gap, 24px);
                        padding-left:var(--thm_content_gap, 24px);
                    }
                }

                & > .grid-child,
                & > .wp-block, // editor class
                & > [class|="wp-block"]{
                    --thm_content_width:720px;
                    box-sizing: border-box;
                    display: block;
                    flex: 0 1 calc( 50% - 6px - var(--thm_box_gap, 3px) * 2 );

                    min-width:0;
                    max-width:100%;
                    margin:var(--thm_box_gap, 3px);
                    margin-right:auto;

                    margin-left:auto;

                    &.columns-2{
                        flex: 0 1 calc( 50% - 6px - var(--thm_box_gap, 3px) * 2 );
                    }
                    &.columns-3{
                        flex: 0 1 calc( 33.33333% - 6px - var(--thm_box_gap, 3px) * 2);
                    }
                    &.columns-4{
                        flex: 0 1 calc( 24.99% - 6px - var(--thm_box_gap, 3px) * 2 );
                    }
                    &.columns-5{
                        flex: 0 1 calc( 19.99% - 6px - var(--thm_box_gap, 3px) * 2 );
                    }
                    &.size1of3 {
                        flex: 0 1 calc( 33.33333% - 6px - var(--thm_box_gap, 3px) * 2);
                        // flex: 0 1 33.33333%;
                    }
                    &.size1of4 {
                        flex: 0 1 calc( 24.99% - 6px - var(--thm_box_gap, 3px) * 2 );
                        //flex: 0 1 24.99%;
                    }
                    &.size1of2 {
                        flex: 0 1 calc( 50% - 6px - var(--thm_box_gap, 3px) * 2 );
                        //flex: 0 1 50%;
                    }
                    &.size1of5 {
                        flex: 0 1 calc( 19.99% - 6px - var(--thm_box_gap, 3px) * 2 );
                        //flex: 0 1 19.99%;
                    }
                    &.size2of3 {
                        flex: 0 1 calc( 66.66666% - 6px - var(--thm_box_gap, 3px) * 2 );
                        //flex: 0 1 66.66666%;
                    }
                    &.size2of5 {
                        flex: 0 1 calc( 40% - 6px - var(--thm_box_gap, 3px) * 2 );
                        // flex: 0 1 40%;
                    }
                    &.size3of4 {
                        flex: 0 1 calc( 75% - 6px - var(--thm_box_gap, 3px) * 2 );
                        // flex: 0 1 75%;
                    }
                    &.size3of5 {
                        flex: 0 1 calc( 60% - 6px - var(--thm_box_gap, 3px) * 2 );
                        //flex: 0 1 60%;
                    }
                    &.size4of5 {
                        flex: 0 1 calc( 80% - 6px - var(--thm_box_gap, 3px) * 2 );
                        // flex: 0 1 80%;
                    }

                }
                & > .wp-block-group{
                    margin:0;
                }
                .centered{
                    display:flex;
                    height:auto;
                }
                .wp-block-image{
                    width:100%;
                    margin:0;
                    img {
                        display:block;
                        width: 100%;
                        max-width: 100%;
                        height: 100%;
                        object-fit: cover;
                    }
                }
            }
        }
        //}
    }
}
body .wp-site-blocks,
body .layout{

    .wp-block-group.grid{
        --thm_content_width:720px;
        .wp-block-group__inner-container{
            margin-right:auto;
            margin-left:auto;
        }
    }
    .wp-block-group{
        &[class|="wp-container"]{
            //width:100%;

            padding:0;
            margin:0 auto;
            overflow:hidden;
        }
        &.grid{
            display: flex;
            flex-wrap: wrap;
            align-items: stretch;
            justify-content: center;
            max-width: 100%;
            padding: 0;
            margin-top: var(--thm_content_gap, 24px);
            overflow: visible;
            .wp-block-group:not(#specificity){
                margin:var(--thm_box_gap, 3px);

                .wp-block-image{
                    padding:0;
                    margin:0;
                }
            }
        }
        &.grid-group{
            [class|="wp-block"]{
                margin-top:var(--thm_box_gap, 3px);
                margin-bottom:var(--thm_box_gap, 3px);
            }
        }
        &.grid{

            & > .wp-block-group__inner-container{

                display:flex;
                flex-wrap:wrap;
                gap:0;
                justify-content: center;
                width:inherit;
                padding-top:var(--thm_box_gap, 3px);
                overflow:visible;
            }

            & > .wp-block-group figure:only-child{
                height:100%;
                img{
                    max-width:none;
                }
            }

            & > .wp-block{
                // editor class
                h1,h2,h3,h4,h5,h6{
                    padding-right:var(--thm_content_gap, 24px);
                    padding-left:var(--thm_content_gap, 24px);
                }
            }
            & > .grid-child,
            & > .wp-block, // editor class
            & > [class|="wp-block"]:not(.wp-block-group__inner-container){
                --thm_content_width:720px;
                box-sizing: border-box;
                display: block;
                flex: 0 1 calc( 50% - 5px - var(--thm_box_gap, 3px) * 2 );

                min-width:0;
                max-width:100%;
                margin:var(--thm_box_gap, 3px);
                margin-right:auto;

                margin-left:auto;

                .wp-block-group__inner-container{
                    display:block;
                }

                &.columns-2{
                    flex: 0 1 calc( 50% - 5px - var(--thm_box_gap, 3px) * 2 );
                }
                &.columns-3{
                    flex: 0 1 calc( 33.33333% - 5px - var(--thm_box_gap, 3px) * 2);
                }
                &.columns-4{
                    flex: 0 1 calc( 24.99% - 5px - var(--thm_box_gap, 3px) * 2 );
                }
                &.columns-5{
                    flex: 0 1 calc( 19.99% - 5px - var(--thm_box_gap, 3px) * 2 );
                }
                &.size1of3 {
                    flex: 0 1 calc( 33.33333% - 5px - var(--thm_box_gap, 3px) * 2);
                    //flex: 0 1 33.33333%;
                }
                &.size1of4 {
                    flex: 0 1 calc( 24.99% - 5px - var(--thm_box_gap, 3px) * 2 );
                    // flex: 0 1 24.99%;
                }
                &.size1of2 {
                    flex: 0 1 calc( 50% - 6px - var(--thm_box_gap, 3px) * 2 );
                    // flex: 0 1 50%;
                }
                &.size1of5 {
                    flex: 0 1 calc( 19.99% - 5px - var(--thm_box_gap, 3px) * 2 );
                    //flex: 0 1 19.99%;
                }
                &.size2of3 {
                    flex: 0 1 calc( 66.66666% - 5px - var(--thm_box_gap, 3px) * 2 );
                    //  flex: 0 1 66.66666%;
                }
                &.size2of5 {
                    flex: 0 1 calc( 40% - 5px - var(--thm_box_gap, 3px) * 2 );
                    //  flex: 0 1 40%;
                }
                &.size3of4 {
                    flex: 0 1 calc( 75% - 5px - var(--thm_box_gap, 3px) * 2 );
                    // flex: 0 1 75%;
                }
                &.size3of5 {
                    flex: 0 1 calc( 60% - 5px - var(--thm_box_gap, 3px) * 2 );
                    // flex: 0 1 60%;
                }
                &.size4of5 {
                    flex: 0 1 calc( 80% - 5px - var(--thm_box_gap, 3px) * 2 );
                    // flex: 0 1 80%;
                }

            }
            & > .wp-block-group{
                // margin:0;
            }
            .centered{
                display:flex;
                height:auto;
            }
            .wp-block-image{
                width:100%;
                margin:0;
                // min-height:100%;
                img {
                    display:block;
                    width: 100%;
                    max-width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
            //}
        }
    }

}
//}
/**
 * sizes
 */
.full_text{
    .size1of1 {
        float:none;
    }
    .size1of1,
    .size1of2,
    .size1of3,
    .size2of3,
    .size1of4,
    .size3of4,
    .size1of5,
    .size2of5,
    .size3of5,
    .size4of5 {
        box-sizing:border-box;
        display:inline-block;
        margin:var(--thm_box_gap, 3px);
        margin-bottom:calc( var(--thm_box_gap, 3px) * 2 );
        vertical-align:top;
        //     min-width: var(--thm_content_min_width);
        &.aligncenter{
            display:block;
            margin-right:auto;
            margin-left:auto;
        }
    }
    .alignleft{
        &.size1of3,
        &.size1of4,
        &.size1of5,
        &.size2of5{
            margin-right:1rem;
        }
    }
    .alignright{
        &.size1of3,
        &.size1of4,
        &.size1of5,
        &.size2of5{
            margin-left:1rem;
        }
    }
    figure{
        &.size1of1,
        &.size1of2,
        &.size1of3,
        &.size2of3,
        &.size1of4,
        &.size3of4,
        &.size1of5,
        &.size2of5,
        &.size3of5,
        &.size4of5{
            margin-bottom:calc( var(--thm_box_gap, 3px) * 2 );
            &.wp-block-embed{
                display:inline-block;
                height:auto;
                @include clearfix;
            }
            &.alignleft{
                margin-right:1rem;
            }
            &.alignright{
                margin-left:1rem;
            }
        }
    }

    .size1of3 {
        width: calc( 33.33333% - 5px - var(--thm_box_gap, 3px) * 2);
    }
    .size1of4 {
        width: calc( 24.99% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size1of2 {
        width: calc( 50% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size1of5 {
        width: calc( 19.99% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size2of3 {
        width: calc( 66.66666% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size2of5 {
        width: calc( 40% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size3of4 {
        width: calc( 75% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size3of5 {
        width: calc( 60% - 5px - var(--thm_box_gap, 3px) * 2 );
    }
    .size4of5 {
        width: calc( 80% - 5px - var(--thm_box_gap, 3px) * 2 );
    }

    .alignleft{
        &.size1of3 {
            width:100%;
            max-width: calc( 33.33333% - 1rem - var(--thm_box_gap, 3px) * 2);
        }
        &.size1of4 {
            width:100%;
            max-width: calc( 24.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of2 {
            width:100%;
            max-width: calc( 50% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of5 {
            width:100%;
            max-width: calc( 19.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of3 {
            width:100%;
            max-width: calc( 66.66666% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of5 {
            width:100%;
            max-width: calc( 40% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of4 {
            width:100%;
            max-width: calc( 75% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of5 {
            width:100%;
            max-width: calc( 60% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size4of5 {
            width:100%;
            max-width: calc( 80% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
    }
    .alignright{
        &.size1of3 {
            width:100%;
            max-width: calc( 33.33333% - 1rem - var(--thm_box_gap, 3px) * 2);
        }
        &.size1of4 {
            width:100%;
            max-width: calc( 24.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of2 {
            width:100%;
            max-width: calc( 50% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of5 {
            width:100%;
            max-width: calc( 19.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of3 {
            width:100%;
            max-width: calc( 66.66666% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of5 {
            width:100%;
            max-width: calc( 40% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of4 {
            width:100%;
            max-width: calc( 75% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of5 {
            width:100%;
            max-width: calc( 60% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size4of5 {
            width:100%;
            max-width: calc( 80% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
    }
    .aligncenter{
        &.size1of3 {
            width:100%;
            max-width: calc( 33.33333% - 1rem - var(--thm_box_gap, 3px) * 2);
        }
        &.size1of4 {
            width:100%;
            max-width: calc( 24.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of2 {
            width:100%;
            max-width: calc( 50% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size1of5 {
            width:100%;
            max-width: calc( 19.99% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of3 {
            width:100%;
            max-width: calc( 66.66666% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size2of5 {
            width:100%;
            max-width: calc( 40% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of4 {
            width:100%;
            max-width: calc( 75% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size3of5 {
            width:100%;
            max-width: calc( 60% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
        &.size4of5 {
            width:100%;
            max-width: calc( 80% - 1rem - var(--thm_box_gap, 3px) * 2 );
        }
    }
    > .alignleft{
        &.size1of3{
            max-width: calc( 33.33333% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2);
            margin-left:var(--thm_content_gap, 24px);
        }
        &.size1of4{
            max-width: calc( 24.99% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-left:var(--thm_content_gap, 24px);
        }
        &.size1of5{
            max-width: calc( 19.99% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-left:var(--thm_content_gap, 24px);
        }
        &.size2of5{
            max-width: calc( 40% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-left:var(--thm_content_gap, 24px);
        }
    }
    > .alignright{
        &.size1of3{
            max-width: calc( 33.33333% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2);
            margin-right:var(--thm_content_gap, 24px);
        }
        &.size1of4{
            max-width: calc( 24.99% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-right:var(--thm_content_gap, 24px);
        }
        &.size1of5{
            max-width: calc( 19.99% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-right:var(--thm_content_gap, 24px);
        }
        &.size2of5{
            max-width: calc( 40% - 1rem - var(--thm_content_gap, 24px) - var(--thm_box_gap, 3px) * 2 );
            margin-right:var(--thm_content_gap, 24px);
        }
    }
}


[id="document"]:not(.emulsion-fse-stopped){
    //CSS to not affect fse
    .wp-block-group.grid{
        .size1of3,
        .size1of3,
        .size1of4,
        .size1of2,
        .size1of5,
        .size2of3,
        .size2of5,
        .size3of4,
        .size3of5,
        .size4of5 {
            //  width: auto;
        }
    }
}