//
//  Common
//  _____________________________________________

& when (@media-common = true) {
    .is-blog {

        //
        //  Wordpress Classes
        //  ---------------------------------------------

        .alignleft {
            display: inline-block;
            float: left;
            margin-right: 1.5em;
        }
        .alignright {
            display: inline-block;
            float: right;
            margin-left: 1.5em;
        }
        .aligncenter {
            clear: both;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        img.size-large,
        img.size-full {
            width: 100%;
        }

        //
        //  Wordpress Fix Related to app/code/DJOGlobal/ExtFishPigWordPress/Plugin/AfterGetContentFormatting.php
        //  ---------------------------------------------

        .product-item-info br {
            display: none;
        }

        //
        //  Blog Page
        //  ---------------------------------------------

        ol.post-list,
        ol.comment-list {
            .lib-list-reset-styles();
        }
        .post-list-description {
            .lib-font-size(18);
            font-style: italic;
            margin-bottom: 16px;
        }
        .post-list-wrapper {
            border-top: 1px solid @djo-header-border-color;
            margin-top: 10px;
            padding-top: 25px;
        }
        .post-list > li {
            .lib-clearfix();
            &:not(:last-child) {
                border-bottom: 1px solid @djo-header-border-color;
                margin-bottom: 40px;
                padding-bottom: 40px;
            }
        }
        .post-list {
            .post-meta {
                a {
                    color: @djo-gray;
                    &:hover {
                        color: @djo-blue;
                    }
                }
                .post-categories,
                .post-tags {
                    color: @djo-gray-light;
                    strong {
                        color: @djo-gray;
                    }
                    a {
                        color: @djo-gray-light;
                    }
                }
            }
        }

        //
        //  Single Post
        //  ---------------------------------------------

        .post-image {
            img {
                transition: all .3s ease-in-out;
            }
        }
        .post-meta {
            clear: both;
            color: @djo-gray;
            font-weight: 700;
            text-align: left;
            text-transform: uppercase;
        }
        .post-meta-item {
            display: inline-block;
        }
        .post-meta-label {
            .lib-visually-hidden();
        }
        .post-date::after {
            color: @djo-gray-light;
            content: '//';
            margin-left: 10px;
            margin-right: 10px;
        }
        .post-entry {
            margin-bottom: 20px;
            overflow: hidden;
            iframe {
                max-width: 100%;
            }
        }
        .post-excerpt {
            ul,
            ol {
                margin-bottom: @list__margin-bottom;
            }
        }
        .post-title {
            margin-bottom: 16px;
            margin-top: 8px;
        }
        .post-readmore {
            margin-top: 10px;
        }
        .post-tags {
            margin-top: 8px;
        }
        .addthis_buttons_container {
            margin-top: 20px;
        }

        //
        //  Pages
        //  ---------------------------------------------

        .pager {
            margin-top: 40px;
            text-align: center;
        }
        .toolbar-amount {
            .lib-visually-hidden();
        }

        //
        //  Comments
        //  ---------------------------------------------

        .comments-wrapper {
            margin-top: 30px;
            .legend {
                .lib-font-size(20);
                border-bottom: 1px solid @djo-gray-light;
                font-weight: 700;
                line-height: 1.1;
            }
        }
        .comment-list-item {
            margin: 0 0 30px;
        }
        .comment-list.children {
            margin-left: 30px;
            margin-top: 30px;
        }
        .comment-image {
            float: left;
            margin: 0 10px 10px 0;
        }
        .comment-author {
            display: block;
            font-weight: 700;
        }
        .comment-entry {
            clear: both;
            margin: 0 0 20px;
        }

        //
        //  Sidebar
        //  ---------------------------------------------

        .wp-sidebar {
            .block {
                background-color: #f8f8f8;
                padding: 25px 30px;
                &:not(:last-child) {
                    margin-bottom: 30px;
                }
            }
        }
        .block-blog {
            .block-title {
                .lib-font-size(20);
                line-height: 1.1;
                margin-bottom: 16px;
            }
            ul,
            ol {
                .lib-list-reset-styles();
                li {
                    line-height: 1.25;
                    &:not(:last-child) {
                        border-bottom: 1px solid #ddd;
                        margin-bottom: 10px;
                        padding-bottom: 10px;
                    }
                }
            }
        }
        .block-blog.related-products {
            ul,
            ol {
                li {
                    &:not(:last-child) {
                        border-bottom: none;
                        margin-bottom: 0;
                        padding-bottom: 0;
                    }
                }
            }

        }
        .block-blog-archives table {
            table-layout: fixed;
        }
        .block-blog-categories ul.level1 {
            margin-top: 1rem;
        }
        .block-blog-cloud li {
            display: inline;
            margin: 0;
        }
        .block-blog-search .blog-search {
            .lib-clearfix();
            .input-text {
                margin-bottom: 5px;
            }
            .button {
                .lib-font-size(14);
                float: right;
                font-weight: 400;
                height: 34px;
                line-height: 34px;
                padding: 0 16px;
            }
        }
    }

    .is-blog {
        #maincontent {
            max-width: 1920px;
        }
    }

    .is-blog {
        .page-main > .page-title-wrapper .page-title {
            word-wrap: break-word;
        }

        .block.block-blog-homepage.block-blog-top {
            margin: 0 -2rem 55px;

            .hero-banner-wrapper {
                position: relative;
                overflow: hidden;
                width: 100%;
                padding-bottom: 30%;
                background-color: #000;

                .hero-image-text {
                    .lib-font-size(22);
                    position: absolute;
                    bottom: 0;
                    z-index: 99;
                    color: #FFF;
                    padding: 0 30px;
                }

                img.hero-image {
                    max-width: 100%;
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    padding: 0;
                    transform: translate(-50%) translateY(-50%);
                    width: 100vw;
                }
            }

            .blog-homepage-description {
                .lib-font-size(18);
                margin: -15px 4% -25px;
                text-align: center;
            }
        }

        .top-block-wrapper {
            .block.block-blog.block-blog-search {
                max-width: 350px;

                .block-title {
                    display: none;
                }

                .block-content {
                    form#blog-search-form {
                        .control {
                            position: relative;

                            &::before {
                                background: center / 25px no-repeat url('@{baseDir}DJOGlobal_ExtFishPigWordPress/images/blog/search-icon-right.svg');
                                color: #000;
                                content: '';
                                display: block;
                                position: absolute;
                                width: 35px;
                                height: 35px;
                                top: 4px;
                                left: 4px;
                                z-index: 9;
                            }

                            input {
                                font-size: 2.2rem;
                                text-transform: uppercase;
                                font-weight: 600;
                                border: 4px solid #000;
                                padding-left: 40px;
                                height: 45px;

                                &::placeholder, &::-webkit-input-placeholder, &::-moz-placeholder, &:-ms-input-placeholder {
                                    color: #000;
                                }
                            }
                        }
                    }

                    .actions-toolbar {
                        display: none;
                    }
                }
            }
        }

        .block-blog-categories-menu {
            background-color: @djo-blue;

            #wp-category-menu {
                .lib-list-reset-styles();
                display: flex;
                flex-flow: row wrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                justify-content: center;
                max-width: 1440px;
                margin: 0 auto;

                li.level0 {
                    flex: 0 0 50%;
                    position: relative;
                    display: flex;
                    border: none;
                    overflow: hidden;
                    justify-content: center;
                    align-items: center;
                    padding: 0;
                    margin: 0;

                    a.level0 {
                        .lib-font-size(18);
                        text-transform: uppercase;
                        color: #FFF;
                        text-decoration: none;
                        display: block;
                        text-align: center;
                        padding: 20px 0;
                        overflow-wrap: anywhere;

                        .icon-wrapper {
                            display: none;
                            padding: .5rem 0;
                            margin-top: -20px;
                            min-height: 90px;

                            img {
                                display: block;
                                margin: 0 auto;
                                max-height: 90px;
                                background-repeat: no-repeat;
                                background-position: center;
                            }
                        }

                        > span {

                        }
                    }
                }
            }
        }

        .post-list-description {
            .lib-font-size(30);
            font-style: normal;
            font-weight: 600;
            margin-bottom: 16px;
        }

        .post-list-wrapper {
            border: none;
            margin-top: 0;
            padding-top: 0;

            ol.post-list {
                display: flex;
                flex-direction: column;

                li.item {
                    border: none;
                    padding-bottom: 0;

                    .post-list-item {
                        .post-meta {
                            background-color: @djo-blue;
                            padding: 15px;
                            //height: 80px; // use match-height
                            line-height: 1;

                            .post-meta-item {
                                display: inline-block;
                                .lib-font-size(14);
                                color: #FFF;

                                &::after {
                                    color: #FFF;
                                }

                                a {
                                    color: #FFF;
                                }
                            }
                        }

                        .post-image {
                            width: 100%;

                            a {
                                position: relative;
                                overflow: hidden;
                                display: block;

                                &::before {
                                    content: "";
                                    display: block;
                                    padding-bottom: 60%;
                                }

                                &::after {
                                    content: "";
                                }

                                img {
                                    position: absolute;
                                    top: 50%;
                                    left: 50%;
                                    padding: 0;
                                    transform: translate(-50%) translateY(-50%);
                                    width: 100%;
                                }
                            }
                        }

                        .post-title {
                            .lib-font-size(20);
                            .lib-css(font-weight, 700);
                            margin-bottom: 0;

                            a {
                                color: #FFF;

                                &:hover {
                                    color: #FFF;
                                }
                            }
                        }
                    }
                }
            }
        }

        &.wordpress-post-view {
            .post-view {
                > .post-image {
                    width: 100%;
                }

                .post-date {
                    color: @djo-gray-light;

                    &::after {
                        content: '';
                    }
                }

                .post-title {
                    color: @djo-blue;
                }

                .post-categories a {
                    border: 2px solid @djo-blue;
                    display: inline-block;
                    padding: 5px;
                    margin: 5px;
                }

            }

            .post-user.post-meta-item {
                display: none;
            }
        }
    }
}


