/* Responsive Gallery Grid CSS */

.mab-responsive-gallery {
    display: grid;
    gap: 15px;
    width: 100%;
    padding: 40px 0;
    margin: 0;
}

.mab-gallery-item {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1; /* Keeps images square for a clean grid */
    background-color: #f5f5f5;
}

.mab-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.15);
}

.mab-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.mab-gallery-item:hover img {
    transform: scale(1.05);
}

/* Premium Hover Overlay */
.mab-gallery-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.mab-gallery-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    color: white;
    font-size: 32px;
    font-weight: 300;
}

.mab-gallery-item:hover::after,
.mab-gallery-item:hover .mab-gallery-overlay {
    opacity: 1;
}

.mab-gallery-item:hover .mab-gallery-overlay {
    transform: translate(-50%, -50%) scale(1);
}

/* Fallback for older browsers not supporting aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .mab-gallery-item {
        padding-bottom: 100%;
        height: 0;
    }
    .mab-gallery-item img {
        position: absolute;
        left: 0;
    }
}

/* Pagination Styles */
.mab-gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 40px;
}
.mab-gallery-pagination a,
.mab-gallery-pagination span {
    padding: 8px 16px;
    background-color: #f1f1f1;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.mab-gallery-pagination a:hover {
    background-color: #ddd;
}
.mab-gallery-pagination .current {
    background-color: #0073aa;
    color: #fff;
    font-weight: bold;
}
