/* Photo Gallery*/
.gallery {
    position: relative;
    
}
.photo {
    position: sticky;
    top: 0;
    width:auto;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
    will-change: transform;
    
}
.photo img {
    width: auto;
    max-height: auto;
    max-width: 80vw;
    max-height: 90vh;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: none;
    transition: box-shadow 0.5s ease;
    border: 4px solid #000; /* Adjust color (e.g., slate-800) */
    padding: 4px; /* Creates inner spacing between image and border */
    background: #000; /* Matches border color for cropped areas */
    box-sizing: border-box; /* Ensures border doesn't expand container */
    
}
.photo.is-pinned img { /* for some reason this is reversed, idk why but it works, its shadow only
    appears when its not pinned */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
}
.photo-description {
    opacity: 1; 
    flex: 1;
    color: var(--color-primary-text);
    padding: 20px;
    background-color: var(--color-primary-background);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    margin-left: 20px;
    box-shadow: none;
    max-width: 15%;
    height: 25%;
}
.photo img[data-aspect="vertical"] {
    width: auto;
    height: auto;
    max-width: 80vw;
    max-height: 90vh;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: none;
    transition: box-shadow 0.5s ease;
    padding-left: max(
        4px, /* minimum padding (matches your border) */
        calc(
            (min(80vw, calc(90vh * 3 / 2)) - calc(90vh * 2 / 3)) / 2
        )
    );
    padding-right: max(
        4px, /* minimum padding */
        calc(
            (min(80vw, calc(90vh * 3 / 2)) - calc(90vh * 2 / 3)) / 2
        )
    );
    
}
.photo-description.photo.is-pinned {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
}

@media only screen and (max-width: 768px) and (orientation: portrait) {
    .photo {
        flex-direction: column; /* Stack vertically */
        height: auto; /* Remove fixed height */
        min-height: 50vh; /* 50% height so that multiple photos are on screen at once, redicing super long scroll distances */
        padding: 20px 0; /* Add some spacing */
        justify-content: flex-start; /* Align to top */
    }
    
    .photo img {
        max-width: 95vw; /* Slightly larger on mobile */
        max-height: 60vh; /* Give space for description below */
        margin-bottom: 20px; /* Space between image and description */
        box-shadow: none;
    }
    .photo.is-pinned img { /* for some reason this is reversed, idk why but it works, its shadow only
        appears when its not pinned */
        box-shadow: none; 
        /* Shadows not working on mobile for now */
    }
    
    .photo-description {
        max-width: 80vw; 
        width: 80vw; 
        margin-left: 0; 
        margin-top: 0;
        height: auto; 
        min-height: 10vh;
        max-height: 20vh; 
    }
    
    /* Optional: Reduce font sizes for mobile */
    .photo-description h3 {
        font-size: 1.2rem;
    }
    .photo-description p {
        font-size: 0.9rem;
    }
}