.works-gallery-section {
    padding: 80px 0;
}

.works-gallery-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.works-gallery-section__title {
    margin: 0;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
}

.works-gallery-section__meta {
    margin: 8px 0 0;
    color: #5c6672;
    font-size: 15px;
}

.works-gallery-section__pager {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.works-gallery-section__arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(7, 45, 74, 0.2);
    background: #fff;
    color: #072d4a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.works-gallery-section__arrow:hover {
    background: #072d4a;
    color: #fff;
}

.works-gallery-section__counter {
    min-width: 64px;
    text-align: center;
    font-weight: 600;
    color: #072d4a;
}

.works-gallery__page {
    display: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.works-gallery__page.is-active {
    display: grid;
    animation: worksGalleryPageIn 0.35s ease;
}

@keyframes worksGalleryPageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.works-gallery__thumb {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    background: transparent;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(7, 45, 74, 0.1);
}

.works-gallery__thumb img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.works-gallery__thumb:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.works-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.works-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.works-gallery-lightbox__content {
    max-width: min(1200px, 88vw);
    max-height: 88vh;
    text-align: center;
    transform: translateY(18px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.works-gallery-lightbox.is-open .works-gallery-lightbox__content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.works-gallery-lightbox__image {
    max-width: 100%;
    max-height: calc(88vh - 42px);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.works-gallery-lightbox__caption {
    margin-top: 10px;
    color: #fff;
    font-size: 14px;
}

.works-gallery-lightbox__close,
.works-gallery-lightbox__nav {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.works-gallery-lightbox__close:hover,
.works-gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-50%) scale(1.03);
}

.works-gallery-lightbox__close:hover {
    transform: scale(1.05);
}

.works-gallery-lightbox__close {
    top: 14px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.works-gallery-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 72px;
    border-radius: 10px;
    font-size: 36px;
    line-height: 1;
}

.works-gallery-lightbox__nav--prev {
    left: 16px;
}

.works-gallery-lightbox__nav--next {
    right: 16px;
}

body.works-gallery-open {
    overflow: hidden;
}

@media (max-width: 1199px) {
    .works-gallery__page {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .works-gallery-section__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .works-gallery-section__title {
        font-size: 28px;
    }

    .works-gallery__page {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .works-gallery__page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .works-gallery__thumb img {
        height: 140px;
    }

    .works-gallery-lightbox__nav {
        width: 42px;
        height: 62px;
    }
}
