 @media screen and (min-width: 992px) {
.portfolio-section {
    padding: 8rem 2rem 4rem; 
    text-align: center;
}
  }
@media screen and (max-width: 992px) {
.portfolio-section {
    padding: 8rem 0rem 4rem; 
    text-align: center;
}
  }


  @media screen and (min-width: 992px) {
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 80%;
    margin: 3rem auto;
    justify-content: center;
    align-items: flex-start;
}
  }
@media screen and (max-width: 992px) {
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 100%;
    margin: 3rem auto;
    justify-content: center;
    align-items: flex-start;
}
  }

  @media screen and (min-width: 992px) {
.gallery-item {
    background: #3b3d3fb1;
    border-radius: 15px;
    box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    overflow: hidden;
    cursor: url('images/pointer.png'), auto;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column; /* Ensure vertical stacking of content */
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}
  }
@media screen and (max-width: 992px) {
.gallery-item {
    background: #3b3d3fb1;
    border-radius: 15px;
    box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    overflow: hidden;
    cursor: url('images/pointer.png'), auto;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column; 
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
}
  }

.gallery-item:hover {
    transform: translateY(-10px);
}

.gallery-item img {
    max-width: 100%;
    height: auto;
	max-height: 50rem;
    border-radius: 8px;
    display: block;
    margin-bottom: 1rem;
}

.gallery-item .pixel img {
    max-width: 100%;
    height: auto;
	max-height: 50rem;
    border-radius: 8px;
    display: block;
    margin-bottom: 1rem;
}

.gallery-item-description {
    font-family: neulis-sans, sans-serif;
    font-size: 1rem;
    color: #ccc;
    text-align: center;
    flex-grow: 1; /* Allows description to take available space */
}

/* Modal for enlarged image */
.modal {
    display: none; /* Hidden by default - THIS IS CRUCIAL */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    display: flex; /* Use flex for centering */
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
    padding-top: 60px; /* Padding for close button, if needed */
}

.modal-content {
    margin: auto; /* Center the image within the flex container */
    display: block;
    max-width: 90%;
    max-height: 80%; /* Adjusted to leave space for caption */
    object-fit: contain; /* Ensure the image fits within the modal */
    border-radius: 10px; /* Small rounded corners for the enlarged image */
    /* Add transition for animation */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Keyframe animations for image transitions */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Classes to apply animations */
.modal-content.slide-in-right {
    animation: slideInFromRight 0.3s forwards;
}
.modal-content.slide-out-left {
    animation: slideOutToLeft 0.3s forwards;
}
.modal-content.slide-in-left {
    animation: slideInFromLeft 0.3s forwards;
}
.modal-content.slide-out-right {
    animation: slideOutToRight 0.3s forwards;
}


.modal-caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-family: neulis-sans, sans-serif;
    font-size: 1.2rem;
}

/* Close button */
.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

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

/* Navigation Arrows */
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: #f1f1f1;
    cursor: pointer;
    padding: 0 15px;
    user-select: none; /* Prevent text selection */
    transition: 0.3s;
    z-index: 1002; /* Ensure arrows are above modal content */
}




 @media screen and (min-width: 992px) {
.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}

  }
@media screen and (max-width: 992px) {
.prev-arrow {
    left: 30%;
	top: 85%;
}

.next-arrow {
    right: 30%;
	top: 85%;
}

}
  }

.arrow:hover {
    color: #bbb;
}


/* Mobile adjustments for gallery */
@media screen and (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        padding: 1rem;
    }
    .portfolio-section {
        padding-top: 6rem;
    }
    .gallery-item {
        width: 90%; /* Adjust width for mobile cards */
        margin: 1rem auto;
    }
    .arrow {
        font-size: 2rem; /* Smaller arrows on mobile */
        padding: 0 10px;
    }
}
