body {
margin: 0;
font-family: Arial, sans-serif;
background-color: rgba(0, 0, 0, 0.9);
}

h1 {
text-align: center;
padding: 10px;
color: rgb(226, 226, 226);
margin: 10px 0;
}

p {
text-align: center;
padding: 10px;
color: rgb(226, 226, 226);
margin: 10px 0;
font-size: 18px;
}

.gallery {
display: flex;
flex-wrap: wrap;
gap: 20px;
padding: 20px;
}

.gallery-item {
flex: 1 1 calc(33.333% - 20px);
max-width: calc(33.333% - 20px);
cursor: pointer;
transition: transform 0.2s;
}

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

/* Media query for tablets and small desktops */
@media (max-width: 768px) {
.gallery-item {
flex: 1 1 calc(50% - 20px);
max-width: calc(50% - 20px);
}
}

/* Media query for mobile devices */
@media (max-width: 480px) {
.gallery-item {
flex: 1 1 calc(100% - 20px);
max-width: calc(100% - 20px);
}
}

.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto; /* Allow scrolling if content overflows */
background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
position: relative;
margin: 20px auto;
display: flex;
max-width: 90vw; /* 90% of the viewport width */
max-height: 90vh; /* 90% of the viewport height */
}

#modal-img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
object-fit: contain; /* Ensures the image fits within the container without stretching */
}

.prev, .next {
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
color: white;
border: none;
padding: 10px;
cursor: pointer;
font-size: 18px;
z-index: 2;
}

.prev {
left: 0;
}

.next {
right: 0;
}

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

.close {
position: absolute;
top: 20px;
right: 35px;
color: #fff;
font-size: 40px;
font-weight: bold;
cursor: pointer;
}