.mosaic-container {
    background-color: transparent; /* makes it see-through */
    padding: 2rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.mosaic-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 25%;
    position: relative;
}

.mosaic-triangle {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.mosaic-down {
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.mosaic-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease, filter 0.5s ease;
    z-index: 1;
}

.mosaic-triangle:hover .mosaic-background {
    transform: scale(1.1);
    filter: grayscale(100%) brightness(70%);
}

.mosaic-content {
    position: absolute;
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    z-index: 2;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.mosaic-up .mosaic-content {
    bottom: 0;
}

.mosaic-down .mosaic-content {
    top: 0;
}

.mosaic-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0;
    padding: 0 0.5rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    text-align: center;
}



.mosaic-content h3::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(to right, black, red);
    width: 0;
    transition: width 0.3s ease;
    margin-top: 4px;
}

.mosaic-content h3:hover::after {
    width: 100%;
}

@media screen and (max-width: 768px) {
    .mosaic-link {
        width: 100%;
        margin-bottom: 15px;
    }

    .mosaic-triangle {
        padding-top: 100%;
    }
}
