@import '../../../../assets/scss/abstracts/variables';
@import '../../../../assets/scss/abstracts/mixins';

@property --color-slider-latest-post-title {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-slider-latest-post-title-hover {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-slider-latest-post-description {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-slider-latest-post-footer {syntax: "<color>";inherits: true;initial-value: #111111;}

.rdg-blocks .rdg-slider-latest-post {
    .preview-thumbs {
        background-image: url('../images/rdg-slider-latest-post-template-preview.jpg');
    }
    width: 100%;

    @include title;

    .body {
        @media (max-width: $breakpoint-xl) {
            & {
                padding: 0;
                width: 100%;
            }
        }

        .items {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;

            .item {
                .image {
                    display: flex;
                    flex-direction: column;
                    justify-content: flex-end;
                    background-size: cover;
                    background-position: center top;
                    background-repeat: no-repeat;

                    &.default {
                        height: 23rem;
                        max-height: 23rem;

                        @media (max-width: $breakpoint-md) {
                            & {
                                height: 16rem;
                                max-height: 16rem;
                            }
                        }
    
                        @media (max-width: $breakpoint-sm) {
                            & {
                                height: 14rem;
                                max-height: 14rem;
                            }
                        }
                    }

                    &.small {
                        height: 16rem;
                        max-height: 16rem;
    
                        @media (max-width: $breakpoint-sm) {
                            & {
                                height: 14rem;
                                max-height: 14rem;
                            }
                        }
                    }
                }

                footer {
                    display: flex;
                    flex-direction: column;
                    margin-top: .5rem;
                    color: var(--color-slider-latest-post-footer);

                    .footer-title {
                        display: -webkit-box;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        text-overflow: ellipsis;

                        @media (max-width: $breakpoint-md) {
                            & {
                                -webkit-line-clamp: 3;
                            }
                        }

                        @media (max-width: $breakpoint-sm) {
                            & {
                                -webkit-line-clamp: 4;
                            }
                        }
                        
                        a {
                            color: var(--color-slider-latest-post-title);
                            transition: all 0.3s ease-in-out;

                            &:hover {
                                color: var(--color-slider-latest-post-title-hover);
                            }
                        }
                    }

                    .footer-description {
                        margin-top: .5rem;
                        color: var(--color-slider-latest-post-description);

                        display: -webkit-box;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        text-overflow: ellipsis;

                        @media (max-width: $breakpoint-md) {
                            & {
                                -webkit-line-clamp: 3;
                            }
                        }

                        @media (max-width: $breakpoint-sm) {
                            & {
                                -webkit-line-clamp: 4;
                            }
                        }
                    }
                }
            }
        }
    }
}

.acf-block-preview {
    .rdg-slider-latest-post {
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
    }
}
