/* Mosaic Gallery — portrait-optimized grid */
.khong-gian-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Grid — 3 columns, portrait cells */
.mosaic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 768px) {
    .mosaic-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Cell 1 — tall, spans 2 rows */
@media (min-width: 768px) {
    .mosaic-cell:nth-child(1) {
        grid-row: span 2;
    }
}

/* Each cell — portrait ratio */
.mosaic-cell {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #e8ddd0;
    aspect-ratio: 3 / 4;
}

@media (min-width: 768px) {
    .mosaic-cell:nth-child(1) {
        aspect-ratio: auto;
        min-height: 100%;
    }
}

/* Images */
.mosaic-cell .mosaic-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 1s ease;
}

.mosaic-cell .mosaic-img.active {
    opacity: 1;
}

/* Hover */
.mosaic-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(58, 41, 22, 0);
    transition: background 0.3s;
    border-radius: 6px;
    z-index: 2;
    pointer-events: none;
}

.mosaic-cell:hover::after {
    background: rgba(58, 41, 22, 0.1);
}

/* Mobile */
@media (max-width: 767px) {
    .khong-gian-gallery {
        padding: 0 12px;
    }

    .mosaic-cell {
        aspect-ratio: 2 / 3;
    }
}
