@use "sass:math";
@use "../Utils/_variables" as *;

.list-realization {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 50px;
    justify-content: flex-start;

    .realization-item {
        flex: 0 1 22%;
        max-width: 100%;
        min-width: 0;

        @media (max-width: 768px) {
            max-width: none;
            min-width: 45%;
            flex: 0 1 150px;
        }

        .realisation-img {
            height: auto;
            aspect-ratio: 2/3;
            width: 100%;
            overflow: hidden;
            position: relative;

            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;
                z-index: 1;
                transition: opacity 0.3s;
            }


            &::after {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: var(--front-primary);
                opacity: 0;
                transition: opacity 0.2s;
            }

        }

        &:hover {
            .realisation-img::after {
                opacity: .8;
            }

            .realisation-img .item-hover {
                opacity: 1;
            }
        }

        .caption {
            font-size: 1.2rem;
            color: #000;
            margin-top: 10px;
            font-weight: 500;
        }
    }
}

.intern.realization {

    .section-title-centered {
        text-align: center;
        color: var(--front-primary);
        font-size: 3rem;
        margin-bottom: 5px;
    }

    h2 {
        color: var(--front-primary);
        font-size: 3rem;
        margin-bottom: 5px;
    }

    p {
        max-width: 800px;
        margin: 0 auto;
    }

    .intro {
        align-items: center;
        max-width: 1000px;
        margin: 50px auto 150px !important;
        gap: 10px;

        @media (max-width: 1000px) {
            max-width: 100vw;
            margin: 0px auto !important;
            padding: 0 10px;
        }

        .bloc-intern {
            flex: 1;

            &:first-child {
                margin-right: 0;
            }
        }

        .fil-arrianne {
            width: auto;
            max-width: 100%;
            padding: 0;
            justify-content: flex-start;
            margin: 0;
        }

    }

    .bloc-beforeAfter {
        max-width: 95vw;
        margin: 40px auto;
        text-align: center;

        @media (max-width: 768px) {
            text-align: initial;
        }

        h2,
        h3,
        h4 {
            margin: 0;
        }

        .beforeAfter {
            display: flex;
            justify-content: space-between;
            width: 100%;
            gap: 5px;
            margin-top: 15px;
            flex-wrap: wrap;

            img {
                flex: 1;
                max-width: calc(50% - 5px);
            }
        }

    }

    .bloc-gallery {
        max-width: 100vw;
        margin: 80px auto 0px;
        padding: 40px 0 0;
        text-align: center;
        background-color: var(--front-secondary);

        h2,
        h3,
        h4 {
            margin: 0 0 9px;
        }

        .gallery {
            padding: 0;
            margin-top: 20px;

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

    .bloc-review {
        margin: 0 auto 40px;
        padding: 40px 0;
        text-align: center;
        background-color: var(--front-primary);

        h2,
        h3,
        h4 {
            color: white;
            margin: 0 0 9px;
        }

        p {
            color: white;
        }
    }
}

/* Modal Styles */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    justify-content: center;
    align-items: center;

    &.open {
        display: flex;
    }

    .close-modal {
        position: absolute;
        top: 20px;
        right: 35px;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        transition: 0.3s;
        cursor: pointer;
        z-index: 10000;

        &:hover,
        &:focus {
            color: #bbb;
            text-decoration: none;
            cursor: pointer;
        }
    }

    .gallery-modal-content {
        width: 80%;
        max-width: 1200px;
        height: 80%;
        display: flex;
        align-items: center;
        justify-content: center;

        #modal-slider {
            width: 100%;
            height: 100%;

            .splide__track {
                height: 100%;
            }

            .splide__list {
                height: 100%;
            }

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

                img {
                    max-width: 100%;
                    max-height: 100%;
                    width: auto;
                    height: auto;
                    object-fit: contain;
                }
            }
        }
    }
}