.wp-block-post-template {
    position: relative;

    .wp-block-post {
        position: relative;
        overflow: hidden;
    }

    &.is-style-projects-primary {
        display: block;

        .wp-block-post {
            &:nth-child(even),
            &:nth-child(2n+3) {
                .wp-block-group {
                    padding-right: 0 !important;
                }
            }

            .wp-block-group {
                .wp-block-buttons {
                    &:first-child {
                        display: none !important;
                    }

                    + .wp-block-group,
                    + .wp-block-read-more {
                        margin-block-start: 0 !important;
                    }
                }
            }
        }
    }
}

@media screen and (max-width: 781px) {
    .wp-block-post-template {
        &.is-style-projects-primary {
            .wp-block-post {
                + .wp-block-post {
                    margin-top: 40px !important;
                }

                > .wp-block-group {
                    display: none;
                }

                .wp-block-cover {
                    min-height: 75vw !important;
                }

                .wp-block-columns {
                    .wp-block-group {
                        padding-left: 0 !important;

                        > div {
                            + div, + a {
                                margin-block-start: 30px !important;
                            }
                        }
                    }
                }
            }
        }
    }
}

@media screen and (min-width: 782px) {
    .wp-block-post-template {
        .wp-block-post {
            .wp-block-cover {
                .wp-block-cover__background,
                .wp-block-cover__image-background {
                    /* transition: all 0.25s; */
                }
            }

            &:hover {
                .wp-block-cover {
                    .wp-block-cover__background,
                    .wp-block-cover__image-background {
                        /* transform: scale(1.1) !important; */
                    }
                }

                .wp-block-read-more {
                    &.is-style-black-arrow-text {
                        &:before {
                            right: -8px !important;
                        }
                    }
                }
            }
        }

        &.is-style-projects-primary {
            display: grid;
            
            .wp-block-post {
                > .wp-block-group {
                    display: none !important;
                }

                &:nth-child(1) {
                    grid-column: 1 / 7;
                    display: grid;
                    
                    > .wp-block-columns {
                        > .wp-block-column {
                            &:first-child {
                                flex: 0 1 calc(66.6666% + 28px) !important;
                            }

                            &:last-child {
                                display: flex !important;
                                flex-direction: column !important;
                                justify-content: stretch;

                                .wp-block-group {
                                    display: flex !important;
                                    height: 100%;
                                    flex-direction: column !important;
                                }
                            }
                        }
                    }
                }

                &:nth-child(even) {
                    grid-column: 1 / 3;
                    display: flex;
                    column-gap: 28px;
                    grid-template-columns: 1fr 1fr;

                    .wp-block-columns {
                        display: flex !important;
                        flex-direction: column !important;

                        .wp-block-group {
                            display: flex !important;
                            flex-direction: column !important;
                        }
                    }
                }

                &:nth-child(2n+3) {
                    grid-column: 3 / 5;
                    display: flex;

                    .wp-block-columns {
                        display: flex !important;
                        flex-direction: column !important;

                        .wp-block-group {
                            display: flex !important;
                            flex-direction: column !important;
                        }
                    }
                }

                &:nth-child(even),
                &:nth-child(2n+3) {
                    .wp-block-columns {
                        display: block;
                    }

                    .wp-block-read-more {
                        &.is-style-black-arrow-no-text {
                            margin-top: 20px !important; 

                            &:before {
                                width: 24px;
                                height: 24px;
                                background-size: 24px;
                            }
                        }
                    }

                    .wp-block-columns {
                        display: flex !important;
                        flex-direction: column !important;
                        gap: 15px !important;

                        .wp-block-column,
                        .wp-block-group {
                            display: flex !important;
                            flex-direction: column !important;
                            height: 100% !important;
                        }
                    }

                    .wp-block-cover {
                        min-height: 500px !important;
                    }

                    .wp-block-group {
                        padding-left: 0 !important;
                        padding-top: var(--wp--preset--spacing--small-tertiary) !important;
                        padding-bottom: var(--wp--preset--spacing--small-secondary) !important;

                        .wp-block-buttons,
                        .wp-block-read-more {
                            margin-block-start: 15px !important;


                            &:first-child {
                                display: none !important;
                            }
                        }

                        .wp-block-post-title {
                            margin-block-start: 0px !important;
                            font-size: var(--wp--preset--font-size--h-5) !important;
                        }

                        .wp-block-group {
                            padding-top: 0 !important;
                            padding-bottom: 0 !important;
                        }
                    }
                }

                &:nth-child(2n+4) {
                    grid-column: 5 / 7;
                    display: flex;

                    .wp-block-columns {
                        display: flex !important;
                        flex-direction: column !important;

                        .wp-block-group {
                            display: flex !important;
                            flex-direction: column !important;
                        }
                    }
                }
            }
        }

        &.is-style-projects-secondary,
        &.is-style-projects-tertiary {
            .wp-block-post {
                display: flex;

                .wp-block-group {
                    display: flex;
                    flex: 1;
                    flex-direction: column;
                    justify-content: flex-start;

                    .wp-block-group {
                        flex-grow: 1;
                        flex: 1;

                        .wp-block-read-more {
                            margin-top: auto;
                        }
                    }
                }

                .wp-block-cover {
                    min-height: 500px !important;

                    .wp-block-cover__background,
                    .wp-block-cover__image-background {
                        min-height: 500px !important;
                    }
                }

                .wp-block-read-more {
                    &.is-style-black-arrow-no-text {
                        margin-top: auto !important; 

                        &:before {
                            width: 24px;
                            height: 24px;
                            background-size: 24px;
                        }
                    }
                }
            }
        }

        &.is-style-projects-tertiary {
            display: grid;
            row-gap: var(--wp--preset--spacing--large-primary);
            
            .wp-block-post {
                display: grid;

                &:nth-child(4n+1) {
                    grid-column: 1 / 2;
                }

                &:nth-child(4n+2) {
                    grid-column: 2 / 4;
                }

                &:nth-child(4n+3) {
                    grid-column: 1 / 3;
                }

                &:nth-child(4n+4) {
                    grid-column: 3 / 4;
                }

                .wp-block-cover {
                    min-height: 500px !important;

                    .wp-block-cover__background,
                    .wp-block-cover__image-background {
                        min-height: 500px !important;
                    }
                }

                .wp-block-read-more {
                    &.is-style-black-arrow-no-text {
                        margin-top: auto !important; 

                        &:before {
                            width: 24px;
                            height: 24px;
                            background-size: 24px;
                        }
                    }
                }
            }
        }
    }
}