@use "sass:math";

.header_home {
    display: grid;
    grid-template-areas: "hero";
    width: 100vw;
    height: 90vh;
    min-height: 800px;
    overflow: hidden;
    position: relative;

    .blocTitle,
    .carousel {
        grid-area: hero;
    }

    .blocTitle {
        position: absolute;
        width: 80%;
        height: 90vh;
        left: 50%;
        transform: translateX(-50%);
        margin: auto;
        z-index: 5;
        display: flex;
        justify-content: center;
        flex-direction: column;
        gap: 3rem;
        padding: 5rem 0;
        pointer-events: none;

        button,
        a {
            pointer-events: auto;
        }

        h1 {
            font-size: 5rem;
            font-weight: 700;
            position: relative;
            margin: 0;
            color: white;
        }

        p {
            width: 70%;
            font-size: 1.8rem;
            font-weight: 400;
            color: white;

            @media (max-width: 768px) {
                width: 100%;
            }
        }

        @media (max-width: 768px) {
            padding: 0;

            h1 {
                font-size: 2.4rem;
            }

            p {
                font-size: 1.4rem;
            }
        }
    }

    .carousel {
        width: 100%;
        height: 100%;
        z-index: 1;
        position: relative;

        .splide__track,
        .splide__list,
        .splide__slide {
            height: 100%;
        }

        .content-carousel {
            width: 100%;
            height: 100%;
            z-index: 1;
            overflow: hidden;

            .image {
                width: 100%;
                height: 100%;
                z-index: 1;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }

                &:after {
                    content: "";
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    z-index: 0;
                    height: 100%;
                    background: rgba(0, 0, 0, 0.3);
                }
            }
        }
    }

    .splide__arrows {
        display: flex;
        column-gap: 10px;
        z-index: 2;
        pointer-events: auto;

        .splide__arrow--prev,
        .splide__arrow--next {
            position: relative;
            transform: none;
            display: flex;
            width: 4.5409rem;
            height: 4.5409rem;
            padding: 1.2614rem;
            border-radius: 0;
            background: var(--front-secondary);
            opacity: 1;
            left: initial;
            right: initial;

            svg {
                fill: var(--front-primary);
            }
        }
    }

    @media (max-width: 768px) {
        min-height: auto;
        ;
    }
}

.home-concept {
    display: flex;
    width: 100vw;
    height: 90vh;
    justify-content: center;
    align-items: center;
    gap: 3.8rem;

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

    .main-wrapper {
        display: flex;
        align-items: flex-start;
        gap: 4rem;
        height: 100%;
        padding: 10% 0;

        @media(max-width: 900px) {
            flex-direction: column;
        }
    }

    .concept-text {
        flex: 1;
        height: 100%;

        @media(max-width: 900px) {
            flex: auto;
        }

        h2 {
            font-size: 4.8rem;
            line-height: 1.2;
            color: var(--front-primary);

            @media (max-width: 1400px),
            (max-height: 805px) {
                font-size: 3.5rem;
            }

            @media (max-width: 768px) {
                font-size: 2rem;
                margin-bottom: 0;
            }
        }
    }

    .image-wrapper {
        flex: 1;
        position: relative;
        height: 100%;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .decoration {
            position: absolute;
            bottom: -50px;
            left: -150px;
            width: 268.628px;
            height: 336.971px;
            background-image: url("../../../images/bastideco-initial-4tYDGa9.svg");
            background-repeat: no-repeat;
            background-size: contain;
            z-index: -1;
        }
    }

    .concept-description {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;

        p {
            font-size: 1.6rem;
            color: #666;
            margin-bottom: 2rem;

            @media (max-width: 768px) {
                font-size: 1.4rem;
            }
        }
    }
}

.home-services {
    background-color: var(--front-secondary);
    width: 100vw;
    height: auto;
    display: flex;
    min-height: 60vh;
    padding: 100px 0;

    @media (max-width: 768px) {
        padding: 50px 0;
    }

    .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 3.8rem;

        @media (max-width: 900px) {
            flex-direction: column;
            align-items: flex-start;
            gap: 1rem;
        }
    }

    .section-header {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        flex: 2;

        @media (max-width: 768px) {
            gap: 10px;
        }

        h2 {
            font-size: 2rem;
            color: #000;
            flex: 1;
            margin-bottom: 0;

            @media (max-width: 768px) {
                font-size: 2rem;
                margin-bottom: 0;
            }
        }

        p {
            margin-bottom: 1rem;
            color: #000;
        }

        .btn-link {
            color: var(--front-primary);
            text-decoration: underline;
            font-weight: bold;
        }
    }

    .services-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        flex: 5;
        height: 100%;

        @media(max-width: 768px) {
            grid-template-columns: 1fr;
        }

        .service-card {
            background: white;
            padding: 3rem 2rem;
            border: 1px solid #eee;
            transition: 0.3s;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;

            .icon-wrapper {
                width: 50px;
                height: 50px;

                img {
                    width: 100%;
                    height: 100%;
                }
            }

            h3 {
                font-size: 2rem;
                margin-bottom: 1rem;
                color: var(--front-primary);
                min-height: 4rem;
                display: flex;

                @media (max-width: 768px) {
                    font-size: 1.8rem;
                    min-height: auto;
                }
            }

            p {
                font-size: 1.5rem;
                color: #666;
                line-height: 1.6;

                @media (max-width: 768px) {
                    font-size: 1.4rem;
                }
            }

            &:hover {
                background-color: var(--front-primary);
                color: white;

                h3,
                p {
                    color: white;
                }

                .icon-wrapper img {
                    filter: brightness(0) invert(1); // Make icon white
                }
            }

        }
    }
}

