/* Grid Layout */
.msg-gallery-16f580a2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
}

.msg-col-16f580a2 {
    display: flex;
    flex-direction: column;
}

.msg-item-16f580a2 {
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Fix Safari rounding issues */
    width: 100%;
}

/* Image styling */
.msg-item-16f580a2 .msg-image-link-16f580a2 {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
}

.msg-item-16f580a2 img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.msg-item-16f580a2:hover img {
    transform: scale(1.05);
}

/* Overlays */
.msg-overlay-16f580a2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.msg-item-16f580a2:hover .msg-overlay-16f580a2 {
    opacity: 1;
}

.msg-overlay-content-16f580a2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.msg-icon-16f580a2 {
    font-size: 24px;
    display: flex;
}

.msg-icon-16f580a2 svg {
    width: 24px;
    height: 24px;
}

.msg-handle-16f580a2 {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 1024px) {
    .msg-gallery-16f580a2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .msg-gallery-16f580a2 {
        grid-template-columns: 1fr;
    }
    .msg-col-single-16f580a2 .msg-item-16f580a2,
    .msg-col-stacked-16f580a2 .msg-item-16f580a2 {
        height: 300px !important; /* Unified height for mobile */
    }
}