body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace;
    /*background-color: #f4f4f4;*/
}

div {
}

.headline {
    background-color: #f0f0f0;
    border: 2px solid red;
}

.gallery-title {
    text-align: center;
    margin-bottom: 15px;
}

.gallery-container {
    max-width: 1024px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid black;
    border-radius: 5px;
    cursor: pointer;
}

.gallery img:hover {
    opacity:80%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    height: 90%;
    position: relative; /* For positioning buttons */
    border: 2px solid green;
}

.modal-content img {
    display: block;
    max-height: 100%;
    width: auto;
    max-width: 100%;
    border-radius: 5px;
}

.close {
    color: #fefefe;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 35px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Navigation Buttons */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 15px;
    border: none;
    font-size: 32px;
    cursor: pointer;
    border-radius: 5px;
    opacity: 0.6;
    /*transition: opacity 0.3s ease;*/
    height: 30%;
}

.prev:hover, .next:hover {
    opacity: 1;
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 5px;
    }

    .modal-content {
        margin: 15px;
        width: 85%;
        height: 85%;
        /*
        max-width: 95%;
        max-height: 95%;
        */
    }

    .close {
        top: 10px;
        right: 20px;
        font-size: 24px;
    }

    .prev, .next {
        padding: 10px;
        font-size: 18px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }
}