@import '~flickity/css/flickity'
@import '~@style/_config/app-bootstrap-bulma'

$gallery-control-size = 40px

@keyframes fade-in
    0%
        opacity 0
    100%
        opacity 1
.gallery_modal-carousel
    position absolute
    left 0
    top 0
    width 100%
    height 100%
    background $color-gray
    transition background .5s
    overflow hidden

    .gallery__control_close
        z-index 2
    .gallery__carousel,
    .gallery__footer
        opacity 1
        transition opacity .5s
        z-index 1
    .gallery__progress
        opacity 0
        transition opacity .5s
        z-index 0

    &.gallery_loading
        background rgba($color-gray, .0001)
        .gallery__control_close
            display none
        .gallery__carousel,
        .gallery__footer
            opacity 0.0001
        .gallery__progress
            opacity 1

    .gallery__progress
        position absolute
        left 50%
        top 50%
        color $color-white
        font-size 16px
        font-weight normal
        text-align center
        transform translate(-50%, -50%)
    .gallery__progress-bar-holder
        margin 7px 0
        width 240px
        height 4px
        background rgba($color-white, .3)
    .gallery__progress-bar
        position relative
        width 0
        height 100%
        background $color-brand-darken
        transition width .1s

    .gallery__carousel
        position relative
        width 100%
        height calc(100% - 155px)
    .flickity-viewport
        height 100% !important

    .gallery__footer
        position relative
        display flex
        justify-content space-between
        align-items center
        width 100%
        height 155px
        padding 0 40px
        background #fff
        +tablet()
            width 60%
            margin 0 auto

    .gallery__image-holder
        position relative
        height 100%
        background #fff
        &.is-selected img
            opacity 1

    img
        position relative
        width auto
        height 100%
        max-width none
        opacity .25
        transition opacity .3s

    .gallery__image-hint
        max-width 383px
        color #232323
        font-size 14px
        letter-spacing 0.5px
        line-height 22px
        +until($tablet)
            display none

    .gallery__statistics
        margin-right 40px
        color #939393
        font-size 16px
        letter-spacing 0.5px
        white-space nowrap

    .gallery__controls
        display flex
        justify-content flex-end
        align-items center

    .gallery__control
        display flex
        justify-content center
        align-items center
        width $gallery-control-size
        height $gallery-control-size
        border-radius 4px
        background transparent
        cursor pointer
        transition background .15s, color .15s
        z-index 2

        &_close
            position absolute
            right 32px
            top 32px
            height 40px
            width 40px
            color #fff
            font-size 14px
            background $color-brand-darken
            border $color-brand-darken
            box-shadow 0 12px 18px 0 rgba($color-black, .14)
            svg
                stroke #fff
                stroke-width 1px
            &:hover
                background #68a02a
                border-color #68a02a
                box-shadow 0 12px 18px 0 rgba($color-black, .18)
            &:active
                background #507f1c
                border-color #507f1c
                box-shadow 0 12px 18px 0 rgba($color-black, .24)

        &_prev, &_next
            position relative
            color #ccc
            font-size 12px
            border 1px solid #ccc
            &:hover
                background rgba(#ccc, .1)
            &:active
                background rgba(#ccc, .2)
        &_next
            margin-left 8px