.sidebar-wrapper {
    position: sticky;
    top: max(0px, calc((80vh - 733px) / 2));
    display: flex;
    justify-content: center;
}

picture.sidebar-image {
    margin-top: 3rem;
    width: auto;
    max-width: 420px;
}

picture.sidebar-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;                          /* natural height */
    max-height: calc(100vh - 3rem);        /* shrink if viewport is short */
    object-fit: contain;                   /* no cropping */
}

/* Desktop */
@media (min-width: 1024px) and (max-width: 1215px) {
    picture.sidebar-image img {
        max-width: 378px;
    }
}


/* Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
    picture.sidebar-image img {
        max-width: 315px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    picture.sidebar-image img {
        height: auto;
        max-width: 100%;
    }
}
