
/* =====================================
   R3S PREMIUM GALLERY
===================================== */

.r3s-gallery-section {
    --gallery-red: #DD0311;
    --gallery-bg: var(--bg-primary, #fff);
    --gallery-card: var(--card-bg, #fff);
    --gallery-text: var(--text-primary, #171717);
    --gallery-muted: var(--text-secondary, #777);
    --gallery-border: var(--border-color, #e8e8e8);

    padding: 95px 0;
    background: var(--gallery-bg);
    overflow: hidden;
}

.r3s-gallery-container {
    width: min(1200px, calc(100% - 40px));
    margin: auto;
}

/* Heading */

.r3s-gallery-heading {
    max-width: 720px;
    margin: 0 auto 45px;
    text-align: center;
}

.r3s-gallery-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gallery-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 17px;
}

.r3s-gallery-eyebrow span {
    width: 25px;
    height: 2px;
    background: var(--gallery-red);
}

.r3s-gallery-heading h2 {
    color: var(--gallery-text);
    font-family: 'Manrope', sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 15px;
    letter-spacing: -1px;
}

.r3s-gallery-heading h2 span {
    color: var(--gallery-red);
}

.r3s-gallery-heading p {
    max-width: 620px;
    margin: auto;
    color: var(--gallery-muted);
    font-size: 15px;
    line-height: 1.8;
}

/* Gallery Grid */

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

.r3s-gallery-item {
    min-width: 0;
    overflow: hidden;
    border-radius: 13px;
    background: var(--gallery-card);
    border: 1px solid var(--gallery-border);
    animation: r3sGalleryReveal .45s ease both;
}

.r3s-gallery-hidden {
    display: none;
}

.r3s-gallery-image {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9e9e9;
}

.r3s-gallery-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.r3s-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .38);
    opacity: 0;
    transition: opacity .35s ease;
}

.r3s-gallery-zoom {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gallery-red);
    color: #fff;
    font-size: 18px;
    transform: scale(.7);
    transition: transform .35s ease;
}

.r3s-gallery-image:hover img {
    transform: scale(1.09);
}

.r3s-gallery-image:hover .r3s-gallery-overlay {
    opacity: 1;
}

.r3s-gallery-image:hover .r3s-gallery-zoom {
    transform: scale(1);
}

/* Show More */

.r3s-gallery-more-wrap {
    margin-top: 38px;
    text-align: center;
}

.r3s-gallery-more-btn {
    min-width: 175px;
    min-height: 50px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    border: 0;
    border-radius: 7px;
    background: var(--gallery-red);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: .3s ease;
}

.r3s-gallery-more-btn:hover {
    background: #b9000c;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(221, 3, 17, .2);
}

.r3s-gallery-more-btn i {
    font-size: 17px;
    transition: transform .3s ease;
}

.r3s-gallery-more-btn.is-expanded i {
    transform: rotate(180deg);
}

.r3s-gallery-count {
    margin: 12px 0 0;
    color: var(--gallery-muted);
    font-size: 12px;
}

/* Lightbox */

.r3s-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 70px;
    background: rgba(0, 0, 0, .94);
}

.r3s-gallery-lightbox.is-open {
    display: flex;
}

.r3s-gallery-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, .3);
}

.r3s-lightbox-close,
.r3s-lightbox-nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: .3s ease;
}

.r3s-lightbox-close:hover,
.r3s-lightbox-nav:hover {
    background: var(--gallery-red);
}

.r3s-lightbox-close {
    top: 22px;
    right: 25px;
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.r3s-lightbox-nav {
    top: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    transform: translateY(-50%);
}

.r3s-lightbox-prev {
    left: 18px;
}

.r3s-lightbox-next {
    right: 18px;
}

/* Animation */

@keyframes r3sGalleryReveal {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Theme */

[data-theme="dark"] .r3s-gallery-section {
    --gallery-bg: #101010;
    --gallery-card: #191919;
    --gallery-text: #f5f5f5;
    --gallery-muted: #aaa;
    --gallery-border: #303030;
}

/* Tablet */

@media (max-width: 991px) {
    .r3s-gallery-section {
        padding: 75px 0;
    }

    .r3s-gallery-grid {
        gap: 14px;
    }
}

/* Mobile */

@media (max-width: 575px) {
    .r3s-gallery-section {
        padding: 60px 0;
    }

    .r3s-gallery-container {
        width: calc(100% - 28px);
    }

    .r3s-gallery-heading {
        margin-bottom: 30px;
    }

    .r3s-gallery-heading h2 {
        font-size: 29px;
    }

    .r3s-gallery-heading p {
        font-size: 13px;
    }

    .r3s-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .r3s-gallery-item {
        border-radius: 9px;
    }

    .r3s-gallery-image {
        aspect-ratio: 1 / 1;
    }

    .r3s-gallery-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, .22),
            transparent 45%
        );
    }

    .r3s-gallery-zoom {
        width: 34px;
        height: 34px;
        font-size: 13px;
        transform: none;
        opacity: .9;
    }

    .r3s-gallery-more-wrap {
        margin-top: 27px;
    }

    .r3s-gallery-lightbox {
        padding: 50px 15px;
    }

    .r3s-lightbox-prev {
        left: 8px;
    }

    .r3s-lightbox-next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .r3s-gallery-item,
    .r3s-gallery-image img,
    .r3s-gallery-overlay,
    .r3s-gallery-zoom,
    .r3s-gallery-more-btn,
    .r3s-lightbox-nav,
    .r3s-lightbox-close {
        animation: none;
        transition: none;
    }
}

.r3s-gallery-more-btn {
    min-width: 190px;
    min-height: 50px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    border: 0;
    border-radius: 7px;
    background: #DD0311;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: .3s ease;
}

.r3s-gallery-more-btn:hover {
    background: #b9000c;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(221, 3, 17, .2);
}
