
@import "../../../../../../assets/css/abstracts/custom-variables.scss";
@import '~bootstrap/scss/_functions';
@import '~bootstrap/scss/_variables';
@import '~bootstrap/scss/mixins/_breakpoints';


// ------------------------------
// CARD & LIST UNIVERSAL STYLING
// used for styling of card and list news
// ------------------------------

// --------------------------
// --- GLOBAL NEWS WITH TITLE --------
// --------------------------

.tile-news-component {
    .content-block {
        border-top-left-radius: 0px;
        border-top-right-radius: 0px;
    }
}

.tile-news-component {
    .hide-header + .content-block {
        border-top-left-radius: inherit;
        border-top-right-radius: inherit;
    }
}

.news-card {
    position: relative;
    background: #fff;
    overflow: hidden;

    .news-title {
        margin-bottom: 10px;
        font-weight: bold;
    }

    .news-date {
        display: block;
    }

    .news-title {
        margin: 0;
        font-size: 15px;
        color: #000;
        overflow: hidden;

        a {
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 21px;              /* fallback */
            max-height: 48px;               /* fallback */
            -webkit-line-clamp: 2;          /* number of lines to show */
            -webkit-box-orient: vertical;
            &:hover {
                text-decoration: none;
            }
        }
    }

}

.news-footer {
    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%;
    }
    .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;
        }

        .glyphicons.glyphicons-thumbs-up {
            font-size: 12px;
            width: 12px;
        }
    }
}


// ----------
// --- GLOBAL IMAGE STYLING --------
// ----------

.news-image-wrapper {
    background-repeat: no-repeat;
}

// ----------
// --- FIT/FILL IMAGE FORMATTING --------
// ----------
//Slider & List
.news-slider,
.news-list__image-wrapper {
    &.image-style-cover {
        background-size: cover;
    }

    &.image-style-contain {
        background-size: contain;
    }
}
//Card
.news-card {
    .image-style-contain {
        object-fit: contain;
    }

    .image-style-cover {
        object-fit: cover;
    }
}

@media only screen and (max-width:768px){
    .news-card .news-footer {
        font-size: 14px;
        .glyphicons {
            font-size: 15px;
            width: 15px;
        }
    }
}

.tile-news-component .content-block {
    background: #fff;
    border-bottom-left-radius: var(--theme-rounded-corners);
    border-bottom-right-radius: var(--theme-rounded-corners);
}

// --------------------------
// --- PORTRAIT NEWS --------
// specific styling for portrait news cards
// --------------------------

.tile-news-component {
    .news-card.portrait-news {
        height: 369px;

        .news-image-wrapper {
            position: relative;

            .news-image {
                height: 199px;
            }
        }

        .news-content {
            height: 195px;

            .news-description {
                margin-top: 5px;
                margin-right: 15px;
                margin-bottom: 15px;
                color: $gray-800;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                word-wrap: break-word;
                position: relative;
                &:empty {
                    display: none;
                }
            }

            // NEWS GRADIENT
            &::after {
                content: '';
                background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
                background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);
                background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);
                filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );
                height: 35px;
                width: 100%;
                position: absolute;
                bottom: 40px;
                left: 0;
            }
        }

        .news-footer {
            clear: both;
            color: $gray-500;
            background: #fff;
            font-size: 11px;
            padding: 12px 15px;
            position: absolute;
            width: 100%;
            left: 0;
            right: 0;
            bottom: 0;
        }
    }

    // --- CARD NEWS WITHOUT TITLE --------
    .hide-header + .content-block {
        .news-card.portrait-news {
            height: 382px;
        }
    }
}

// --- LIST -----------------
// specific styling for list news cards
// --------------------------

// Maintains white background in list view when rounded corners is selected
.grid-stack .tile-news-component.list-style{
    .panel {
        background: #fff ;
    }
}


// --------------------------
// --- LIST LAYOUT ----------
// --------------------------

