.masonry{
padding-top: 30px;
}
/* Контейнер модалки */
.light_container {
    position: fixed;
    background-color: rgba(51, 51, 51, 0.9);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* Внутренний контейнер */
.light_inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: 80%;
}

/* Картинка */
.light_inner img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Картинка после загрузки */
.light_inner img.loaded {
    opacity: 1;
}

/* Стрелки навигации */
.light_nav {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-50%);
    z-index: 1081;
    pointer-events: none; /* важный момент: клики только на кнопки */
}

.light_nav a {
    pointer-events: auto;
    background: rgba(255,255,255,0.5);
    color: #000;
    padding: 10px 15px;
    font-size: 32px;
    text-decoration: none;
    border-radius: 4px;
    user-select: none;
    cursor: pointer;
    margin: 0 20px;
}

.light_nav a:hover {
    background: rgba(255,255,255,0.7);
}

/* Кнопка закрытия (крестик) */
.light_close {
    width: 28px;
    height: 28px;
    background: url('cross.png') no-repeat center center;
    background-size: contain;
    position: absolute;
    top: 30px;
    right: 30px;
    cursor: pointer;
    z-index: 1082;
}

/* Подпись под картинкой */
.light_caption {
    width: 100%;
    background: rgba(53, 53, 53, 0.8);
    color: #fff;
    font-size: 14px;
    text-align: center;
    padding: 10px;
}

/* Внутренний контейнер подписи */
.light_caption_inner {
    padding: 5px 10px;
}

/* Для мобильных устройств */
@media screen and (max-width: 720px) {
    .light_nav {
        display: flex !important;
    }
}
