/*
 ============================================================
 ASPIRIN V214
 RECEPTION MEDIA GALLERY + MANUAL ISSUE
 ============================================================
*/


/*
 * Ручное добавление проблемы.
 */

.a214-manual-tip {
    margin-top: 7px;
    color: rgba(255,255,255,.56);
    font-size: 12px;
    line-height: 1.45;
}


/*
 * Галерея.
 */

#asp145Viewer.a214-gallery {
    position: fixed;
    inset: 0;
    z-index: 10050;
}


#asp145Viewer.a214-gallery
#asp145ViewerBody {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    min-height: 0;
}


#asp145Viewer.a214-gallery
#asp145ViewerBody > img,

#asp145Viewer.a214-gallery
#asp145ViewerBody > video {
    display: block;

    max-width: 100%;
    max-height: 82vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 12px;
}


.a214-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 4;

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

    width: 48px;
    height: 60px;

    padding: 0;

    border:
        1px solid
        rgba(255,255,255,.12);

    border-radius: 16px;

    background:
        rgba(10,10,12,.72);

    color: #fff;

    font-size: 38px;
    font-weight: 500;
    line-height: 1;

    transform:
        translateY(-50%);

    backdrop-filter:
        blur(12px);
}


.a214-gallery-prev {
    left: 12px;
}


.a214-gallery-next {
    right: 12px;
}


.a214-gallery-nav[hidden] {
    display: none !important;
}


.a214-gallery-counter {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 4;

    padding: 7px 12px;

    border:
        1px solid
        rgba(255,255,255,.10);

    border-radius: 999px;

    background:
        rgba(10,10,12,.74);

    color:
        rgba(255,255,255,.82);

    font-size: 12px;
    font-weight: 700;

    transform:
        translateX(-50%);

    backdrop-filter:
        blur(12px);
}


.a214-gallery-loading,
.a214-gallery-error {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 220px;

    padding: 30px;

    color:
        rgba(255,255,255,.72);

    text-align: center;

    font-size: 14px;
    line-height: 1.5;
}


.a214-gallery-error {
    color: #ff9c9c;
}


/*
 * Стабильные миниатюры.
 */

.a145-media-item img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


@media (
    max-width: 520px
) {

    .a214-gallery-nav {
        width: 42px;
        height: 56px;

        font-size: 34px;
    }


    .a214-gallery-prev {
        left: 6px;
    }


    .a214-gallery-next {
        right: 6px;
    }
}


/*
 ============================================================
 ASPIRIN V214.1
 ASPIRIN_V2141_GALLERY_BACK_BUTTON
 ============================================================
 */


/*
 * Старый крестик остаётся тем же функциональным
 * элементом, но визуально становится большой
 * понятной кнопкой "← Назад".
 */

#asp145Viewer.a214-gallery
#asp214GalleryClose {

    position:
        absolute !important;

    top:
        calc(
            68px
            + env(safe-area-inset-top)
        ) !important;

    left:
        12px !important;

    right:
        auto !important;

    bottom:
        auto !important;

    z-index:
        20 !important;

    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        center !important;

    width:
        auto !important;

    min-width:
        106px !important;

    height:
        44px !important;

    padding:
        0 16px !important;

    border:
        1px solid
        rgba(255,255,255,.16) !important;

    border-radius:
        14px !important;

    background:
        rgba(10,10,12,.82) !important;

    color:
        #fff !important;

    font-size:
        0 !important;

    font-weight:
        800 !important;

    line-height:
        1 !important;

    transform:
        none !important;

    backdrop-filter:
        blur(14px);

    -webkit-backdrop-filter:
        blur(14px);
}


#asp145Viewer.a214-gallery
#asp214GalleryClose::before {

    content:
        "← Назад";

    display:
        block;

    font-size:
        15px;

    line-height:
        1;

    white-space:
        nowrap;
}


/*
 * Стрелки должны быть выше изображения
 * и всегда доступны для нажатия.
 */

#asp145Viewer.a214-gallery
.a214-gallery-nav {

    z-index:
        15 !important;
}


/*
 * Счётчик не перекрывает системную
 * нижнюю область телефона.
 */

#asp145Viewer.a214-gallery
.a214-gallery-counter {

    bottom:
        calc(
            20px
            + env(safe-area-inset-bottom)
        ) !important;
}


/*
 ============================================================
 ASPIRIN_V2143_SERVER_THUMBNAILS
 ASPIRIN_V2143_GALLERY_BACK_BUTTON
 ============================================================
 */

#asp145Viewer.a214-gallery
.a214-gallery-back {
    position: absolute;

    top:
        calc(
            env(safe-area-inset-top, 0px)
            + 14px
        );

    left: 14px;

    z-index: 20;

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

    min-width: 104px;
    height: 46px;

    padding:
        0
        16px;

    border:
        1px solid
        rgba(255,255,255,.15);

    border-radius: 15px;

    background:
        rgba(10,10,12,.88);

    color: #fff;

    font-size: 15px;
    font-weight: 800;
    line-height: 1;

    backdrop-filter:
        blur(14px);

    -webkit-backdrop-filter:
        blur(14px);

    cursor: pointer;
}


#asp145Viewer.a214-gallery
.a145-viewer-close {
    top:
        calc(
            env(safe-area-inset-top, 0px)
            + 14px
        ) !important;

    right: 14px !important;
    left: auto !important;

    z-index: 20 !important;
}


@media (
    max-width: 520px
) {

    #asp145Viewer.a214-gallery
    .a214-gallery-back {
        left: 10px;

        min-width: 96px;
        height: 44px;

        padding:
            0
            13px;

        font-size: 14px;
    }


    #asp145Viewer.a214-gallery
    .a145-viewer-close {
        right: 10px !important;
    }
}
