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

@property --color-rdg-handicappers-hub-header {syntax: "<color>";inherits: true;initial-value: #03467d;}
@property --color-rdg-handicappers-hub-header-hover {syntax: "<color>";inherits: true;initial-value: #e11414;}
@property --color-rdg-handicappers-hub-bg {syntax: "<color>";inherits: true;initial-value: #ffffff;}
@property --color-rdg-handicappers-hub-border {syntax: "<color>";inherits: true;initial-value: #EEF4FC;}
@property --color-rdg-handicappers-hub-shadow {syntax: "<color>";inherits: true;initial-value: #F3F3F3;}
@property --color-rdg-handicappers-hub-line {syntax: "<color>";inherits: true;initial-value: #67748e66;}
@property --color-rdg-handicappers-hub-stats {syntax: "<color>";inherits: true;initial-value: #878787;}
@property --color-rdg-handicappers-hub-btn {syntax: "<color>";inherits: true;initial-value: #03467d;}
@property --color-rdg-handicappers-hub-btn-hover {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-rdg-handicappers-hub-btn-default {syntax: "<color>";inherits: true;initial-value: #E9ECEF;}

.rdg-blocks .rdg-handicappers-hub {
    width: calc(var(--vw, 1vw) * 100);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 99.55vw;

    .container.content {
        width: 100%;
        display: flex;
        flex-direction: column;

        @include title;
        --gap: 20px;

        .handicappers {
            display: flex;
            flex-wrap: wrap;
            padding: 20px;
            gap: var(--gap);
            border-radius: 16px;
            container-type: inline-size;
            background-color: var(--color-rdg-handicappers-hub-bg);
            border: 1px solid var(--color-rdg-handicappers-hub-border);
            box-shadow: 0px 20px 50px 0px var(--color-rdg-handicappers-hub-shadow);

            .handicapper {
                --columns: 4;
                width: calc((100% - (var(--columns) - 1) * var(--gap)) / var(--columns));
                display: flex;
                border-radius: 1rem;
                flex-direction: column;
                background-color: var(--color-rdg-handicappers-hub-bg);
                border: 1px solid var(--color-rdg-handicappers-hub-border);
                box-shadow: 0px 20px 50px 0px var(--color-rdg-handicappers-hub-shadow);

                @container (max-width: 1280px) {
                    & {
                        --columns: 3;
                    }
                }

                @container (max-width: 950px) {
                    & {
                        --columns: 2;
                    }
                }

                @container (max-width: 600px) {
                    & {
                        --columns: 1;
                    }
                }

                .handicapper-header {
                    display: flex;
                    min-height: 6rem;
                    padding: 1rem;
                    gap: .9rem;
                    border-bottom: 2px solid var(--color-rdg-handicappers-hub-line);

                    @container (max-width: 720px) {
                        & {
                            align-items: center;
                            flex-direction: column;
                        }
                    }

                    .header-image {
                        display: flex;
                        max-width: 60px;
                        max-height: 60px;

                        @container (max-width: 720px) {
                            & {
                                width: 100px;
                                height: 100px;
                            }
                        }
                        
                        img {
                            border-radius: 50%;
                            object-fit: cover;
                        }
                    }

                    .header-content {
                        color: var(--color-rdg-handicappers-hub-header);

                        @container (max-width: 720px) {
                            & {
                                text-align: center;
                                min-height: 3.6rem;
                            }
                        }

                        .header-name {
                            a {
                                &:hover {
                                    color: var(--color-rdg-handicappers-hub-header-hover);
                                }
                            }
                        }

                        .header-package {
                            a {
                                &:hover {
                                    color: var(--color-rdg-handicappers-hub-header-hover);
                                }
                            }
                        }
                        
                        .header-stats {
                            color: var(--color-rdg-handicappers-hub-stats);

                            .success {
                                color: var(--color-success);
                            }

                            .danger {
                                color: var(--color-danger);
                            }
                        }
                    }
                }

                .handicapper-body {
                    padding: 1rem;
                    max-height: 6.5rem;
                    min-height: 6.4rem;
                    border-bottom: 1px solid var(--color-rdg-handicappers-hub-line);

                    .body-content {
                        overflow: hidden;
                        display: -webkit-box;
                        -webkit-line-clamp: 3;
                        -webkit-box-orient: vertical;
                    }
                }

                .handicapper-footer {
                    display: flex;
                    padding: 1rem;

                    .footer-content {
                        width: 100%;
                        display: flex;
                        flex-direction: column;
                        gap: 1rem;

                        .footer-button {
                            display: flex;
                            flex-direction: column;
                            justify-content: center;
                            align-items: center;
                            padding: .3rem 1rem;
                            border-radius: .5rem;
                            color: var(--color-rdg-handicappers-hub-btn);
                            background-color: var(--color-rdg-handicappers-hub-bg);
                            border: 1px solid var(--color-rdg-handicappers-hub-btn-default);

                            &:hover {
                                background-color: var(--color-rdg-handicappers-hub-btn-default);
                            }

                            &.primary {
                                display: flex;
                                justify-content: center;
                                align-items: center;
                                padding: .7rem 1rem;
                                border-radius: .5rem;
                                color: var(--color-rdg-handicappers-hub-bg);
                                background-color: var(--color-rdg-handicappers-hub-btn);

                                &:hover {
                                    background-color: var(--color-rdg-handicappers-hub-btn-hover);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

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