@mixin aspect-ratio($width, $height) {
    position: relative;

    &:before {
        display: block;
        content: "";
        width: 100%;
        padding-top: ($height / $width) * 100%;
    }

    >img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
}

/* // Styling */

section {
    /* background: #F4F4F4; */
    padding: 20px 0;
}

.container {
    /* margin-top: 1000px; */
    /* max-width: 1044px; */
    margin: 0 auto;
    /* padding: 0 20px; */
}

.carousel {
    /* display: block; */
    display: flex;
    text-align: left;
    /* position: relative; */
    /* margin-bottom: 22px; */

    >input {
        clip: rect(1px, 1px, 1px, 1px);
        clip-path: inset(50%);
        height: 1px;
        width: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;

        &:nth-of-type(4):checked~.fc4 .carousel__slides .carousel__slide:first-of-type {
            margin-left: -300%;
        }

        &:nth-of-type(3):checked~.fc4 .carousel__slides .carousel__slide:first-of-type {
            margin-left: -200%;
        }

        &:nth-of-type(2):checked~.fc4 .carousel__slides .carousel__slide:first-of-type {
            margin-left: -100%;
        }

        &:nth-of-type(1):checked~.fc4 .carousel__slides .carousel__slide:first-of-type {
            margin-left: 0%;
        }

        &:nth-of-type(1):checked~.fc2 .carousel__thumbnails li:nth-of-type(1) {
            opacity: 0.5;
        }

        &:nth-of-type(2):checked~.fc2 .carousel__thumbnails li:nth-of-type(2) {
            opacity: 0.5;
        }

        &:nth-of-type(3):checked~.fc2 .carousel__thumbnails li:nth-of-type(3) {
            opacity: 0.5;
        }

        &:nth-of-type(4):checked~.fc2 .carousel__thumbnails li:nth-of-type(4) {
            opacity: 0.5;
        }

    }
}

.carousel__slides {
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    display: flex;
}

.carousel__slide {
    position: relative;
    display: block;
    flex: 1 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: all 300ms ease-out;
    vertical-align: top;
    box-sizing: border-box;
    white-space: normal;

    figure {
        display: flex;
        margin: 0;
    }

    div {
        @include aspect-ratio(3, 2);
        width: 100%;
    }

    img {
        height: 610px;
        width: 100%;
        display: block;
        flex: 1 1 auto;
        object-fit: cover;
    }

    /* .card_slide:hover img {
        scale: 1.7;
    }

    .card_slide:hover img {
        transition: 2.2s;
        transform: scale(101%);
    } */

    figcaption {
        align-self: flex-end;
        padding: 20px 20px 0 20px;
        flex: 0 0 auto;
        width: 25%;
        min-width: 150px;
    }

    .credit {
        margin-top: 1rem;
        color: rgba(0, 0, 0, 0.5);
        display: block;
    }

    &.scrollable {
        overflow-y: scroll;
    }
}

.carousel__thumbnails {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    margin: 0 10px;
    height: 578px;
    overflow-x: hidden;
    scrollbar-width: none;

    .carousel__slides+& {
        margin-top: 20px;
    }

    li {
        flex: 1 1 auto;
        max-width: calc((100% / 6) - 20px);
        margin: 0 10px 10px 10px;
        transition: all 300ms ease-in-out;
    }

    label {
        display: block;
        @include aspect-ratio(1, 1);


        &:hover,
        &:focus {
            cursor: pointer;
            opacity: 0.5;

            img {
                box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.25);
                transition: all 300ms ease-in-out;
            }
        }
    }

    .fc2 img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        margin-bottom: 10px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .fc4 img {
        height: 590px;
        width: 80%;
        display: block;
        flex: 1 1 auto;
        object-fit: cover;
        margin-bottom: 30px;
    }

    .fc2 img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        margin-bottom: 10px;
    }

}

@media (min-width: 576px) and (max-width: 768px) {
    .fc4 img {
        height: 590px;
        width: 80%;
        display: block;
        flex: 1 1 auto;
        object-fit: cover;
        margin-bottom: 30px;
    }
}

.fc2-mobile-view {
    display: none;
}

.fc4-mobile-view {
    display: none;
}

@media (min-width: 200px) and (max-width: 576px) {

    .fc2 {
        display: none;
    }

    .fc4 {
        display: none;
    }
    .up_and_down{
        display: none;
    }
    .detail_margin{
        margin-top: 1rem;
    }

    .fc4-mobile-view {
        display: block;
        /* background: #000; */
        padding-left: 3rem;
        padding-right: 3rem;
        margin-bottom: 0.987rem;

        img {
            height: 100%;
        }

        label {
            display: block;
            @include aspect-ratio(1, 1);


            &:hover,
            &:focus {
                cursor: pointer;
                opacity: 0.5;

                img {
                    box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.25);
                    transition: all 300ms ease-in-out;
                }
            }
        }
    }

    .fc2-mobile-view {
        display: block;
        padding-left: 1.708rem;
        padding-right: 3rem;

    }

    .carousel__thumbnails {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: row;
        margin: 0 10px;
        height: 10rem;
        width: 448px;
        gap: 50px;
        overflow-x: scroll;
        /* overflow-y: scroll; */
        scrollbar-width: none;
    }

    .carousel {
        display: flex;
        flex-direction: column-reverse;

        >input {
            clip: rect(1px, 1px, 1px, 1px);
            clip-path: inset(50%);
            height: 1px;
            width: 1px;
            margin: -1px;
            overflow: hidden;
            padding: 0;
            position: absolute;

            &:nth-of-type(4):checked~.fc4-mobile-view .carousel__slides .carousel__slide:first-of-type {
                margin-left: -300%;
            }

            &:nth-of-type(3):checked~.fc4-mobile-view .carousel__slides .carousel__slide:first-of-type {
                margin-left: -200%;
            }

            &:nth-of-type(2):checked~.fc4-mobile-view .carousel__slides .carousel__slide:first-of-type {
                margin-left: -100%;
            }

            &:nth-of-type(1):checked~.fc4-mobile-view .carousel__slides .carousel__slide:first-of-type {
                margin-left: 0%;
            }

            &:nth-of-type(1):checked~.fc2-mobile-view .carousel__thumbnails li:nth-of-type(1) {
                opacity: 0.5;
            }

            &:nth-of-type(2):checked~.fc2-mobile-view .carousel__thumbnails li:nth-of-type(2) {
                opacity: 0.5;
            }

            &:nth-of-type(3):checked~.fc2-mobile-view .carousel__thumbnails li:nth-of-type(3) {
                opacity: 0.5;
            }

            &:nth-of-type(4):checked~.fc2-mobile-view .carousel__thumbnails li:nth-of-type(4) {
                opacity: 0.5;
            }

        }
    }
}

@media (min-width:430px) and (max-width:490px){
    .carousel__thumbnails {
        width: 388px;
        gap: 60px;
    }
}
@media (min-width:330px) and (max-width:430px){
    .carousel__thumbnails {
        width: 288px;
        gap: 70px;
    }
}