.masonry-gallery {
    column-count: 3;
    column-gap: 20px;
}

.masonry-gallery img {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.4s ease;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.masonry-gallery img:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 40px rgba(123, 63, 228, 0.2);
}

/* Планшет */
@media (max-width: 992px) {
    .masonry-gallery {
        column-count: 2;
    }
}

/* Телефон */
@media (max-width: 576px) {
    .masonry-gallery {
        column-count: 1;
    }
}


.wrapper__cards,
.modal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 10px;
    object-fit: cover;
}

.card h4 {
    font-size: 18px;
    margin: 5px 0;
    color: #0C111F;
}

.card span {
    font-size: 14px;
    color: #6b7280;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: #fefefe;
    margin: 50px auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal .close {
    color: #333;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.card {
    transition: 0.3s ease all;
}

.card span {
    transition: 0.3s ease all;
}

.card:hover {
    background: #6f42c1;
    color: #fff;
}

.card:hover span {
    color: #fff;
}