/* Gallery Styles */
#gallery-container {
    position: relative;
    /* Grid handles the height (1fr), so we just fill it */
    min-height: 0;
    /* Important for grid items to prevent overflow */
    overflow: hidden;
    background-color: #f0f0f0;
    margin: 8px;
    border-radius: 15px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    bottom: 20%;
    left: 10%;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    /* Semi-transparent background for readability */
    padding: 20px;
    border-radius: 8px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease-out;
    transition-delay: 0.5s;
    max-width: 40%;
}

.slide.active .overlay {
    transform: translateY(0);
    opacity: 1;
}

.overlay h1 {
    margin: 0 0 10px 0;
    font-size: 3em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Modern font */
}

.overlay p {
    font-size: 1.2em;
    margin: 0;
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 2em;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Gallery */
    .overlay {
        max-width: 90%;
        left: 5%;
        bottom: 10%;
        padding: 15px;
    }

    .overlay h1 {
        font-size: 1.5em;
    }

    .overlay p {
        font-size: 1em;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
        padding: 10px;
    }

}