.photos-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    margin-top: 32px;
    gap: 32px;
}

.photo-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    
    view-timeline-name: --image-scroll;
    view-timeline-axis: block;
  
    animation: linear fade-in-and-out;
    animation-timeline: --image-scroll;
    animation-range: entry 0% exit 100%;
    animation-fill-mode: both;
    transition: scale 0.1s ease, opacity 0.1s ease;

    &:first-child {
        animation: linear fade-out;
        animation-timeline: --image-scroll;
        animation-range: entry 0% exit 100%;
        animation-fill-mode: both;
    }
    
    &:last-child {
        animation: linear fade-in;
        animation-timeline: --image-scroll;
        animation-range: entry 0% exit 100%;
        animation-fill-mode: both;
    }
}

.photo-image {
    width: 100%;
    background-color: #e8e4df;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    transition: box-shadow 0.3s ease;
    object-fit: cover;
    border-radius: 12px;
}

.photo-caption {
    text-align: center;
    color: #555;
    font-size: 1.5rem;
    line-height: 1.5;
    max-width: 90%;
}

@keyframes fade-in-and-out {
    0% {
        opacity: 0.2;
        transform: scale(0.3);
        transform-origin: top;
    }
    40% {
        opacity: 1;
        transform: scale(1);
        transform-origin: top;
    }
    60% {
        opacity: 1;
        transform: scale(1);
        transform-origin: bottom;
    }
    100% {
        opacity: 0.2;
        transform: scale(0.3);
        transform-origin: bottom;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0.2;
        transform: scale(0.3);
        transform-origin: top;
    }
    40% {
        opacity: 1;
        transform: scale(1);
        transform-origin: top;
    }
}

@keyframes fade-out {
    60% {
        opacity: 1;
        transform: scale(1);
        transform-origin: bottom;
    }
    100% {
        opacity: 0.2;
        transform: scale(0.3);
        transform-origin: bottom;
    }
}