@use '~@epam/promo/assets/styles/colors' as *;

@mixin control-focus($width: 2px, $offset: 2px) {
    outline: $blue auto $width;
    outline-offset: $offset;
}

.layout {
    margin: 0 auto;
    background-color: $gray10;

    .explore {
        max-width: 1200px;
        width: 100%;
        padding: 60px 0;
        margin: 0 auto;
    }

    .header {
        font-size: 30px;
        line-height: 36px;
        padding: 0;
        margin-bottom: 12px;
    }

    .content {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;

        .caption {
            position: absolute;
            bottom: 24px;
            left: 18px;
            color: white;
        }

        .color-palette, .typography, .download {
            width: 384px;
            height: 180px;
            position: relative;
            margin-top: 24px;
            transition: 1s;
        }

        .color-palette, .typography, .download, .demo, .components {
            &:focus-visible {
                @include control-focus();
            }
        }

        .color-palette {
            background: url('/static/images/Palette.png') no-repeat center;
            background-size: 100%;

            &:hover, &:focus-visible {
                background-size: 150%;
            }
        }

        .typography {
            background: url('/static/images/Typo.png') no-repeat center;
            background-size: 100%;

            &:hover, &:focus-visible {
                background-size: 150%;
            }

            .typography-icon {
                position: absolute;
                bottom: 24px;
                right: 24px;
                color: rgba(255, 255, 255, 0.2);
                font-size: 120px;
                line-height: 96px;
                padding: 0;
                -webkit-text-stroke: 2px white;
            }
        }

        .download {
            background: url('/static/images/Assets.png') no-repeat center;
            background-size: 100%;

            &:hover, &:focus-visible {
                background-size: 150%;
            }

            .download-icon {
                position: absolute;
                bottom: 24px;
                right: 44px;
                fill: white;
            }
        }

        .components, .demo {
            width: 588px;
            height: 240px;
            position: relative;
            margin-top: 24px;
            transition: 1s;

            &:hover, &:focus-visible {
                background-size: 150%;
            }
        }

        .components {
            background: url('/static/images/Components.png') no-repeat center;
            background-size: 100%;
        }

        .demo {
            background: url('/static/images/Demo.png') no-repeat center;
            background-size: 100%;
        }
    }

    @media (max-width: 1280px) {
        .explore {
            max-width: 732px;
            padding: 48px 0;
        }

        .header {
            display: none;
        }

        .content {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;

            .caption {
                line-height: 24px;
                font-size: 16px;
                position: absolute;
                bottom: 12px;
                left: 12px;
                color: white;
            }

            .color-palette, .typography, .download {
                width: 232px;
                height: 120px;
                position: relative;
                margin-top: 0;
                transition: none;
            }

            .color-palette {
                background-size: 100% 100%;

                &:hover, &:focus-visible {
                    background-size: 100% 100%;
                }
            }

            .typography {
                background-size: 100% 100%;

                &:hover, &:focus-visible {
                    background-size: 100% 100%;
                }

                .typography-icon {
                    position: absolute;
                    bottom: 0;
                    right: 16px;
                    color: rgba(255, 255, 255, 0.2);
                    font-size: 72px;
                    line-height: 96px;
                    padding: 0;
                    -webkit-text-stroke: 1px white;
                }
            }

            .download {
                background-size: 100% 100%;

                &:hover, &:focus-visible {
                    background-size: 100% 100%;
                }

                .download-icon {
                    position: absolute;
                    bottom: 24px;
                    right: 24px;
                    fill: white;

                    svg {
                        width: 38px;
                        height: 43px;
                    }
                }
            }

            .components, .demo {
                width: 357px;
                height: 180px;
                position: relative;
                margin-top: 18px;
                transition: none;

                &:hover, &:focus-visible {
                    background-size: 100% 100%;
                }
            }

            .components {
                background-size: 100% 100%;
            }

            .demo {
                background-size: 100% 100%;
            }
        }
    }

    @media (max-width: 768px) {
        .explore {
            max-width: none;
            padding: 30px 0;
            margin: 0 12px;
            overflow: auto;
            width: inherit;
        }

        .header {
            display: none;
        }

        .content {
            display: flex;
            flex-wrap: nowrap;
            justify-content: space-between;

            .caption {
                line-height: 24px;
                font-size: 16px;
                position: absolute;
                bottom: 12px;
                left: 12px;
                color: white;
            }

            .color-palette, .typography, .download {
                width: 284px;
                height: 160px;
                position: relative;
                margin-top: 0;
                margin-right: 12px;
                transition: none;
            }

            .color-palette {
                background-size: 100% 100%;

                &:hover {
                    background-size: 100% 100%;
                }
            }

            .typography {
                background-size: 100% 100%;

                &:hover {
                    background-size: 100% 100%;
                }

                .typography-icon {
                    position: absolute;
                    bottom: 0;
                    right: 16px;
                    color: rgba(255, 255, 255, 0.2);
                    font-size: 72px;
                    line-height: 96px;
                    padding: 0;
                    -webkit-text-stroke: 1px white;
                }
            }

            .download {
                background-size: 100% 100%;

                &:hover {
                    background-size: 100% 100%;
                }

                .download-icon {
                    position: absolute;
                    bottom: 24px;
                    right: 24px;
                    fill: white;

                    svg {
                        width: 38px;
                        height: 43px;
                    }
                }
            }

            .components, .demo {
                width: 284px;
                height: 160px;
                position: relative;
                margin-top: 0;
                transition: none;

                &:hover {
                    background-size: 100% 100%;
                }
            }

            .components {
                background-size: 100% 100%;
                margin-right: 12px;
            }

            .demo {
                background-size: 100% 100%;
            }
        }
    }
}
