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

@property --color-cpt-list-date {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-cpt-list-category {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-cpt-list-category-hover {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-cpt-list-more {syntax: "<color>";inherits: true;initial-value: #f0f0f0;}
@property --color-cpt-list-title {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-cpt-list-excerpt {syntax: "<color>";inherits: true;initial-value: #111111;}

.rdg-blocks .rdg-cpt-list {
    .content {
        width: 100%;
        display: flex;
        flex-direction: column;

        @include title;

        .posts {
            display: flex;
            flex-direction: row;
            gap: 2rem 1rem;
            flex-wrap: wrap;
            justify-content: space-between;

            article {
                width: calc(calc(100% / 3) - .8rem);

                @media (max-width: 1024px) {
                    & {
                        width: calc(calc(100% / 2) - .8rem);
                    }
                }

                @media (max-width: $breakpoint-md) {
                    & {
                        width: 100%;
                    }
                }

                .inside-article {
                    padding: 0;

                    .article-header {
                        display: flex;
                        justify-content: space-between;
                        margin-bottom: .3rem;

                        @media (max-width: 330px) {
                            & {
                                flex-direction: column;
                                text-align: center;
                            }
                        }

                        .article-date {
                            color: var(--color-cpt-list-date);
                        }

                        .article-categories {
                            .categories {
                                a {
                                    color: var(--color-cpt-list-category);

                                    &:hover {
                                        color: var(--color-cpt-list-category-hover);
                                    } 
                                }
                            }
                        }

                        .article-dropdown {
                            position: relative;
                            display: inline-block;

                            a {
                                color: var(--color-cpt-list-category);

                                &:hover {
                                    color: var(--color-cpt-list-category-hover);
                                } 
                            }

                            .more-content {
                                display: none;
                                position: absolute;
                                padding: .5rem;
                                box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
                                z-index: 1;
                                background-color: var(--color-cpt-list-more);
                                border-radius: 3px;
                                width: auto;

                                a {
                                    display: block;
                                    white-space: nowrap;
                                }
                            }
                        }

                        .article-dropdown:hover .more-content {
                            display: block;
                          }
                    }

                    .article-image img, .article-image .color {
                        height: 15rem;
                        object-fit: cover;
                        background-color: var(--color-gray);
                    }

                    .article-summary {
                        .article-title {
                            margin-bottom: .5rem;

                            a {
                                color: var(--color-cpt-list-title);

                                &:hover {
                                    color: var(--color-cpt-list-title);
                                }
                            }
                        }

                        .article-excerpt {
                            color: var(--color-cpt-list-excerpt);
                        }
                    }
                }
            }
        }

        @include message;
    }
}

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