/* Gallery grid */
.uq-acf-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

.uq-acf-gallery a.uq-gallery-img {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.uq-acf-gallery a.uq-gallery-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.uq-acf-gallery a.uq-gallery-img:hover img {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

@media (max-width: 992px) {
    .uq-acf-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 576px) {
    .uq-acf-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Lightbox */
.uq-lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    cursor: default;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.uq-lightbox-content {
    position: relative;
    width: 70vw;
    max-width: 900px;
    height: 46.67vw; /* 3:2 aspect ratio */
    max-height: 600px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
}

.uq-lightbox-slider {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.uq-lightbox-slider img {
    flex-shrink: 0;
    width: 70vw;
    max-width: 900px;
    height: 46.67vw;
    max-height: 600px;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

/* Buttons */
.uq-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.8);
    border: none;
    padding: 4px 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    color: #333;
    border-radius: 3px;
    line-height: 1;
    user-select: none;
    transition: background 0.3s ease;
}

.uq-lightbox-close:hover {
    background: rgba(255,255,255,1);
}

.uq-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    padding: 8px 15px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    border-radius: 3px;
    user-select: none;
    transition: background 0.3s ease;
    z-index: 10000;
}

.uq-lightbox-arrow:hover {
    background: rgba(255,255,255,1);
}

.uq-lightbox-prev {
    left: 10px;
}

.uq-lightbox-next {
    right: 10px;
}

@media (max-width: 600px) {
    .uq-lightbox-content {
        width: 90vw;
        height: 60vw;
        max-height: 90vh;
    }
    .uq-lightbox-slider img {
        width: 90vw;
        height: 60vw;
        max-height: 90vh;
    }
    .uq-lightbox-prev, .uq-lightbox-next {
        top: auto;
        bottom: 10px;
        left: 40%;
        right: 40%;
        transform: translateX(-50%);
        position: fixed;
        font-size: 24px;
        padding: 6px 12px;
    }
}
.uq-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* existing styles */
}
.uq-lightbox-prev {
    left: 10px;
}
.uq-lightbox-next {
    right: 10px;
}

@media (max-width: 600px) {
    .uq-lightbox-arrow {
        position: static;
        transform: none;
        width: 48px;
        height: 48px;
        font-size: 30px;
        margin: 0 1rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 2px 6px rgba(0,0,0,0.3);
        cursor: pointer;
        transition: background 0.3s ease;
        user-select: none;
    }
    .uq-lightbox-controls {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 10px; /* space just below image */
        gap: 1rem; /* space between left/right buttons */
    }
}