.polytech-slider {
    position: relative;
    padding: 0;
    width: 100%;
    height: 80dvh;

    .polytech-slider__prev,
    .polytech-slider__next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        border: none;
        background-color: rgba(0, 0, 0, 0.5);
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 12px;
        cursor: pointer;
        transition: background-color 0.5s;

        &:hover {
            background-color: rgba(0, 0, 0, 0.2);
        }
    }

    .polytech-slider__cursors {
        position: absolute;
        right: 32px;
        bottom: 30px;

        display: flex;
        gap: 8px;

        .polytech-slider__cursor {
            width: 8px;
            height: 4px;
            border-radius: 2px;
            background-color: #aaa;
            transition: all 0.5s;
            cursor: pointer;

            &.active {
                width: 16px;
                background-color: #fff;
            }
        }
    }

    .polytech-slider__prev {
        left: 16px;
        background-image: url(./assets/previous.svg);
    }

    .polytech-slider__next {
        right: 16px;
        background-image: url(./assets/next.svg);
    }
}

.polytech-slider__slides {
    display: flex;
    overflow-x: auto; /* le geste défile ici, jamais la page */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth; /* scrollTo() animé pour flèches et autoplay */
    overscroll-behavior-x: contain;
    scrollbar-width: none;

    &::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
}

.polytech-slide {
    position: relative;
    flex: 0 0 100%; /* chaque slide une largeur du conteneur */
    scroll-snap-align: start;

    &.visible {
        display: block;
    }

    video,
    img {
        width: 100%;
        height: 80dvh;
        object-fit: cover;
    }

    .polytech-slide__media-wrap {
        line-height: 0;
    }

    .polytech-slide__content {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 50%;
        height: 100%;

        padding: 64px 64px 32px 16%;
        box-sizing: border-box;

        background: linear-gradient(to right, rgba(0, 72, 119, 0), rgba(0, 72, 119, 0.8) 30%, rgba(0, 72, 119, 0.8));
        color: #fff;

        h2 {
            color: #fff;
        }

        .slide-content-squares {
            display: flex;
            gap: 4px;

            .slide-content-square {
                width: 12px;
                height: 12px;

                &:nth-child(4n + 1) {
                    background-color: var(--wp--preset--color--light-blue);
                }
                &:nth-child(4n + 2) {
                    background-color: var(--wp--preset--color--orange);
                }
                &:nth-child(4n + 3) {
                    background-color: var(--wp--preset--color--fushia);
                }
                &:nth-child(4n + 4) {
                    background-color: var(--wp--preset--color--dark-blue);
                }
            }
        }

        .polytech-slide__text {
            font-size: 1.2em;
        }

        .wp-block-button__link {
            height: auto;
            padding: 8px 16px;
            box-sizing: border-box;
            font-size: 1em;
            font-weight: normal;
        }
    }
}

@media screen and (max-width: 1200px) {
    .polytech-slide {
        .polytech-slide__content {
            width: 100%;
            background: rgba(0, 72, 119, 0.7);
            padding: 32px;
        }
    }
}
