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

    padding: 75px 0 90px;
    background: var(--gp-bg);
}

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

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

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

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

.r3s-gallery-heading h1 {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 800;
    color: var(--gp-text);
    margin-bottom: 15px;
}

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

.r3s-gallery-heading p {
    color: var(--gp-muted);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

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

.r3s-gallery-item {
    overflow: hidden;
    border-radius: 13px;
    border: 1px solid var(--gp-border);
    background: var(--gp-card);
}

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

.r3s-gallery-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .5s ease;
}

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

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

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

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

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

/* Bottom CTA */

.r3s-gallery-bottom {
    margin-top: 50px;
    padding: 35px;
    text-align: center;
    background: #171717;
    border-radius: 15px;
}

.r3s-gallery-bottom h3 {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 9px;
}

.r3s-gallery-bottom p {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
}

.r3s-gallery-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 23px;
    background: var(--gp-red);
    color: #fff;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.r3s-gallery-contact-btn:hover {
    background: #b9000c;
    color: #fff;
}

/* 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,.95);
}

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

.r3s-gallery-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.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,.15);
    color: #fff;
    cursor: pointer;
    transition: .3s ease;
}

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

.r3s-lightbox-close {
    top: 20px;
    right: 25px;
    width: 45px;
    height: 45px;
}

.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;
}

/* Dark Theme */

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

/* Responsive */

@media(max-width: 767px) {
    .r3s-gallery-page {
        padding: 55px 0 65px;
    }

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

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

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

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

    .r3s-gallery-overlay span {
        width: 35px;
        height: 35px;
        font-size: 13px;
        transform: none;
    }

    .r3s-gallery-bottom {
        padding: 25px 18px;
    }

    .r3s-gallery-bottom h3 {
        font-size: 18px;
    }

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

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

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

@media(prefers-reduced-motion: reduce) {
    .r3s-gallery-image img,
    .r3s-gallery-overlay,
    .r3s-gallery-overlay span {
        transition: none;
    }
}
