.rek-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}

.rek-gallery-item {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.rek-gallery-item[hidden] {
    display: none;
}

.rek-gallery-item > a {
    display: block;
    position: relative;
    color: #ffffff;
    text-decoration: none;
}

.rek-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

.rek-gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.75);
    font-size: 14px;
    font-weight: bold;
    line-height: 1.25;
    opacity: 0;
    transition: opacity 200ms ease;
}

.rek-gallery-item > a:hover figcaption,
.rek-gallery-item > a:focus figcaption {
    opacity: 1;
}

.rek-gallery-more {
    grid-column: 1 / -1;
    justify-self: center;
    min-height: 44px;
    margin-top: 10px;
    padding: 12px 28px;
    border: 0;
    border-radius: 50px;
    background: rgba(238, 238, 238, 1);
    color: rgba(26, 26, 26, 1);
    font-size: 14px;
    cursor: pointer;
}

.rek-gallery-more:hover,
.rek-gallery-more:focus {
    background: rgba(246, 66, 49, 1);
    color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .rek-gallery-item figcaption {
        transition: none;
    }
}

@media (max-width: 979px) {
    .rek-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .rek-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .rek-gallery {
        grid-template-columns: minmax(0, 1fr);
    }
}

.rek-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
}

.rek-gallery-lightbox[hidden] {
    display: none;
}

.rek-gallery-lightbox figure {
    margin: 0;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    color: #ffffff;
}

.rek-gallery-lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border: 1px solid rgba(255, 255, 255, 1);
}

.rek-gallery-lightbox figcaption {
    padding-top: 10px;
    font-size: 18px;
    font-weight: bold;
}

.rek-gallery-lightbox button {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

.rek-gallery-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 32px;
}

body.rek-gallery-open {
    overflow: hidden;
}