.tile-news-component.list-style {
    .content-block {
        margin: 0;
    }
}
// ---------------
//  LIST NEWS IMAGES --
// ---------------
.news-card.list-news {
    margin: 0;
    .news-image-wrapper {
        position: relative;
    }
    .news-list__image-wrapper {
        height: 113px;
        width: 150px;
        overflow: hidden;
    }
}


// ---------------
//  LIST NEWS BODY ----
// ---------------

.news-card.list-news {

    .news-description {
        margin-top: 10px;
    }

    .news-sticky {
        margin: 0 0px 0 9px;
        padding-left: 6px;
        display: inline-block;
        border-left: 1px solid $gray-200;
    }
    .news-icon-comments {
        float: right;
    }
    .news-footer {
        font-size: 11px;
    }
}


// ---------------
//  LIST NEWS - 1 BLOCK WIDE SPECIFIC STYLING
// ---------------


.tile-news-component[data-gs-width="1"] {
    .news-card.list-news  {
        // --- TITLE ----
        .news-title {
            margin: 0;
            font-size: 14px;
            a {
                line-height: 18px;
            }
        }
        // --- HIDE DESCRIPTION ----
        .news-description {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
            max-width: 130px;
            margin: 0;
        }
        // --- SMALLER IMAGE----
        .news-list__image-wrapper {
            height: 75px;
            width: 100px;
            max-width: 100px;
        }
        // --- FOOTER ----
        .news-footer {
            margin-top: 5px;
            .glyphicons {
                font-size: 12px;
                width: 12px;
            }
            .news-icon-comments {
                float: left;
            }
        }
        .news-footer .comments, .news-footer .likes {
            width: 100%;
        }
    }
}


// ---------------
//  LIST NEWS - 1 BLOCK WIDE SPECIFIC STYLING - LAYOUT FIXES UNDER 1200PX
// ---------------

@media only screen and (max-width:1200px) and (min-width:768px) {
    .tile-news-component[data-gs-width="1"] {
        .news-image-wrapper {
            margin-bottom: 10px;
            display: block;
        }
        .media-body {
            display: block;
            width: 100%;
        }
    }
}


// --- Set's list image to 80px width on smaller screens ----
@include media-breakpoint-down(md) {
    .tile-news-component .news-card.list-news .news-image .news-list__image-wrapper {
        height: 60px;
        width: 80px;
        max-width: 80px;
    }
}


// --------------------------
// --- SLIDER LAYOUT --------
// --------------------------

// ---------------
//  SLIDER SET UP
// ---------------

// --------------------------
// --- SLIDER NEWS WITH TITLE --------
// --------------------------
.tile-news-component {
    .slider-news-wrapper .owl-wrapper-outer {
        border-top-left-radius: 0px;
        border-top-right-radius: 0px;
    }
}



.slider-style {
    margin: 0 0 20px;
}

.slider-news-wrapper.owl-carousel {
    .owl-dots {
        position: absolute;
        top: 10px;
        left: 10px;
        margin-top: 0 !important;

        .owl-dot {
            display: inline-block;
            position: relative;
            width: 12px;
            height: 12px;
            margin: 5px;
            opacity: .5;
            border-radius: 10rem;
            background: #fff;
        }

        .owl-dot:hover {
            opacity: 1;
        }

        .owl-dot.active {
            opacity: 1;

            span {
                position: absolute;
                background: var(--theme-primary-color);
                height: 6px;
                width: 6px;
                border-radius: 350px;
                left: 0;
                top: 0;
                margin: 3px;
            }
        }
    }
}



// ---------------
//  SLIDER NEWS IMAGES --
// ---------------
.news-slider {
    height: 100%;
}

// ---------------
//  SLIDER NEWS IMAGES -- TRANSPARENT AND FULL HEIGHT
// ---------------
.grid-stack-item.tile-news-component.slider-style.transparent-tile {
    .panel, .content-block{
        background-color: transparent;
        height: 100%;
    }
}

