/* Gallery Container */
.advanced-gallery-container {
    width: 100%;
    margin: 20px 0;
    --gap: 20px;
}

.advanced-gallery-grid {
    -webkit-column-count: var(--cols-mobile, 1);
    column-count: var(--cols-mobile, 1);
    -webkit-column-gap: var(--gap, 20px);
    column-gap: var(--gap, 20px);
    width: 100%;
}

@media (min-width: 768px) {
    .advanced-gallery-grid {
        -webkit-column-count: var(--cols-tablet, 2);
        column-count: var(--cols-tablet, 2);
    }
}

@media (min-width: 1024px) {
    .advanced-gallery-grid {
        -webkit-column-count: var(--cols-desktop, 3);
        column-count: var(--cols-desktop, 3);
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: var(--gap, 20px);
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid-column;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    border-radius: 0;
    /* JS will update corners */
    background: #f0f0f0;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.gallery-item-inner {
    width: 100%;
    position: relative;
    display: block;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.4s ease;
}

/* Hover Effects */
.has-hover-effects .gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    color: #fff;
    padding: 30px 20px 15px;
    font-size: 15px;
    font-weight: 500;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(2px);
}

.has-hover-effects .gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Load More */
.aig-load-more-container {
    text-align: center;
    margin-top: 40px;
}

.aig-load-more-btn {
    display: inline-flex;
    align-items: center;
    border-style: solid;
    border-width: 3px 3px 3px 3px;
    border-color: #0a4480;
    border-radius: 20px;
    padding: 12px 26px 12px 26px;
    background: transparent;
    color: #0a4480;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 800ms cubic-bezier(0.25, 1, 0.5, 1) !important;
    text-decoration: none;
    fill: #0a4480;
    width: fit-content;
    opacity: 1 !important;
    backface-visibility: hidden;
}

.aig-button-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.aig-load-more-btn:hover {
    background: #1767C5 !important;
    color: #ffffff !important;
    border-color: #1767C5 !important;
}

.aig-loader {
    font-weight: 500;
    color: #666;
    margin-top: 10px;
}

/* Lightbox */
.aig-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.aig-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.aig-lightbox-card {
    background: transparent;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    position: relative;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.aig-lightbox.active .aig-lightbox-card {
    transform: scale(1);
}

.aig-lightbox-content-wrapper {
    width: auto;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.aig-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.aig-lightbox-caption {
    color: #fff;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.aig-lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: url('../../../../uploads/2026/06/Group-1399.svg') no-repeat center center;
    background-size: contain;
    border: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.aig-lightbox-close:hover {
    transform: scale(1.1);
}

.aig-lightbox-prev,
.aig-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: none;
    width: 21px;
    height: 38px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.aig-lightbox-prev {
    left: 40px;
    background-image: url('../../../../uploads/2026/06/Path-798.svg');
}

.aig-lightbox-next {
    right: 40px;
    background-image: url('../../../../uploads/2026/06/Path-797.svg');
}

.aig-lightbox-prev:hover,
.aig-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.aig-lightbox-next:focus,
.aig-lightbox-prev:focus,
.aig-lightbox-close:focus {
    background-color: transparent !important;
}

@media (max-width: 1032px) {

    .aig-lightbox-prev,
    .aig-lightbox-next {
        display: none !important;
    }

    .aig-lightbox-close {
        top: 20px;
        right: 20px;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 767px) {
    .gallery-item {
        cursor: default;
    }

    .gallery-item:hover {
        transform: none;
        box-shadow: none;
    }

    .has-hover-effects .gallery-item:hover img {
        transform: none;
    }
}