/* Inherit base styles from the main project */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #000; /* Subtle off-white from PROJECT.html */
    color: #fff;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

/* Styles for Nav menu indicator from PROJECT.html */
.nav-item {
    position: relative;
    transition: color 0.3s;
}
.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #B8860B;
    transition: width 0.3s ease-in-out;
}
.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* Main Content and Title */
main {
    padding: 0;
    max-width: 100%;
    margin: 0;
}

.page-title {
    display: none;
}

/* Image Gallery Grid */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0; /* Remove gap */
}

@media (min-width: 640px) {
    #gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #gallery-grid {
        grid-template-columns: repeat(4, 1fr); /* Set to 4 columns */
    }
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    /* Remove border-radius and box-shadow */
    aspect-ratio: 4 / 3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

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

/* --- Image Viewer Modal --- */
#image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(253, 251, 248, 0.9); /* Use body background with alpha */
    backdrop-filter: blur(5px);
    display: flex; /* Changed to flex for wrapper */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
    overflow: hidden; /* Hide overflowing zoomed image */
}

#image-modal.active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease;
}

/* New Image Wrapper */
#modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-image {
    /* UPDATED: Increased max-width to make the image larger */
    max-width: 95%;
    /* UPDATED: Increased max-height to make the image larger */
    max-height: 95%;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.95) translate(0, 0); /* Added translate for consistency */
    transform-origin: center center;
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    touch-action: none; /* Prevents default browser actions on the image */
}

#image-modal.active #modal-image {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

.modal-control {
    position: absolute;
    background: none;
    border: none;
    /* UPDATED: Color changed to white */
    color: #fff;
    /* UPDATED: Font size reduced */
    font-size: 1.75rem;
    cursor: pointer;
    padding: 1rem;
    user-select: none;
    /* UPDATED: Transition updated to prevent position shift */
    transition: color 0.2s ease;
    z-index: 10; /* Ensure controls are above the image wrapper */
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); /* Added for visibility */
}

.modal-control:hover {
    /* UPDATED: Removed transform that caused shifting */
    opacity: 0.8;
}

#close-modal {
    top: 1rem;
    right: 1rem;
}

.prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}



