/* Masonry Media Gallery Styles */

.emm-masonry-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.emm-masonry-container {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 20px;
    position: relative;
}

.emm-masonry-item {
    flex: 0 0 auto;
    box-sizing: border-box;
    margin-bottom: 20px;
    /* Add bottom margin for spacing */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}


@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emm-masonry-item-inner {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.emm-masonry-item-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image Wrapper */
.emm-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.emm-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.emm-masonry-item-inner:hover .emm-image-wrapper img {
    transform: scale(1.05);
}

/* Video Wrapper */
.emm-video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
}

.emm-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Video Embed for iframe */
.emm-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.emm-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Lightbox Trigger */
.emm-lightbox-trigger {
    display: block;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.emm-lightbox-trigger img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* Overlay for Lightbox */
.emm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.emm-lightbox-trigger:hover .emm-overlay {
    opacity: 1;
}

.emm-overlay i {
    font-size: 48px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.emm-lightbox-trigger:hover .emm-overlay i {
    transform: scale(1.1);
}

/* Play button for videos */
.emm-video-trigger .emm-overlay::before {
    content: '';
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emm-video-trigger .emm-overlay i {
    position: relative;
    z-index: 1;
    color: #000;
}

/* Title Styles */
.emm-item-title {
    padding: 15px 20px 10px;
}

.emm-item-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

/* Description Styles */
.emm-item-description {
    padding: 0 20px 20px;
    flex-grow: 1;
}

.emm-item-description p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Loading Indicator */
.emm-loading-indicator {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.emm-loading-indicator.active {
    display: block;
}

.emm-spinner {
    width: 29px;
    height: 29px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a1a2a4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.emm-loading-indicator p {
    margin: 0;
    color: #666;
    font-size: 16px;
    display: none;
    /* Hide loading text */
}

/* Load More Trigger (invisible element for intersection observer) */
.emm-load-more-trigger {
    height: 1px;
    width: 100%;
    visibility: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .emm-masonry-container {
        gap: 15px;
    }

    .emm-item-title h3 {
        font-size: 16px;
    }

    .emm-item-description p {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .emm-masonry-container {
        gap: 12px;
    }

    .emm-item-title {
        padding: 12px 15px 8px;
    }

    .emm-item-description {
        padding: 0 15px 15px;
    }

    .emm-item-title h3 {
        font-size: 15px;
    }

    .emm-item-description p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .emm-masonry-container {
        gap: 10px;
    }

    .emm-masonry-item-inner {
        border-radius: 8px;
    }
}

/* Animation delays for staggered effect */
.emm-masonry-item:nth-child(1) {
    animation-delay: 0s;
}

.emm-masonry-item:nth-child(2) {
    animation-delay: 0.1s;
}

.emm-masonry-item:nth-child(3) {
    animation-delay: 0.2s;
}

.emm-masonry-item:nth-child(4) {
    animation-delay: 0.3s;
}

.emm-masonry-item:nth-child(5) {
    animation-delay: 0.4s;
}

.emm-masonry-item:nth-child(6) {
    animation-delay: 0.5s;
}