body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    text-align: center;
    margin: 20px 0;
}

.container2 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0; /* Padding at the top and bottom */
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 10px;
    width: 80%; /* Reduce width to make images smaller */
    max-width: 900px; /* Max width for alignment */
}

.image-container {
    position: relative;
    overflow: hidden;
    padding-top: 100%; /* Maintains square aspect ratio */
}

.thumbnail {
    background-color: black;
    position: absolute;
    border-width: 0;
    top: 0;
    left: 0;
    width: 100%; /* Adjust image size to fit container */
    height: 100%; /* Adjust image size to fit container */
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.10);
}

#show-more {
    display: block;
    width: 100%; /* Span the width of the grid */
    max-width: 600px; /* Align with gallery width */
    margin: 20px auto;
    padding: 10px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#show-more:hover {
    background-color: grey;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000; /* Ensure modal is on top of other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-content {
    max-width: 80%;
    max-height: 80vh;
    margin: auto;
    display: block;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1001; /* Ensure close button is on top of everything */
}

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

.prev, .next {
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: #fff;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    cursor: pointer;
    border-radius: 3px;
    z-index: 1001; /* Ensure navigation buttons are on top of everything */
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

#caption {
    text-align: center;
    color: #ccc;
    padding: 60px 20px;
    margin-top: 10px; /* Space between image and caption */
}