// ---------------
//  SLIDER NEWS IMAGES -- APPLIES BORDER RADIUS BASED ON THEME SETTINGS
// ---------------
.tile-news-component .slider-news-wrapper .owl-wrapper-outer {
    border-bottom-left-radius: var(--theme-rounded-corners);
    border-bottom-right-radius: var(--theme-rounded-corners);
}


// ---------------
//  SLIDER NEWS BODY --
// ---------------
.news-slider {

    .image-only-news-body {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 9
    }

    .news-body {
        position: absolute;
        z-index: 10;
        padding: 30px 40px;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        justify-content: center;
        flex-direction: column;
        text-align: left;
        background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.67) 0%, rgba(0, 0, 0, 0.35) 74%, rgba(0, 0, 0, 0.20) 100%);


        * {
            color: white;
        }

        .meta-data {
            margin-bottom: 10px;
        }
        .news-title {
            margin: 0 0 10px 0;

            .news-title-link {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                display: block;
            }

            a:hover {
                text-decoration: none;
            }
        }
        .news-description {
            margin: 0 0 10px;
        }


        .news-sticky {
            margin: 0 0px 0 9px;
        }



    }
}

// ---------------
//  SLIDER NEWS FOOTER --
// ---------------
.news-slider {
    .news-footer {
        .likes {
            width: auto;
            margin-right: 15px;
        }
        .glyphicons.glyphicons-comments {
            color: #fff;
        }
    }
}


// ---------------
//  SLIDER NEWS MEDIA Qs
// ---------------
.tile-news-component[data-gs-width="1"] {

    .news-slider {

        .news-body {
            padding: 15px;

            .news-title {
                font-size: 18px;
            }
        }
    }
}

.tile-news-component[data-gs-height="1"],
.tile-news-component[data-gs-height="2"],
.tile-news-component[data-gs-height="3"],
.tile-news-component[data-gs-height="4"],
.tile-news-component[data-gs-height="5"] {
    .news-slider {
        .news-description {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
        }
    }
}

.tile-news-component[data-gs-width="1"] {
    .list-news {
        .likes, .comments {
            font-size: 0.7rem;
            
            ion-icon {
                vertical-align: middle;
            }
        }
    }
}

.tile-news-component[data-gs-width="2"] {
    .list-news {
        .likes, .comments {
            width: auto;
        }
    }
}

@media only screen and (max-width:1200px) {
    .tile-news-component[data-gs-width="1"] {
        .news-slider {
            .news-description {
                display: none;
            }
        }
    }
}



// --------------------------
//  -- COMPONENT SETTINGS STYLING
// --------------------------

// --------------------------
// SLIDER RADIO ICONS


.radio_icon_row .radio_icon .radio_icon_for_slider_style span {
    display: block;
    height: 40px;
    width: 40px;
    margin: 8px;
}

// -- IMAGE & TEXT

.radio_icon_row .radio_icon .radio_icon_for_slider_style .image_and_text {
    background: url('/images/svg/news-icons/placeholder-image-text.svg');
    background-size: cover;
}

.radio_icon_row .radio_icon.radio_icon_selected .radio_icon_for_slider_style .image_and_text {
    background: url('/images/svg/news-icons/placeholder-image-text-active.svg');
    background-size: cover;
}

// -- IMAGE ONLY

.radio_icon_row .radio_icon .radio_icon_for_slider_style .image_only {
    background: url('/images/svg/news-icons/placeholder-large-image.svg');
    background-size: cover;
}

.radio_icon_row .radio_icon.radio_icon_selected .radio_icon_for_slider_style .image_only {
    background: url('/images/svg/news-icons/placeholder-large-image-active.svg');
    background-size: cover;
}

// -- TEXT ONLY

.radio_icon_row .radio_icon .radio_icon_for_slider_style .text_only {
    background: url('/images/svg/news-icons/placeholder-text.svg');
    background-size: cover;
}

.radio_icon_row .radio_icon.radio_icon_selected .radio_icon_for_slider_style .text_only {
    background: url('/images/svg/news-icons/placeholder-text-active.svg');
    background-size: cover;
}
