/* Scoped Gallery Layout Container */
.gallery-container-f187c2f3 {
    display: flex;
    flex-flow: column nowrap;
    width: 100%;
    box-sizing: border-box;
}

/* Base Main Image Styling */
.gallery-main-image-wrapper {
    position: relative;
    width: 100%;
    margin: 0;
    flex-grow: 1;
}

.gallery-main-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7f7f7;
    box-sizing: border-box;
}

.gallery-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s ease-in-out;
}

/* Aspect Ratio Modifiers */
.gallery-aspect-16-9 .gallery-main-image-wrapper {
    aspect-ratio: 16/9;
}
.gallery-aspect-4-3 .gallery-main-image-wrapper {
    aspect-ratio: 4/3;
}
.gallery-aspect-1-1 .gallery-main-image-wrapper {
    aspect-ratio: 1/1;
}
.gallery-aspect-3-2 .gallery-main-image-wrapper {
    aspect-ratio: 3/2;
}

/* Fullscreen Button Overlays */
.gallery-fullscreen-btn {
    position: absolute;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.gallery-fullscreen-btn:hover {
    transform: scale(1.05);
}

.gallery-fs-pos-top-left-desktop .gallery-fullscreen-btn { top: 12px; left: 12px; }
.gallery-fs-pos-top-right-desktop .gallery-fullscreen-btn { top: 12px; right: 12px; }
.gallery-fs-pos-bottom-left-desktop .gallery-fullscreen-btn { bottom: 12px; left: 12px; }
.gallery-fs-pos-bottom-right-desktop .gallery-fullscreen-btn { bottom: 12px; right: 12px; }

/* Main Image Navigation Arrows */
.gallery-main-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.gallery-main-arrow:hover {
    transform: translateY(-50%) scale(1.05);
}
.gallery-main-prev {
    left: 15px;
}
.gallery-main-next {
    right: 15px;
}

/* Thumbnail Container Layouts */
.gallery-thumbs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.gallery-thumbs-scroll-container {
    overflow: auto;
    width: 100%;
    scrollbar-width: none; /* Hide default scrollbar */
}
.gallery-thumbs-scroll-container::-webkit-scrollbar {
    display: none;
}

.gallery-thumbs-list {
    display: flex;
    flex-flow: row nowrap;
}

.gallery-thumb {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
    background-color: #eee;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Arrow Navigation Buttons */
.gallery-nav-arrow {
    position: absolute;
    z-index: 5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Bottom thumbnails (Default / Row) */
.gallery-thumbs-bottom-desktop .gallery-container-f187c2f3 {
    flex-direction: column;
}
.gallery-thumbs-bottom-desktop .gallery-thumbs-wrapper {
    flex-direction: row;
}
.gallery-thumbs-bottom-desktop .gallery-thumbs-list {
    flex-direction: row;
}
.gallery-thumbs-bottom-desktop .gallery-prev { left: 5px; }
.gallery-thumbs-bottom-desktop .gallery-next { right: 5px; }

/* Left thumbnails column */
.gallery-thumbs-left-desktop .gallery-container-f187c2f3 {
    flex-direction: row-reverse;
}
.gallery-thumbs-left-desktop .gallery-thumbs-wrapper {
    flex-direction: column;
    width: auto;
}
.gallery-thumbs-left-desktop .gallery-thumbs-list {
    flex-direction: column;
}
.gallery-thumbs-left-desktop .gallery-thumbs-scroll-container {
    max-height: 450px;
}
.gallery-thumbs-left-desktop .gallery-prev { top: 5px; }
.gallery-thumbs-left-desktop .gallery-next { bottom: 5px; }

/* Right thumbnails column */
.gallery-thumbs-right-desktop .gallery-container-f187c2f3 {
    flex-direction: row;
}
.gallery-thumbs-right-desktop .gallery-thumbs-wrapper {
    flex-direction: column;
    width: auto;
}
.gallery-thumbs-right-desktop .gallery-thumbs-list {
    flex-direction: column;
}
.gallery-thumbs-right-desktop .gallery-thumbs-scroll-container {
    max-height: 450px;
}
.gallery-thumbs-right-desktop .gallery-prev { top: 5px; }
.gallery-thumbs-right-desktop .gallery-next { bottom: 5px; }


/* Lightbox Overlay Styling */
.gallery-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

body.admin-bar .gallery-lightbox-overlay {
    top: var(--wp-admin--admin-bar--height, 32px);
    height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 100000;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    z-index: 100000;
    transition: color 0.2s ease;
}
.lightbox-arrow:hover {
    color: #ccc;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-content {
    max-width: 85%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    font-family: sans-serif;
    font-size: 16px;
    text-align: center;
}

/* Empty Placeholder style */
.gallery-empty-placeholder-f187c2f3 {
    padding: 40px;
    border: 2px dashed #ccc;
    text-align: center;
    color: #888;
    background-color: #fafafa;
    border-radius: 4px;
}

/* RESPONSIVE LAYOUT FALLBACKS (Tablet and Mobile forced bottom horizontal) */
@media screen and (max-width: 1024px) {
    .gallery-container-f187c2f3,
    .gallery-thumbs-left-desktop .gallery-container-f187c2f3,
    .gallery-thumbs-right-desktop .gallery-container-f187c2f3 {
        flex-direction: column !important;
    }

    .gallery-thumbs-wrapper,
    .gallery-thumbs-left-desktop .gallery-thumbs-wrapper,
    .gallery-thumbs-right-desktop .gallery-thumbs-wrapper {
        flex-direction: row !important;
        width: 100% !important;
    }

    .gallery-thumbs-list,
    .gallery-thumbs-left-desktop .gallery-thumbs-list,
    .gallery-thumbs-right-desktop .gallery-thumbs-list {
        flex-direction: row !important;
    }

    .gallery-thumbs-scroll-container,
    .gallery-thumbs-left-desktop .gallery-thumbs-scroll-container,
    .gallery-thumbs-right-desktop .gallery-thumbs-scroll-container {
        max-height: none !important;
    }
}
