/* Сетка галереи - точно как в оригинальном коде */
.mangal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 15px;
    padding: 15px;
}

.mangal-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
}

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

.mangal-gallery a {
    text-decoration: none;
    display: block;
}

/* Модальное окно для просмотра фото - точно как в оригинале */
.mangal-modal {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.mangal-modal img {
    max-width: 95%;
    max-height: 90%;
    border-radius: 10px;
    object-fit: contain;
}

.mangal-modal:target {
    display: flex;
}

.mangal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    z-index: 1000;
    padding: 10px;
    line-height: 1;
}

.mangal-close:hover {
    color: red;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .mangal-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-gap: 10px;
        padding: 10px;
    }
    
    .mangal-gallery img {
        height: 150px;
    }
    
    .mangal-close {
        font-size: 40px;
        top: 10px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .mangal-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mangal-gallery img {
        height: 120px;
    }
}