.cwp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--cwp-cols-desktop, 4), minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.cwp-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #eaf1f3;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(4, 31, 44, .08);
}

.cwp-gallery-item--hidden {
    display: none;
}

.cwp-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.cwp-gallery-item:hover img {
    transform: scale(1.04);
}

.cwp-gallery-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 31, 44, 0);
    transition: background .25s ease;
}

.cwp-gallery-hover span {
    padding: 8px 13px;
    background: rgba(255, 255, 255, .94);
    color: #062a3a;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .25s ease, transform .25s ease;
}

.cwp-gallery-item:hover .cwp-gallery-hover {
    background: rgba(4, 31, 44, .25);
}

.cwp-gallery-item:hover .cwp-gallery-hover span {
    opacity: 1;
    transform: translateY(0);
}

.cwp-gallery-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.cwp-gallery-load-more {
    appearance: none;
    min-width: 140px;
    padding: 11px 20px;
    background: #062a3a;
    color: #fff;
    border: 1px solid #062a3a;
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.cwp-gallery-load-more:hover {
    background: #147fd1;
    border-color: #147fd1;
    transform: translateY(-1px);
}

.cwp-gallery-load-more[hidden] {
    display: none !important;
}

.cwp-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 80px;
    background: rgba(4, 31, 44, .94);
    z-index: 2147483000;
}

.cwp-lightbox.is-open {
    display: flex;
}

.cwp-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cwp-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 130px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.cwp-lightbox-caption {
    max-width: 800px;
    margin-top: 16px;
    color: rgba(255, 255, 255, .86);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.cwp-lightbox-close {
    position: absolute;
    top: 22px;
    right: 26px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 50%;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.cwp-lightbox-prev,
.cwp-lightbox-next {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 60px;
    padding: 0;
    transform: translateY(-50%);
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 52px;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
    z-index: 3;
}

.cwp-lightbox-prev:hover,
.cwp-lightbox-next:hover {
    opacity: 1;
}

.cwp-lightbox-prev { left: 18px; }
.cwp-lightbox-next { right: 18px; }

body.cwp-lightbox-open {
    overflow: hidden !important;
}

@media (max-width: 980px) {
    .cwp-gallery-grid {
        grid-template-columns: repeat(var(--cwp-cols-tablet, 3), minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 767px) {
    .cwp-gallery-grid {
        grid-template-columns: repeat(var(--cwp-cols-mobile, 2), minmax(0, 1fr));
        gap: 7px;
    }

    .cwp-gallery-item {
        border-radius: 4px;
    }

    .cwp-gallery-hover {
        display: none;
    }

    .cwp-gallery-load-more-wrap {
        margin-top: 22px;
    }

    .cwp-lightbox {
        padding: 60px 15px 30px;
    }

    .cwp-lightbox-image {
        max-height: calc(100vh - 125px);
    }

    .cwp-lightbox-prev,
    .cwp-lightbox-next {
        top: auto;
        bottom: 20px;
        width: 44px;
        height: 54px;
        transform: none;
        background: rgba(4, 31, 44, .55);
        border-radius: 5px;
        font-size: 42px;
    }

    .cwp-lightbox-prev { left: 15px; }
    .cwp-lightbox-next { right: 15px; }

    .cwp-lightbox-close {
        top: 12px;
        right: 12px;
    }
}