//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .is-blog {
        .page-main > .page-title-wrapper .page-title {
            .lib-font-size(33);
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .is-blog {
        .post-image {
            a {
                width: 100%;
            }
            img {
                width: 100%;
            }
        }

        .block-blog-categories-menu {
            #wp-category-menu {
                li.level0 {
                    a.level0 {
                        .lib-font-size(16) !important;
                        padding: 10px 0 !important;
                    }
                }
            }
        }
    }
}


//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
    .is-blog.page-layout-1column {
        .post-list-wrapper {
            ol.post-list {
                flex-direction: row;
                flex-flow: row wrap;
                justify-content: space-between;

                li.item {
                    flex: 0 0 48%;
                }
            }
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .is-blog.page-layout-2columns-right {
        .column.main {
            width: 70%;
        }
        .sidebar-main {
            padding-left: 2%;
            width: 30%;
        }
    }

    .is-blog.page-layout-1column {
        .post-list-wrapper {
            ol.post-list {
                flex-direction: row;
                flex-flow: row wrap;
                justify-content: space-between;

                li.item {
                    flex: 0 0 31%;
                }
            }
        }
    }
    .is-blog.page-layout-2columns-right {
        .post-list-wrapper {
            ol.post-list {
                flex-direction: row;
                flex-flow: row wrap;
                justify-content: space-between;

                li.item {
                    flex: 0 0 48%;
                }
            }
        }
    }

    .is-blog {
       .block-blog-categories-menu {
            #wp-category-menu {
                li.level0 {
                    flex: 0 0 25%;

                    a.level0 {
                        .icon-wrapper {
                            display: block;
                        }
                    }
                }
            }
        }
    }

    .is-blog {
        &.page-products .sidebar-main .block .title {
            background-color: inherit;
            border-bottom: none;
            border-top: none;
            padding-bottom: 0;
            padding-left: 0;
            padding-top: 0;
        }
        &.page-products .sidebar-main .block .title strong {
            font-weight: 700;
            line-height: 1.1;
            font-size: 2rem;
            margin-top: 2.2rem;
            margin-bottom: 2.2rem;
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m + 1) {
    .is-blog {
        .block.block-blog-homepage.block-blog-top {
            .hero-banner-wrapper {
                .hero-image-text {
                    .lib-font-size(32);
                    padding: 30px
                }
            }

            .blog-homepage-description {
                .lib-font-size(22);
            }
        }
        .post-image {
            width: 50%;

            a {
                display: inline-block;
                font-size: 0;
                overflow: hidden;

                img {
                    transition: all .3s ease-in-out;
                }
                &:hover,
                &:focus {
                    img {
                        opacity: .9;
                        transform: scale(1.03);
                    }
                }
            }
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {
    .is-blog {
        .block-blog-categories-menu {
            #wp-category-menu {
                li.level0 {
                    flex: 1 0 0;
                }
            }
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__1240) {
    .is-blog.page-products {
        .wp-sidebar {
            .products-grid .product-item {
                width: 100%;
                background: #fff;
                margin-bottom: 16px;
            }
            .products-grid .product-item-info {
                padding-left: 10px;
                padding-right: 10px;
            }
        }
        .sidebar .product-items .product-item-info .product-item-photo {
            float: none;
            left: auto;
            margin: 0 0 11px 0;
            position: relative;
            top: auto;
        }
        .sidebar .product-items .product-item-details {
            margin-left: 0;
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__1600) {
    .is-blog.page-products {
        .wp-sidebar {
            .products-grid .product-item {
                width: 49%;
            }
            .products-grid .product-item:nth-child(2n + 1) {
                margin-right: 2%;
            }
        }
    }
}
