/* Photo Gallery*/
.gallery {
    position: relative;
    
}
.photo {
    position: relative;
    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: 0 10px 30px rgba(0, 0, 0, 0.5); 
    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-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: 0 10px 30px rgba(0, 0, 0, 0.5); 
    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, calc( (min(80vw, calc(90vh * 3 / 2)) - calc(90vh * 2 / 3)) / 2)
    );
    padding-right: max(
        4px, calc((min(80vw, calc(90vh * 3 / 2)) - calc(90vh * 2 / 3)) / 2)
    );
    
}




.lightbox {
  position: fixed;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.lightbox:has(div:target) {
    transform: translateY(0%);
    opacity: 1;
  }


@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 */
        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: 0 10px 30px rgba(0, 0, 0, 0.5); 
    }    
    .photo-description {
        max-width: 80vw; 
        width: 80vw; 
        margin-left: 0; 
        margin-top: 0;
        height: auto; 
        min-height: 10vh;
        max-height: 20vh; 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 

    }
    
    /* Optional: Reduce font sizes for mobile */
    .photo-description h3 {
        font-size: 1.2rem;
    }
    .photo-description p {
        font-size: 0.9rem;
    }
}