body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    text-align: center;
}

h1 {
    margin-bottom: 20px;
}


.gallery {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns */
    gap: 30px;
    justify-content: center;
    padding: 20px;
    /* Adds space around the gallery */
    max-width: 80%;
    /* Limits width to prevent stretching */
    margin: 0 auto;
    /* Centers the gallery */
}


.gallery-item {
    position: relative;
    width: 340px;
    /* Increase width */
    height: 250px;
    /* Increase height */
    overflow: hidden;
    border-radius: 10px;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery img:hover {
    transform: scale(1.05);
}

.image-detail {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .image-detail {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.caption {
    color: white;
    margin-top: 10px;
    font-size: 18px;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 10px;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}