@import "../../../../../../assets/css/abstracts/custom-variables.scss";

.blog-item {
    margin: 0;

    .blog-item__image-wrapper {
        height: 113px;
        width: 150px;
        overflow: hidden;
    }
    .blog-item__image-link {
        display: block;
    }

    .blog-item__image {
        height: 113px;
        width: 150px;
        object-fit: cover;
    }

    .media-heading {
        margin: 0;
        font-size: 15px;
        color: #000;
        max-height: 65px;
        overflow: hidden;
        font-weight: bold;

        .blog-item__title-link {
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 21px;              /* fallback */
            max-height: 42px;               /* fallback */
            -webkit-line-clamp: 2;          /* number of lines to show */
            -webkit-box-orient: vertical;

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


.tile-blog-component.grid-stack-item-6[data-gs-width="1"] {
    .blog-item {
        .blog-item__image {
            max-width: 150px;
            width: 100%;

            img {
                max-width: 150px;
                width: 100%;
            }
        }
    }
}

// media queries

// 1 column width

.tile-blog-component[data-gs-width="1"] {
    .blog-item {

        .media-body {
            padding: 0;

            @media only screen and (max-width: 1200px) and (min-width: 768px) {
                display: block;
                width: 100%;
            }
        }

        // --- HIDE DESCRIPTION ----
        .blog-item__info, .blog-item__description {
            @media only screen and (min-width: 400px) and (max-width: 768px) {
                overflow: hidden;
                text-overflow: ellipsis;
                display: block;
                margin: 0;
            }
        }

        .blog-item__image {
            @media only screen and (max-width:1200px) and (min-width:768px) {
                margin-bottom: 10px;
                display: block;
            }

            @media only screen and (min-width: 768px){
                height: 75px;
                width: 100px;
                max-width: 100px;
            }
        }

        .likes, .comments {
            font-size: 0.7rem;
            width: auto;
            
            ion-icon {
                vertical-align: middle;
            }
        }

        .profile-img {
            display: none;
        }
    }

}

.tile-blog-component.grid-stack-item-6[data-gs-width="1"] {
    .post-wide {
        width: 100%;
    }
    .post-hide {
        display: none;
    }
}

// Display blog under 400px width

@media only screen and (max-width:400px) {
    .tile-blog-component {
        .blog-item .media-body {
            padding: 0;
        }

        .blog-item__image-link, .blog-item__image-link .blog-item__image {
            height: 75px;
            width: 100px;
            max-width: 100px;
        }
    }
}

@media only screen and (max-width:767px) {
    .tile-blog-component {
        .profile-img {
            display: none;
        }
    }
}

@media only screen and (max-width:980px) {
    .tile-blog-component.grid-stack-item-6[data-gs-width="1"] {
        .post-wide {
            width: 50%;
        }
        .post-hide {
            display: block;
        }
    }
}

// -------------------------
// ----- BLOG COMPONENT
// -------------------------
.blog-footer {
    .glyphicons.glyphicons-comments {
        color: $gray-600;
        width: 15px;
        height: 15px;
        text-align: center;
        vertical-align: top;
        font-size: 13px;
    }

    a {
        &:hover {
            text-decoration: none;
            transition: 0.3s;
            -webkit-transition: 0.3s;
        }
    }

    .comments, .likes {
        float: left;

        ion-icon {
            vertical-align: baseline;
            font-size: 0.7rem;
        }
    }

    .comments {
        width: 30%;
    }

    .blog-icon-comments {
        float: right;
    }

    .likes {
        width: 70%;
    }

    .text-right,
    .text-left,
    .view-all,
    .tags a {
        display: inline-block;
        vertical-align: sub;
    }
    .tags a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
        &:nth-of-type(1) ~ a {
            display: none !important;
        }

        @media only screen and (max-width: 1070px) {
            max-width: 70px;
        }
    }
    .text-right {
        float: right;
        @media only screen and (max-width: 420px) {
            float: none;
            display: block;
            text-align: left;
        }
    }
    .like-component {
        display: inline-block;

        .liked.liked {
            border-right: 1px solid $gray-400;
            margin-right: 3px;
            padding-right: 6px;
            display: inline-block;
        }
    }
}

.tile-blog-posts[data-gs-width="1"] {
    .blog-footer {
        margin-top: 5px;
        .glyphicons {
            font-size: 12px;
            width: 12px;
        }
        .news-icon-comments {
            float: left;
        }
    }
    .blog-footer .comments, .blog-footer .likes {
        width: 100%;
    }
}
