.component-portfolio-items {
    container-type: inline-size;
    container-name: portfolio-items;

    :where(.component-wrapper) {
        --local-close-button-size: 3.3rem;
        :where(.region) {
            :where(.content-wrap) {
                :where(.portfolio-filters-wrapper) {
                    gap: 1rem;
                    margin-bottom: 2rem;
                    position: relative;

                    :where(.filter-button) {
                        color: var(--color-scheme-color-h2);
                        border: none;
                        background: none;
                        display: grid;
                        grid-template-columns: 1fr 2fr;
                        padding: .5rem;
                        :where(svg) {
                            width: 3rem;
                            height: 3rem;
                            color: var(--color-scheme-color-h2);
                        }

                        :where(.filter-text){
                           align-self: center;
                        }
                    }

                    :where(.filter-button:hover) {
                        cursor: pointer;
                    }

                    :where(.portfolio-filter-container) {
                        background-color: rgba(255, 255, 255, .0);
                        border: none;
                        min-width: 80%;
                        padding: 1.7rem;
                        overflow-x: hidden;

                        :where(.hidden-border){
                            padding: 4rem;
                            background-color: rgba(255, 255, 255, .8);
                            box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
                        }

                        :where(.portfolio-filter-close) {
                            width: var(--local-close-button-size);
                            height: var(--local-close-button-size);
                            border: 2px solid var(--color-brand-corporate-blue);
                            background-color: var(--color-primary-white);
                            border-radius: 50%;
                            position: absolute;
                            top: 1.8rem;
                            right: 1.8rem;
                            display: grid;
                            place-content: center;
                            transform: translatex(50%) translateY(-50%);

                            :where(svg) {
                                color: var(--color-brand-corporate-blue);
                                width: 100%;
                                rotate: 45deg;
                            }

                        }

                        :where(.portfolio-filter-close:hover) {
                            background-color: var(--color-brand-corporate-blue);;
                            cursor: pointer;

                            :where(svg) {
                                color: var(--color-primary-white);
                            }
                        }

                        :where(.portfolio-filter-columns) {
                            display: grid;
                            grid-template-columns: 1fr 1fr;
                            gap: 0;
                            width: 100%;
                            padding-bottom: 2rem;

                            :where(.markets-column) {
                                border-right: 1px solid var(--color-brand-black-100);
                            }

                            :where(.filter-header) {
                                margin-top: 0;
                                margin-bottom: 0;
                                margin-left: 2rem;
                                color: var(--color-brand-corporate-blue);
                                font-size: 2rem;
                            }

                            :where(.checkbox-list) {
                                list-style-type: none;
                                display: grid;
                                grid-template-columns: auto auto auto;
                                column-gap: .5rem;
                                row-gap: .5rem;
                                padding-left: 2rem;
                                :where(li) {
                                    color:var(--color-brand-dark-grey);
                                    padding-left: 0;
                                }
                            }
                        }

                        :where(.portfolio-filter-buttons) {
                            .clear-filter {
                                width: 100%;
                                background-color: var(--color-brand-corporate-blue);
                                color: var(--color-primary-white);
                                border: none;
                            }
                        }
                    }

                    .portfolio-filter-container::backdrop {
                        background: rgb(0 0 0 / 25%);
                    }

                }

                .grid-sizer, .grid-item {
                    margin-bottom: .7rem;
                    width: 28.2rem;
                }

                :where(#portfolio-container) {
                    .portfolio-item a {
                        color: #fff;
                        display: block;
                        position: relative;
                    }

                    .portfolio-item .portfolio-details {
                        background-color: rgba(0, 0, 0, 0.60);
                        position: absolute;
                        top: 0;
                        left: 0;
                        height: 100%;
                        opacity: 0;
                        width: 100%;
                        text-align: center;
                        border-radius: var(--border-radius-common);
                    }

                    .portfolio-item:hover .portfolio-details {
                        opacity: 1;
                    }

                    .portfolio-details-wrapper {
                        position: absolute;
                        text-align: center;
                        text-transform: uppercase;
                        width: 100%;
                        bottom: 10%;
                    }

                    .portfolio-teaser-link-text {
                        font-size: 14px;
                        padding-top: 20px;
                    }

                    .portfolio-item .wp-post-image {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                        border-radius: var(--border-radius-common);
                    }
                }
            }
        }
    }
}

@container portfolio-items (max-width: 150rem) {
    .component-portfolio-items {
        & :where(.component-wrapper) {
            & :where(.region) {
                & :where(.content-wrap) {
                    & :where(.header) {
                        margin-left: 4rem;
                    }

                    & :where(.filter-button) {
                        margin-left: 4rem;
                    }

                    & :where(.masonry-grid) {
                        margin-inline: auto;
                    }
                }
            }
        }
    }
}
@container portfolio-items (max-width: 100rem) {
    .component-portfolio-items {
        & :where(.component-wrapper) {
            & :where(.region) {
                & :where(.content-wrap) {
                    & :where(.portfolio-filters-wrapper) {
                        & :where(.portfolio-filter-container){
                            min-width: 95%;
                        }

                        :where(.filter-header){
                            margin-left: 0;
                        }

                        & :where(.portfolio-filter-columns) {
                            grid-template-columns: 1fr;

                        }

                        & :where(.portfolio-filter-columns) {
                            & :where(.markets-column) {
                                border-right: none;
                            }

                            & :where(.checkbox-list) {
                                grid-template-columns: auto auto;
                                column-gap: 0;
                                row-gap: 1rem;
                                padding-left: 0;
                            }
                        }
                    }
                }
            }
        }
    }
}
