/* =============================================
   NIBSS Masonry Gallery — Grid + Lightbox Styles
   ============================================= */

/* --- Masonry Grid Overrides --- */

.et_pb_gallery_items {
    display: block !important;
    column-count: 3;
    column-gap: 10px;
}

.et_pb_gallery_item {
    break-inside: avoid;
    margin-bottom: 10px;
    display: inline-block;
    width: 100%;
}

.et_pb_gallery_title,
.et_pb_gallery_caption {
    display: none;
}

.et_pb_gallery_image img {
    border-radius: 10px;
    width: 100%;
    height: auto;
    display: block;
}

.et_pb_gallery_image,
.et_pb_gallery_image a,
.et_pb_gallery_image img,
.et_pb_gallery_image .et_overlay {
    cursor: pointer !important;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .et_pb_gallery_items {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .et_pb_gallery_items {
        column-count: 1;
    }
}

/* --- Lightbox Overlay --- */

.gal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Lightbox Modal --- */

.gal-modal {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.gal-modal img {
    width: 100%;
    display: block;
}

.gal-info {
    padding: 16px 20px;
    background: #fff;
}

.gal-info-title {
    font-weight: 600;
    color: #222;
    font-size: 16px;
    margin: 0;
}

.gal-info-desc {
    font-size: 14px;
    color: #444;
    margin: 6px 0 0;
    line-height: 1.4;
}

.gal-info-date {
    font-size: 14px;
    color: #666;
    margin: 4px 0 0;
}

/* --- Close Button --- */

.gal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 20px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    color: #333;
    z-index: 100001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

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

/* --- Prev / Next Arrows --- */

.gal-prev,
.gal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 100001;
    transition: transform 0.2s ease;
}

.gal-prev {
    left: 16px;
}

.gal-next {
    right: 16px;
}

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

.gal-prev svg,
.gal-next svg {
    width: 20px;
    height: 20px;
    stroke: #333;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Body Scroll Lock --- */

body.gal-no-scroll {
    overflow: hidden;
}

/* --- Suppress Divi's built-in lightbox --- */
.et_pb_gallery .mfp-wrap,
.et_pb_gallery .mfp-bg,
.et_pb_gallery ~ .mfp-wrap,
.et_pb_gallery ~ .mfp-bg,
body .mfp-wrap.mfp-gallery,
body .mfp-bg.mfp-ready {
    display: none !important;
    visibility: hidden !important;
}
