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

@property --color-preview-template-bg {syntax: "<color>";inherits: true;initial-value: #ffffff;}
@property --color-preview-template-description {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-preview-template-border {syntax: "<color>";inherits: true;initial-value: #F1F1F1;}
@property --color-preview-template-title {syntax: "<color>";inherits: true;initial-value: #eaf6ff;}
@property --color-preview-template-light {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-preview-template-link-hover {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-preview-template-title-bg {syntax: "<color>";inherits: true;initial-value: #03467d;}

.rdg-blocks .rdg-preview-template {
    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;
        padding-left: 20px;
        padding-right: 20px;

        @include title;

        .body {
            .previews {
                width: 100%;
                gap: 1.5rem;
                display: flex;
                flex-wrap: wrap;
                justify-content: space-between;

                .preview {
                    width: 29rem;
                    display: flex;
                    text-align: center;
                    flex-direction: column;

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

                    @media (max-width: 1400px) {
                        & {
                            width: 25rem;
                        }
                    }

                    @media (max-width: 1300px) {
                        & {
                            width: 22rem;
                        }
                    }

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

                    @media (max-width: 1100px) {
                        & {
                            width: 30rem;
                        }
                    }

                    @media (max-width: 1035px) {
                        & {
                            width: 28rem;
                        }
                    }

                    @media (max-width: 965px) {
                        & {
                            width: 25rem;
                        }
                    }

                    @media (max-width: 875px) {
                        & {
                            width: 22rem;
                        }
                    }

                    @media (max-width: 775px) {
                        & {
                            width: 100%;
                        }
                    }
                    
                    .preview-header {
                        width: 100%;
                        padding: .5rem;
                        margin-bottom: 0;
                        border-top-left-radius: .7rem;
                        border-top-right-radius: .7rem;
                        color: var(--color-preview-template-bg);
                        background-color: var(--color-preview-template-light);
                    }

                    .preview-body {
                        background-color: var(--color-preview-template-bg);
                        
                        .preview-date {
                            width: 100%;
                            display: flex;
                            justify-content: center;
                            padding: .5rem .5rem 0 .5rem;
                        }
                        .preview-teams {
                            width: 100%;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            gap: 1.5rem;
                            padding: 1rem .5rem;
                            background-color: var(--color-preview-template-bg);
                            min-height: 9rem;

                            @media (max-width: 400px) {
                                & {
                                    gap: .5rem;
                                }
                            }

                            .preview-team {
                                img {
                                    max-width: 6.5rem;
                                    max-height: 5.5rem;
                                }
                            }

                            .preview-vs {
                                display: flex;
                                align-items: center;
                                justify-content: center;

                                span {
                                    width: 1.5rem;
                                    height: 1.5rem;
                                    border-radius: 50%;
                                    color: var(--color-preview-template-bg);
                                    background-color: var(--color-preview-template-light);
                                }
                            }
                        }

                        .preview-title {
                            width: 100%;
                            padding: .5rem;
                            background-color: var(--color-preview-template-title);
                            color: var(--color-preview-template-title-bg);
                        }

                        .preview-description {
                            padding: 1rem 2rem;
                            height: 9rem;
                            background-color: var(--color-preview-template-bg);
                            border-bottom: 1px solid var(--color-preview-template-border);

                            @media (max-width: 1300px) {
                                & {
                                    padding: 1rem;
                                }
                            }

                            @media (max-width: 1150px) {
                                & {
                                    padding: 1rem 2rem;
                                }
                            }

                            @media (max-width: 775px) {
                                & {
                                    height: auto;
                                }
                            }

                            @media (max-width: 400px) {
                                & {
                                    padding: 1rem;
                                }
                            }

                            span {
                                width: 100%;
                                text-align: left;
                                color: var(--color-preview-template-description);

                                display: -webkit-box;
                                -webkit-line-clamp: 6;
                                -webkit-box-orient: vertical;
                                overflow: hidden;
                                text-overflow: ellipsis;

                                @media (max-width: 775px) {
                                    & {
                                        -webkit-line-clamp: 13;
                                    }
                                }
                            }
                        }

                        .preview-list {
                            text-align: left;
                            padding: .5rem 2rem;
                            margin-bottom: 1rem;
                            background-color: var(--color-preview-template-bg);
                            border-bottom: 1px solid var(--color-preview-template-border);

                            @media (max-width: 1300px) {
                                & {
                                    padding: .5rem 1rem;
                                }
                            }

                            @media (max-width: 1150px) {
                                & {
                                    padding: .5rem 2rem;
                                }
                            }

                            @media (max-width: 400px) {
                                & {
                                    padding: .5rem 1rem;
                                }
                            }

                            ul, li {
                                margin: 0;
                                padding: 0;
                                list-style: none;
                            }

                            ul {
                                list-style: none;

                                li {
                                    position: relative;
                                    padding-left: 1.5rem;
                                    color: var(--color-preview-template-light);

                                    &::before {
                                        content: '';
                                        position: absolute;
                                        left: 0;
                                        top: 50%;
                                        transform: translateY(-50%);
                                        width: .9rem;
                                        height: .9rem;
                                        background: url('data:image/svg+xml;utf8,<svg aria-hidden="true" role="img" height="1em" width="1em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="%2328a745" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>') no-repeat center center;
                                        background-size: contain;
                                    }
                                }
                            }
                        }
                    }

                    .preview-footer {
                        width: 100%;
                        padding: .5rem;
                        margin-top: 0;
                        border-bottom-left-radius: .7rem;
                        border-bottom-right-radius: .7rem;
                        color: var(--color-preview-template-bg);
                        background-color: var(--color-preview-template-light);
                    }
                }

                a {
                    text-decoration: none;
                    color: var(--color-preview-template-bg);
                    
                    &:hover {
                        color: var(--color-preview-template-link-hover);
                    }
                }
            }
        }

        .preview-thumbs {
            background-image: url('../images/rdg-preview-template-preview.jpg');
        }

        .team-default-logo {
            background-image: url('../images/rdg-preview-template-team-logo.webp');
        }
    }
}

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