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

// -------------------------
// ----- NEWS ARCHIVE
// -------------------------
// News index heading.
.news-channel-heading {
    margin: 10px 0;

    @include media-breakpoint-down (sm) {
        margin-top: 0;
    }

    &__title {
        margin-right: 10px;

        @include media-breakpoint-down (sm) {
            padding-left: 10px;
        }
    }
}

.news-channel {
    font-weight: bold;
}

.news-channel__link, .news-author__link {
    &:hover {
        text-decoration: none;
    }
}

.news-home-first, .news-home__article {
    .news-title {
        margin-top: 21px;
        font-size: 18px;

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

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

// First News Item
.news-home-first {
    display: inline-flex;
    align-items: start;
    margin-bottom: 10px;

    @media only screen and (max-width : 480px) {
        display: block;
    }

    @media only screen and (min-width: 768px) {
        margin: 10px 0px 10px;
        padding: 0px 10px;
    }

    &__image {
        width: auto;
        max-height: 55vh;

        @media only screen and (min-width: 768px) {
            min-height: 240px;
            max-width: 65.7%;

            @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
                min-width: auto;
            }
        }

        @media only screen and (min-width:480px) and (max-width: 767px) {
            max-width: 60%;
        }
    }

    &__text {
        margin: -20px 10px 0 20px;
        flex-shrink: 2;

        @media only screen and (max-width : 480px) {
            margin: auto;
        }

        .news-title {
            @media only screen and (max-width : 480px) {
                margin-top: 10px;
            }
        }
    }

    &__no-image {
        padding-left: 10px;
    }

}

// News grid items
.news-home {
    &__container {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));

        @include media-breakpoint-down (sm) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        @include media-breakpoint-down (xs) {
            grid-template-columns: 1fr;
        }

        .news-home__article {
            @include media-breakpoint-down (sm) {
                margin-top: 20px;
            }

            .news-home__body {
                height: 237px;
                overflow: hidden;

                @include media-breakpoint-down (sm) {
                    height: auto;
                    width: 100%;
                    position: relative;
                    display: flex;
                    flex-direction: column;
                    justify-content: flex-start;
                }

                .news-title {
                    margin-top: 0;

                    @include media-breakpoint-down (md) {
                        margin-top: 0;
                    }
                }

                &::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: 50px;
                    width: 100%;
                    position: absolute;
                    bottom: 40px;
                    left: 0;
                }
            }
        }
    }
}

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

.news-archive {
    ul {
        list-style: none;
        padding: 0;
        margin: 0;

        li {
            + li {
                margin-top: 3px;
            }
        }

        ul {
            margin-top: 3px;
            padding-left: 10px;
        }
    }

    a {
        padding: 3px 8px;
        display: block;
        border-radius: 3px;
        text-decoration: none;

        &:hover {
            background-color: $gray-200;
        }
    }
}

.news-sticky {
    color: #fff;
    display: inline-block;
    margin: 0 -6px 0 6px;
    padding-left: 4px;
    border-left: 1px solid rgba(255,255,255,.6);
}

.likes {
    width: 70%;
}

.comments {
    width: 30%;
    text-align: right;
}

.comments, .likes {
    display: inline-block;
    float: left;

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

// News article
.news-title {
    margin-top: 0;
}

.img-full {
    width: 100%;
}

.cke-content:not(:empty) {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid $gray-700;
}

.news-article {
    &__image-wrapper {
        display: flex;
        justify-content: center;

        @include media-breakpoint-down (sm) {
            display: block;
            text-align: center;
        }
    }

    // -------------------------
    // ----- NEWS SINGLE
    // -------------------------
    .news-title {
        margin-top: 0;
    }

    .img-full {
        width: 100%;
    }

    .cke-content:not(:empty) {
        border-top: 1px solid $gray-200;
        padding-top: 15px;
        margin-top: 15px;
    }



    &__image {
        max-height: 55vh;

        @include media-breakpoint-down (sm) {
            margin: auto;
        }

        &:hover {
            cursor: pointer;
        }
    }
}

.image-expand-modal {
    background: rgba(0,0,0,0.8);

    .modal-dialog {
        text-align: center;

        .close {
            background: rgba(255,255,255,.8);
            opacity: 1;
            padding: 5px 10px;
            border: none;
            border-radius: 350px;
            margin-bottom: 10px;
            cursor: pointer;
            float: none;
            vertical-align: middle;
            font-weight: normal;
            font-size: 14px;
            text-shadow: none;
        }

        .image-lightbox-img {
            box-shadow: 0 0 5px 5px rgba(0,0,0,0.2);
            max-width: 100%;
            max-height: 90vh;
        }
    }
}

// News Smart Object & Component
#news-list-ajax {
    .news {
        &-title {
            font-size: 15px;
        }

        &__image-link {
            position: relative;
            background: url(/intranet/news/images/news-no-image.png);
            background-size: cover;
            width: 150px;
            height: 150px;

            img {
                max-width: 150px;
                height: 100%;
                width: 100%;
                object-fit: cover;
            }
        }

        &-date-owner-wrapper {
            display: block;
        }

        &-owner {

            &::before {
                content: "by ";
            }
        }
    }
}

.news-smart-obj {
    &__article {
        width: 100%;
    }

    &__body {
        position: relative;

        .news-description {
            margin-bottom: 20px;
        }
    }

    &__footer {
        padding: 0;
    }
}