.home-testimonials {
    min-height: 60vh;
    padding: 50px 0;

    h2 {
        font-size: 3rem;
        color: #000;
        text-align: center;
        margin-bottom: 4rem;

        @media (max-width: 768px) {
            font-size: 2rem;
            margin-bottom: 10px;
        }
    }
}

.home-realizations {
    background-color: var(--front-secondary);
    padding: 50px 0;
    position: relative;

    h2 {
        font-size: 3rem;
        color: #000;
        text-align: center;
        margin-bottom: 2rem;

        @media (max-width: 768px) {
            font-size: 2rem;
            margin-bottom: 20px;
        }
    }

    .splide__arrows {
        display: flex;
        justify-content: center;
        column-gap: 10px;
        z-index: 2;
        pointer-events: auto;
        margin-bottom: 2rem;

        .splide__arrow--prev,
        .splide__arrow--next {
            position: relative;
            transform: none;
            display: flex;
            width: 4.5409rem;
            height: 4.5409rem;
            padding: 1.2614rem;
            border-radius: 0;
            background: var(--front-primary);
            opacity: 1;
            left: initial;
            right: initial;
            transition: opacity .2s;

            &:hover {
                opacity: .8;
            }
        }
    }

    .realizations-gallery {
        height: 90%;

        .splide__track {
            height: 600px;
        }

        .gallery-item {
            position: relative;
            height: 100%;

            .gallery-img {
                width: 100%;
                height: 95%;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    transition: filter 0.2s, scale 0.2s;
                }
            }

            .item-hover {
                width: 100%;
                height: 95%;
                position: absolute;
                top: 0;
                left: 0;
                background: rgba(166, 88, 78, 0.3);
                color: white;
                display: flex;
                align-items: center;
                justify-content: center;
                opacity: 0;
                transition: opacity 0.3s;
            }

            &:hover {
                .gallery-img {
                    img {
                        scale: 1.1;
                    }
                }

                .item-hover {
                    opacity: 1;
                }
            }

            .caption {
                font-size: 1.6rem;
                color: #000;
            }
        }
    }
}

.home-reasons {
    text-align: center;
    padding: 50px 0;

    h2 {
        font-size: 3rem;
        margin-bottom: 4rem;

        @media (max-width: 768px) {
            font-size: 2rem;
            margin-bottom: 20px;
        }
    }

    .reasons-grid {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2rem;

        .reason-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            width: 150px;

            img {
                width: 50px;
                height: 50px;
            }
        }
    }
}

.home-blog {
    background-color: var(--front-primary);
    color: white;
    padding: 50px 0;

    .heading-blog {
        h2 {
            font-size: 3rem;
            color: white;
            text-align: center;

            @media (max-width: 768px) {
                font-size: 2rem;
                margin-bottom: 20px;
            }
        }
    }

    .list-article {
        display: flex;
        justify-content: center;
        gap: 2rem;
        margin-bottom: 3rem;

        @media(max-width: 900px) {
            grid-template-columns: 1fr;
        }

        .card-blog {
            background: transparent;
            flex: 1;
            max-width: 378px;

            .image-wrapper {
                height: 250px;
                margin-bottom: 1rem;
                overflow: hidden;

                img,
                .placeholder-img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    transition: transform 0.3s;
                }

                &:hover img {
                    transform: scale(1.05);
                }
            }

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

                .title {
                    font-size: 1.2rem;
                    font-weight: bold;
                    line-height: 1.4;
                    color: white;
                }

                .meta {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;

                    p {
                        font-size: 1rem;
                        color: white;
                    }

                    .read-more {
                        color: white;
                        text-decoration: underline;
                    }
                }
            }
        }
    }

    .blog-footer {
        display: flex;
        justify-content: center;

    }
}