/* Full-width clipping boundary. */
.project-challenges-section {
    --project-challenges-gap: 24px;
    --project-challenges-left-offset: 80px;
    --project-challenges-slide-width: 400px;
    --project-challenges-arrow-top: 200px;

    position: relative;

    width: 100vw;

    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    overflow: hidden;
}


/* Carousel begins at the calculated active-area left edge. */
.project-challenges {
    position: relative;

    width: calc(
        100% - var(--project-challenges-left-offset)
    );

    margin-left:
        var(--project-challenges-left-offset);
}


/* Desktop starts with three full cards plus half of the fourth. */
.project-challenges__slide {
    position: relative;

    width:
        var(
            --project-challenges-slide-width
        ) !important;

    flex:
        0
        0
        auto;
}


/* Initial clipping happens at the carousel track. */
.project-challenges .splide__track {
    overflow: hidden;

    cursor: grab;
}


/* After movement the full-width section becomes the clipping boundary. */
.project-challenges.has-moved
.splide__track {
    overflow: visible;
}


/* Dragging cursor. */
.project-challenges.is-dragging
.splide__track {
    cursor: grabbing;
}


/* Challenge card. */
.project-challenges__card {
    position: relative;

    display: block;

    width: 100%;

    margin: 0;
    padding: 0;
}


/* Challenge image area. */
.project-challenges__media {
    position: relative;

    width: 100%;

    aspect-ratio: 1.1 / 1;

    overflow: hidden;

    border-radius: 11px;

    background: #e3e3e3;
}
.project-challenges__media img {
    transition: transform 700ms ease;
}
.project-challenges__media:hover img {
    transform: scale(1.025);
}

/* Challenge image. */
.project-challenges__media > img.project-challenges__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}


/* Image gradient. */
.project-challenges__gradient {
    position: absolute;

    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 42%,
            rgba(0, 0, 0, 0.03) 50%,
            rgba(0, 0, 0, 0.18) 68%,
            rgba(0, 0, 0, 0.72) 100%
        );
}


/* Image content. */
.project-challenges__image-content {
    position: absolute;

    z-index: 2;

    left: 24px;
    right: 24px;
    bottom: 28px;
}


/* Challenge number. */
.project-challenges__number {
    margin: 0 0 8px;

    color: #ffffff;

    font-family: "Rajdhani", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}


/* Challenge title. */
.project-challenges__title {
    margin: 0;
    padding: 0;

    color: #ffffff;

    font-family: "Rajdhani", sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}


/* Challenge description. */
.project-challenges__description {
    width: 100%;
    padding: 16px 15px 16px 23px;
    color: #929292;
    font-family: "Rajdhani", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.5px;
}


/* Description paragraph spacing. */
.project-challenges__description p {
    margin-top: 0;
}


/* Final description paragraph spacing. */
.project-challenges__description p:last-child {
    margin-bottom: 0;
}


/* Partial-slide white overlay. */
.project-challenges__slide::after {
    content: "";

    position: absolute;

    inset: 0;

    z-index: 20;

    pointer-events: none;

    border-radius: 11px 11px 0 0;

    background:
        rgba(
            255,
            255,
            255,
            0.5
        );

    opacity: 0;

    transition:
        opacity
        300ms
        ease;
}


/* Show overlay on genuinely partial cards. */
.project-challenges__slide.is-partial::after {
    opacity: 1;
}


/* Arrow layer. */
.project-challenges__arrows {
    pointer-events: none;
}


/* Carousel arrows. */
.project-challenges__arrow {
    position: absolute;

    z-index: 40;

    top:
        var(
            --project-challenges-arrow-top
        );

    width: 46px;
    height: 46px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    color: #ffffff;

    background:
        rgba(
            90,
            90,
            90,
            0.68
        );

    cursor: pointer;

    pointer-events: auto;

    transform:
        translateY(-50%);

    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        background-color 180ms ease;
}


/* Arrow icon size. */
.project-challenges__arrow svg {
    display: block;

    width: 19px;
    height: 19px;
}


/* Arrow hover state. */
.project-challenges__arrow:hover {
    background:
        rgba(
            55,
            55,
            55,
            0.86
        );
}


/* Previous arrow follows the full-width left boundary. */
.project-challenges__arrow--prev {
    left:
        calc(
            -1
            *
            var(
                --project-challenges-left-offset
            )
            +
            16px
        );
}


/* Next arrow follows the full-width right boundary. */
.project-challenges__arrow--next {
    right: 16px;
}


/* Disabled arrows disappear. */
.project-challenges__arrow:disabled {
    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


/* Tablet spacing. */
@media (max-width: 1024px) {

    .project-challenges-section {
        --project-challenges-gap: 18px;
        --project-challenges-left-offset: 24px;
    }


    .project-challenges__image-content {
        left: 20px;
        right: 20px;
        bottom: 22px;
    }


    .project-challenges__arrow {
        width: 42px;
        height: 42px;
    }
}


/* Mobile spacing. */
@media (max-width: 767px) {

    .project-challenges-section {
        --project-challenges-gap: 14px;
        --project-challenges-left-offset: 12px;
    }


    .project-challenges__media {
        aspect-ratio: 1 / 1;
    }


    .project-challenges__image-content {
        left: 18px;
        right: 18px;
        bottom: 20px;
    }


    .project-challenges__description {
        padding-top: 14px;
    }


    .project-challenges__arrow {
        width: 38px;
        height: 38px;
    }


    .project-challenges__arrow--prev {
        left:
            calc(
                -1
                *
                var(
                    --project-challenges-left-offset
                )
                +
                8px
            );
    }


    .project-challenges__arrow--next {
        right: 8px;
    }
}


/* Reduced-motion support. */
@media (prefers-reduced-motion: reduce) {

    .project-challenges__slide::after,
    .project-challenges__arrow {
        transition: none;
    }
}