﻿.gallery-catalog {
    margin: 40px 0 100px;
}

.gallery-catalog-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-catalog-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.skeleton-wrapper:not(.skeleton-hidden) {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--bg-body);
    pointer-events: none;
}

.gallery-masonry {
    width: 100%;
    min-height: 1px;
}

.gallery-masonry-item {
    width: calc(25% - 9px);
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
}

/* Только для низких снимков (класс ставит gallery-infinite.js) */
.gallery-masonry-item .photo-item.photo-item--short {
    min-height: 320px;
}

.gallery-masonry-item .photo-item.photo-item--short .photo-item-img {
    width: 100%;
    min-height: 320px;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-masonry-item .photo-item.photo-item--short .photo-item-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.gallery-masonry-item .photo-item.photo-item--short:hover .photo-item-hover-info,
body.touch-device .gallery-masonry-item .photo-item.photo-item--short.active .photo-item-hover-info {
    max-height: 320px;
}

@media (max-width: 768px) {
    .gallery-masonry-item .photo-item.photo-item--short,
    .gallery-masonry-item .photo-item.photo-item--short .photo-item-img {
        min-height: 280px;
    }
}

@media (max-width: 900px) {
    .gallery-masonry-item { width: calc(50% - 6px); }
}

@media (max-width: 768px) {
    .gallery-masonry-item { width: calc(50% - 6px); margin-bottom: 16px; }
}

@media (max-width: 560px) {
    .gallery-masonry-item { width: 100%; }
}

@media (max-width: 375px) {
    .gallery-masonry-item { margin-bottom: 12px; }
}

.gallery-hidden {
    display: none;
}

.gallery-infinite-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
}

.gallery-counter,
.gallery-loading {
    font-size: 14px;
    color: var(--text-muted);
}

.catalog-empty,
.gallery-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.5;
    padding: 40px 0;
}

.gallery-sentinel {
    height: 1px;
}

@keyframes gallery-fade-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-masonry-item.gallery-appearing {
    animation: gallery-fade-in 0.4s ease forwards;
}