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

@property --color-posts-list-title {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-posts-list-title-hover {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-posts-list-date {syntax: "<color>";inherits: true;initial-value: #b2b2be;}
@property --color-posts-list-description {syntax: "<color>";inherits: true;initial-value: #111111;}

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

    @include title;

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

        @media (max-width: $breakpoint-sm) {
            & {
                padding-left: 20px;
                padding-right: 20px;
            }
        }

        .items {
            width: 100%;
            display: flex;
            gap: 1.5rem;

            @media (max-width: $breakpoint-md) {
                & {
                    flex-direction: column;
                }
            }

            .item {
                width: 100%;

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

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

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

                footer {
                    display: flex;
                    flex-direction: column;
                    margin-top: .5rem;

                    .footer-title {
                        display: -webkit-box;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        color: var(--color-posts-list-title);

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

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

                        a:hover {
                            color: var(--color-posts-list-title-hover);
                        }
                    }

                    .header {
                        display: flex;
                        padding-bottom: .5rem;
                        color: var(--color-posts-list-date);
                    }

                    .footer-description {
                        margin-top: .5rem;
                        color: var(--color-posts-list-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;
                            }
                        }
                    }

                    a {
                        margin-top: .8rem;
                    }
                }
            }

            &.flex {
                flex-wrap: wrap;
                gap: initial;
                row-gap: 1rem;
                justify-content: space-between;

                @media (max-width: 880px) {
                    & {
                        row-gap: 1.5rem;
                    }
                }

                .item {
                    width: 25.5rem;

                    @media (max-width: $breakpoint-xxl) {
                        & {
                            width: 24.5rem;
                        }
                    }

                    @media (max-width: 1250px) {
                        & {
                            width: 24rem;
                        }
                    }

                    @media (max-width: $breakpoint-xl) {
                        & {
                            width: 23rem;
                        }
                    }

                    @media (max-width: 1150px) {
                        & {
                            width: 21rem;
                        }
                    }

                    @media (max-width: 1070px) {
                        & {
                            width: 20rem;
                        }
                    }

                    @media (max-width: 1020px) {
                        & {
                            width: 19rem;
                        }
                    }

                    @media (max-width: 970px) {
                        & {
                            width: 27rem;
                        }
                    }

                    @media (max-width: 920px) {
                        & {
                            width: 26rem;
                        }
                    }

                    @media (max-width: 880px) {
                        & {
                            width: 100%;
                        }
                    }
                }
            }
        }
    }
}

.acf-block-preview {
    .rdg-posts-list {
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;

        .body {
            .items {
                .item {
                    footer {
                        a {
                            text-decoration: none;
                        }
                    }
                }
            }
        }
    }
}
