/* Gallery Block */
.gallery-block {
    padding: 80px 0;
    background: #f8fafc;
}

.gallery-block__header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-block__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
}

.gallery-block__subtitle {
    font-size: 1.2rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Tabs */
.gallery-tabs__nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
}

.gallery-tab__btn {
    padding: 12px 24px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-tab__btn.active,
.gallery-tab__btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.gallery-tab__count {
    font-size: 0.8rem;
    opacity: 0.7;
}

.gallery-tab__btn.active .gallery-tab__count {
    opacity: 0.9;
}

/* Tab Content */
.gallery-tabs__content {
    position: relative;
}

.gallery-tabs--no-filters .gallery-tabs__content {
    margin-top: 0;
}

.gallery-tab__pane {
    display: none;
}

.gallery-tab__pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-tab__description {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-tab__empty {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-style: italic;
}

/* Gallery Grid */
.gallery-tab__grid {
    display: grid;
    gap: 25px;
}

.gallery-tab__grid.layout-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-tab__grid.layout-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-tab__grid.layout-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Gallery Items */
.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item__image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item__image img {
    transform: scale(1.05);
}

.gallery-item__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 2;
}

.gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__info {
    transform: translateY(10px);
    transition: transform 0.3s ease;
    width: 100%;
}

.gallery-item:hover .gallery-item__info {
    transform: translateY(0);
}

.gallery-item__category {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
.gallery-block__footer {
    text-align: center;
    margin-top: 50px;
}

.gallery-block__more-btn {
    display: inline-block;
    padding: 15px 40px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.gallery-block__more-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .gallery-block {
        padding: 60px 0;
    }
    
    .gallery-block__title {
        font-size: 2rem;
    }
    
    .gallery-tabs__nav {
        gap: 5px;
    }
    
    .gallery-tab__btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .gallery-tab__grid.layout-grid.columns-3,
    .gallery-tab__grid.layout-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-tab__grid.layout-grid.columns-2,
    .gallery-tab__grid.layout-grid.columns-3,
    .gallery-tab__grid.layout-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .gallery-tabs__nav {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery-tab__btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
}

.gallery-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-modal__content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: white;
    transition: background 0.3s ease;
}

.gallery-modal__close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.gallery-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: white;
    transition: background 0.3s ease;
}

.gallery-modal__nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.gallery-modal__prev {
    left: 20px;
}

.gallery-modal__next {
    right: 20px;
}

.gallery-modal__image-container {
    flex: 1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding: 60px 40px 40px;
    max-height: calc(100vh - 120px);
    max-width: 60vw;
}

.gallery-modal__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-modal__info {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.gallery-modal__title {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a202c;
}

.gallery-modal__counter {
    font-size: 0.9rem;
    color: #718096;
}

/* Zoom icon in gallery items */
.gallery-item__zoom {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover .gallery-item__zoom {
    opacity: 1;
}

.gallery-item__zoom svg {
    width: 20px;
    height: 20px;
    color: #1a202c;
}

/* Keyboard navigation hint */
.gallery-modal__hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive modal */
@media (max-width: 768px) {
    .gallery-modal__content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .gallery-modal__nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-modal__prev {
        left: 10px;
    }
    
    .gallery-modal__next {
        right: 10px;
    }
    
    .gallery-modal__image-container {
        padding: 50px 20px 30px;
    }
    
    .gallery-item__zoom {
        width: 35px;
        height: 35px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-item__zoom svg {
        width: 18px;
        height: 18px;
    }
    .gallery-modal__image-container {
    
    max-width: 100%;
}
}
/* Masonry / portfolio — original image proportions (CSS columns) */
.gallery-tab__grid.layout-masonry {
    display: block;
    column-gap: 18px;
    column-fill: balance;
}

.gallery-tab__grid.layout-masonry .gallery-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 18px;
    width: 100%;
    display: inline-block;
    vertical-align: top;
}

.gallery-tab__grid.layout-masonry .gallery-item__image {
    aspect-ratio: auto;
    height: auto;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-tab__grid.layout-masonry .gallery-item__image img {
    width: 100%;
    height: auto;
    max-height: 520px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.gallery-tab__grid.layout-masonry .gallery-item:hover .gallery-item__image img {
    transform: none;
}

.gallery-tab__grid.layout-masonry.columns-5 {
    column-count: 5;
}

.gallery-tab__grid.layout-masonry.columns-4 {
    column-count: 4;
}

.gallery-tab__grid.layout-masonry.columns-3 {
    column-count: 3;
}

.gallery-tab__grid.layout-masonry.columns-2 {
    column-count: 2;
}

.gallery-tab__grid.layout-masonry.columns-1 {
    column-count: 1;
}

@media (max-width: 1400px) {
    .gallery-tab__grid.layout-masonry.columns-5 {
        column-count: 4;
    }
}

@media (max-width: 1200px) {
    .gallery-tab__grid.layout-masonry.columns-5,
    .gallery-tab__grid.layout-masonry.columns-4 {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .gallery-tab__grid.layout-masonry.columns-5,
    .gallery-tab__grid.layout-masonry.columns-4,
    .gallery-tab__grid.layout-masonry.columns-3 {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .gallery-tab__grid.layout-masonry.columns-5,
    .gallery-tab__grid.layout-masonry.columns-4,
    .gallery-tab__grid.layout-masonry.columns-3,
    .gallery-tab__grid.layout-masonry.columns-2 {
        column-count: 1;
    }
}