/* Masonry Gallery - Front End Styles */

.mg-masonry-gallery {
    margin: 20px 0;
}

.mg-gallery-item {
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mg-gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

/* Hover effect: Zoom */
.mg-hover-zoom:hover img {
    transform: scale(1.05);
}

/* Hover effect: Brighten */
.mg-hover-brighten:hover img {
    filter: brightness(1.15);
}

/* Hover effect: Shadow */
.mg-hover-shadow:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transform: translateY(-3px);
}

/* Hover effect: None */
.mg-hover-none:hover img {
    transform: none;
    filter: none;
}

/* Responsive: reduce columns on smaller screens */
@media (max-width: 1024px) {
    .mg-masonry-gallery.mg-cols-4,
    .mg-masonry-gallery.mg-cols-5,
    .mg-masonry-gallery.mg-cols-6 {
        column-count: 3 !important;
    }
}

@media (max-width: 767px) {
    .mg-masonry-gallery.mg-cols-3,
    .mg-masonry-gallery.mg-cols-4,
    .mg-masonry-gallery.mg-cols-5,
    .mg-masonry-gallery.mg-cols-6 {
        column-count: 2 !important;
    }
}

@media (max-width: 480px) {
    .mg-masonry-gallery {
        column-count: 1 !important;
    }
}

/* ========================
   Lightbox Styles
   ======================== */

.mg-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mg-lightbox-overlay.mg-lightbox-active {
    display: flex;
    opacity: 1;
}

.mg-lightbox-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
}

.mg-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: mg-lightbox-fadeIn 0.3s ease;
}

@keyframes mg-lightbox-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mg-lightbox-close {
    position: fixed;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 5px 12px;
    border-radius: 50%;
    transition: background 0.2s ease;
    z-index: 1000000;
}

.mg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mg-lightbox-prev,
.mg-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    padding: 15px 18px;
    border-radius: 50%;
    transition: background 0.2s ease;
    z-index: 1000000;
}

.mg-lightbox-prev {
    left: 20px;
}

.mg-lightbox-next {
    right: 20px;
}

.mg-lightbox-prev:hover,
.mg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile lightbox adjustments */
@media (max-width: 767px) {
    .mg-lightbox-prev,
    .mg-lightbox-next {
        padding: 10px 14px;
        font-size: 24px;
    }

    .mg-lightbox-prev {
        left: 10px;
    }

    .mg-lightbox-next {
        right: 10px;
    }

    .mg-lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
}
