.photo-carousel{
    width: 100%;
    max-width: 100%;
    margin: var(--block-margin) 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--wide-width) minmax(0, 1fr);
}

.photo-carousel-heading{
    margin-bottom: var(--row-gap);
    grid-column: 2;
    grid-row: 1;
}

.photo-carousel-heading > *:last-child{
    margin-bottom: 0;
}

.photo-carousel-swiper{
    width: 100%;
    grid-column: span 3;
    grid-row: 2;
}

.photo-carousel-swiper .swiper-wrapper{
    padding-left: calc((100% - var(--wide-width)) / 2);
}

.photo-carousel-image{
    --max-image-size: 40rem;
    width: max-content;
    height: max-content;
    max-width: min(calc(var(--max-image-size) + var(--item-column-gap)), calc(70vw + var(--item-column-gap)));
    max-height: var(--max-image-size);
    padding-right: var(--item-column-gap);
    margin: 0;
    position: relative;
}

.photo-carousel-image img{
    max-height: 100%;
    object-fit: cover;
}

.photo-carousel-image-caption{
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% - var(--item-column-gap));
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--page-padding);
    color: var(--dark-background-text-color);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.photo-carousel-image-caption::before{
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(0deg, var(--dark-background-color) 50%, transparent 100%);
    opacity: 0.8;
    mix-blend-mode: multiply;
    z-index: -1;
}

.photo-carousel-image:hover .photo-carousel-image-caption{
    opacity: 1;
}

.photo-carousel-navigation{
    width: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    grid-column: 2;
    grid-row: 3;
    margin-top: var(--row-gap);
    pointer-events: none;
}

.photo-carousel-navigation button{
    width: 7.2rem;
    height: 7.2rem;
    pointer-events: all;
}

.photo-carousel-navigation button svg *{
    transition: all 0.3s ease;
}

.photo-carousel-navigation button svg rect{
    fill: var(--color-white);
}

.photo-carousel-navigation button:is(:hover, :focus, :active){
    outline: none;
}

.photo-carousel-navigation button:is(:hover, :focus, :active) svg rect{
    fill: var(--color-blue);
}

.photo-carousel-navigation button svg path{
    stroke: var(--color-blue);
}

.photo-carousel-navigation button:is(:hover, :focus, :active) svg path{
    stroke: var(--color-white);
}

@media (min-width: 768px){
    .photo-carousel{
        display: grid;
        grid-template-columns: minmax(0, 1fr) calc(var(--wide-width) - 18.4rem) 18.4rem minmax(0, 1fr);
    }

    .photo-carousel-heading{
        padding-right: var(--column-gap);
    }

    .photo-carousel-swiper{
        grid-column: 1 / span 4;
    }

    .photo-carousel-image{
        --max-image-size: 60rem;
    }

    .photo-carousel-navigation{
        grid-column: 2 / span 2;
        justify-content: space-between;
        margin-top: 0;
        z-index: 1;
        grid-row: 2;
        background: transparent;
        align-self: center;
    }

    .photo-carousel-heading ~ .photo-carousel-navigation{
        grid-column: 3;
        grid-row: 1;
        align-self: end;
        margin-bottom: var(--row-gap);
        justify-content: unset;
    }
}