.expandable-images-container {
    display: flex;
    height: 450px;
    gap: 30px;
    overflow: hidden;
    width: 1170px;
}

.expandable-image-item {
    position: relative;
    flex-basis: 270px;
    flex-grow: 0;
    flex-shrink: 1;
    min-width: 100px;
    overflow: hidden;
    cursor: pointer;
    transition: flex-basis 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        flex-grow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.expandable-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.image-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    box-sizing: border-box;
    z-index: 2;
    pointer-events: none;
}

.image-meta {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transform: rotate(-90deg);
    transform-origin: bottom right;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}


.meta-separator {
    font-size: 0.7rem;
    display: contents;
}

.image-date,
.image-category,
.meta-separator {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-container {
    display: flex;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
}

.rotated-meta-wrapper {
    position: absolute;
    bottom: 30px;
    right: 60px;
    display: flex;
    align-items: flex-start;
}

.rotated-meta {
    position: absolute;
    display: flex;
    gap: 4px;
    transform: rotate(-90deg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform-origin: top left;
    max-width: 300px;
    color: #fff;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.2, 1);
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
    font-size: 1em;
}

.rotated-meta-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    color: #fff;
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
    font-size: 1em;
}

.image-title {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    margin: 0;
    font-family: EB Garamond;
    font-weight: 600;
    font-style: SemiBold;
    font-size: 1.75em;
    line-height: 32px;
    letter-spacing: 0%;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);

    width: calc(100% - 60px);
    max-width: 100%;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;

    padding-top: 40px;

}

.expandable-image-item.expanded {
    flex-basis: 570px;
    flex-grow: 1;
}

.expandable-image-item.expanded .image-meta {
    transform: rotate(0deg);
    position: static;
    margin-bottom: 10px;
}

.expandable-image-item.expanded .rotated-meta-wrapper {
    position: static;
    bottom: 100px;
    left: 30px;
    transform: rotate(0deg);
    max-width: none;
}

.expandable-image-item.expanded .rotated-meta {
    transform: rotate(0deg);
}


.expandable-image-item.expanded .image-title {
    opacity: 1;
    transform: translateY(0);
    position: static;
}

.expandable-images-container.has-expanded .expandable-image-item:not(.expanded) {
    flex-grow: 0;
    flex-shrink: 2;
}

.expandable-image-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: none;
    z-index: 1;
    border-radius: 16px;
}

.image-content {
    z-index: 2;
}

.expandable-image-item.expanded .image-content {
    display: flex;
    flex-direction: column;
}


@media (max-width: 1260px) and (min-width: 768px) {
    .expandable-images-container {
        max-width: 1130px;
        width: 100%;
    }
}


@media (max-width: 768px) {
    .expandable-images-container {
        flex-direction: column;
        height: auto;
        max-width: 700px;
        width: 100%;
    }

    .expandable-image-item {
        flex: 0 0 200px;
        min-width: auto;
        height: 200px;
    }

    .expandable-image-item.expanded .image-content {
        display: flex;
        flex-direction: column;
    }

    .expandable-image-item.expanded {
        flex: 0 0 400px;
        height: 400px;
    }

    .image-title {
        position: static;
        opacity: 0;
        max-width: 100%;
        transition:
        opacity 0.08s ease-out,
        transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 10px;
    }

    .expandable-image-item.expanded .image-title {
        opacity: 1;
        transform: translateY(0);
        position: static;
    }

    .rotated-meta-text {
        white-space: break-spaces;
    }

    .rotated-meta-wrapper {
        position: absolute;
        transform: none;
        width: 100%;
        position: absolute;
        bottom: 20px;
        right: 20px;
        left: 20px;

        white-space: normal;    
        overflow-wrap: anywhere;    
        word-break: break-word;
        
        padding-right: 40px;
    }


    .expandable-image-item.expanded .rotated-meta-wrapper {
        position: static;
        transform: rotate(0deg);
        max-width: none;
    }


    .rotated-meta {
        position: static;
        transform: none;
        max-width: 100%;

        white-space: normal;       
        overflow: visible;          
        text-overflow: unset; 
    }

    .rotated-meta-text {
        white-space: normal;
    }

}