/* Галерея */
.gallery {
	display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.block-text {
    width: 100%;
    padding: 5px;
    text-align: center;
    background: #3F51B5;
    color: white;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
		width: 100%;
    }
}

.gallery-item {
	background: #ffffff;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 3px solid #ddd; /* Граница */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Тень */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05); /* Зум при наведении */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease; /* Плавное изменение */
}

/* Анимация модального окна */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
	z-index: 99999;
}

.modal img {
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    border: 3px solid white;
    transition: opacity 0.3s ease-in-out;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.modal-thumbnails img {
    width: 60px;
    height: 60px;
    cursor: pointer;
    border-radius: 5px;
    border: 2px solid white;
    transition: transform 0.3s ease, opacity 0.3s ease-in-out;
}

.modal-thumbnails img:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Кнопка закрытия */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: white;
}
