body{
    font-family: Arial, sans-serif;
    margin: 20px auto;
    background-color: #111;
    color: #fff;
    max-width: 1600px;
}
h1 {
    text-align: center;
    margin-bottom: 40px;
}
#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}
img {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}
img:hover {
    transform: scale(1.05);
}
figure.fullscreen img:hover {
    transform: none;
}
figure {
    padding: 8px;
    text-align: center;
}
figure.hidden {
    display: none;
}
figure.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    margin: 0;
}
figure.fullscreen img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    width: auto;
    height: auto;
}
figure.fullscreen h2,
figure.fullscreen p {
    display: none;
}

@media (max-width: 768px) {
    #gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    body {
        margin: 10px;
        width: 95%;
    }
    figure.fullscreen {
        padding: 0;
    }
    figure.fullscreen img {
        max-width: 100%;
        max-height: 100%;
    }
}

@media (max-width: 480px) {
    #gallery {
        grid-template-columns: 1fr;
    }
}
