.rwac-gallery-fullwidth,
.rwac-gallery-fullwidth * {
    box-sizing: border-box;
}

.rwac-gallery-fullwidth {
    width: 100vw;
    max-width: none !important;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
}

.rwac-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.rwac-gallery-item {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    font: inherit;
}

.rwac-gallery-item:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -4px;
}

.rwac-gallery-thumb {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 220ms ease;
}

.rwac-gallery-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 32, 12, 0.75);
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.rwac-gallery-plus {
    color: #fff;
    font: 300 34px/1 Arial, Helvetica, sans-serif;
    transform: translateY(-1px);
}

.rwac-gallery-item:hover .rwac-gallery-hover,
.rwac-gallery-item:focus-visible .rwac-gallery-hover {
    opacity: 1;
}

.rwac-gallery-item:hover .rwac-gallery-thumb {
    transform: scale(1.015);
}

.rwac-lightbox {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    padding: 24px 86px;
}

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

.rwac-lightbox-stage {
    /*
     * Use the viewport itself as the centering box. This prevents theme rules
     * on content wrappers, images, or generic divs from nudging the displayed
     * photograph away from the true horizontal/vertical center of the browser.
     */
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 24px 86px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    pointer-events: none;
    transform: none !important;
}

.rwac-lightbox-image {
    position: static !important;
    display: block !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    height: auto !important;
    max-width: min(900px, calc(100vw - 172px)) !important;
    max-height: min(900px, calc(100vh - 48px)) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/*
 * Lightbox controls intentionally use position:fixed and aggressive resets.
 * Some themes apply global button positioning/visibility rules. Keeping these
 * controls fixed to the viewport and explicitly resetting those properties
 * prevents a theme from pushing the right-side controls off-screen.
 */
body .rwac-lightbox .rwac-lightbox-close,
body .rwac-lightbox .rwac-lightbox-arrow {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: fixed !important;
    z-index: 2147483647 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    text-indent: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    border: 2px solid rgba(255, 45, 20, 0.95) !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.42) !important;
    color: #fff !important;
    cursor: pointer !important;
    line-height: 1 !important;
    font-style: normal !important;
    text-decoration: none !important;
}

.rwac-lightbox-close:hover,
.rwac-lightbox-arrow:hover,
.rwac-lightbox-close:focus-visible,
.rwac-lightbox-arrow:focus-visible {
    background: rgba(255, 45, 20, 0.85) !important;
    outline: none !important;
}

body .rwac-lightbox .rwac-lightbox-close {
    top: 18px !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    width: 42px !important;
    height: 42px !important;
    transform: none !important;
    font-size: 34px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: 300 !important;
}

body .rwac-lightbox .rwac-lightbox-arrow {
    top: 50% !important;
    bottom: auto !important;
    width: 52px !important;
    height: 52px !important;
    transform: translateY(-50%) !important;
    font-size: 28px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: 400 !important;
}

body .rwac-lightbox .rwac-lightbox-prev {
    left: 18px !important;
    right: auto !important;
}

body .rwac-lightbox .rwac-lightbox-next {
    right: 18px !important;
    left: auto !important;
}

.rwac-lightbox-count {
    position: absolute;
    pointer-events: none;
    right: 8px;
    bottom: 6px;
    padding: 3px 7px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font: 12px/1.4 Arial, Helvetica, sans-serif;
}

body.rwac-lightbox-open {
    overflow: hidden;
}

.rwac-gallery-empty {
    padding: 16px;
    border: 1px dashed #bbb;
}

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

@media (max-width: 600px) {
    .rwac-gallery-grid {
        grid-template-columns: 1fr;
    }

    .rwac-lightbox {
        padding: 18px 12px;
    }

    .rwac-lightbox-stage {
        padding: 54px 12px 18px !important;
    }

    .rwac-lightbox-image {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 72px) !important;
    }

    .rwac-lightbox-arrow {
        width: 44px;
        height: 44px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.58);
    }

    body .rwac-lightbox .rwac-lightbox-prev {
        left: 8px !important;
        right: auto !important;
    }

    body .rwac-lightbox .rwac-lightbox-next {
        right: 8px !important;
        left: auto !important;
    }

    body .rwac-lightbox .rwac-lightbox-close {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rwac-gallery-thumb,
    .rwac-gallery-hover {
        transition: none;
    }
}

/* Theme-compatibility safeguards. */
.rwac-gallery-grid > a.rwac-gallery-item {
    text-decoration: none !important;
    line-height: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
}

.rwac-gallery-grid > a.rwac-gallery-item > img.rwac-gallery-thumb {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
