/* Gallery page */
.page-gallery .gallery-section {
    padding: 100px 0 80px;
    margin-top: 70px;
    background: #fff;
    min-height: 60vh;
}

.gallery-title {
    font-size: 42px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gallery-thumb {
    width: 100%;
    height: auto;
    display: block;
    /*aspect-ratio: 5 / 7;*/
    object-fit: cover;
    vertical-align: middle;
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.gallery-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}

.gallery-lightbox-prev {
    left: 24px;
}

.gallery-lightbox-next {
    right: 24px;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.gallery-lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 968px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .gallery-title {
        font-size: 34px;
    }

    .gallery-lightbox {
        padding: 50px 16px 70px;
    }

    .gallery-lightbox-prev {
        left: 12px;
        width: 44px;
        height: 44px;
    }

    .gallery-lightbox-next {
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .gallery-lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .gallery-lightbox-prev svg,
    .gallery-lightbox-next svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 576px) {
    .page-gallery .gallery-section {
        padding: 80px 0 60px;
    }

    .gallery-title {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
