body {
    font-family: 'Poppins', sans-serif;
    background: #f4f4f4;
    margin: 0;
    padding: 0;
    text-align: center;
}

.back-button {
    position: fixed;
    top: 15px;
    left: 15px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    color: black;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    transition: 0.3s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
}

header {
    background: #333;
    color: #fff;
    padding: 20px;
}

.gallery {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px;
}

.story {
    margin: 15px;
    cursor: pointer;
    position: relative;
}

.story img {
    width: 250px;
    height: 170px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease-in-out;
}

.story img:hover {
    transform: scale(1.05);
}

.story h2 {
    font-size: 16px;
    margin-top: 10px;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    width: 60%;
    border-radius: 10px;
    text-align: left;
    position: relative;
    max-height: 80vh; /* Limits the modal height to 80% of the viewport */
    overflow-y: auto;  /* Enables vertical scrolling */
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
}

#image-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 90vw; /* Ensures it doesn’t exceed screen width */
    max-height: 80vh; /* Prevents overflowing on small screens */
    overflow: hidden;
}

#image-slider img {
    width: auto;
    max-width: 100%;
    max-height: 75vh; /* Prevents image from overflowing the modal */
    object-fit: contain; /* Ensures full image is visible without cropping */
    border-radius: 5px;
}

.prev, .next {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    border: none;
    padding: 10px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
