#custom-relatedposts {
    clear: both;
    display: none;
    margin: 1em 0;
    padding-top: 1em;
    position: relative;
}

.custom-relatedposts-post-img {
    width: auto; /* To maintain the aspect ratio */
    height: 120px; /* Set the fixed height */
    object-fit: cover; /* Ensure the image covers the container without distortion */
}

.custom-related-posts-i2__row {
    display: flex;
    margin-top: 1.5rem;
}

.custom-related-posts-i2__row:first-child {
    margin-top: 0;
}

.custom-related-posts-i2__post {
    display: flex;
    flex-basis: 0;
    flex-direction: column;
    flex-grow: 1;
    margin: 0 10px;
    padding-left: 0;
}

.custom-related-posts-i2__row[data-post-count="3"] .custom-related-posts-i2__post {
    max-width: calc(33% - 20px);
}

.custom-related-posts-i2__row[data-post-count="1"] .custom-related-posts-i2__post,
.custom-related-posts-i2__row[data-post-count="2"] .custom-related-posts-i2__post {
    max-width: calc(50% - 20px);
}

.custom-related-posts-i2__post-context,
.custom-related-posts-i2__post-date,
.custom-related-posts-i2__post-heading,
.custom-related-posts-i2__post-img-link {
    display: block;
    flex-direction: row;
}

.custom-related-posts-i2__post-heading {
    font-size: 1rem;
    line-height: 1.2em;
    margin: .5rem 0;
}

.custom-related-posts-i2__post-link {
    display: block;
    line-height: 1.2em;
    width: 100%;
}

.custom-related-posts-i2__post-img-link {
    order: -1;
}

.custom-related-posts-i2__post-img-link img {
    width: 100%;
}

.custom-relatedposts-i2[data-layout=list] .custom-related-posts-i2__row {
    display: block;
    margin-top: 0;
}

.custom-relatedposts-i2[data-layout=list] .custom-related-posts-i2__post {
    margin: 0;
    max-width: none;
}

.custom-relatedposts-i2[data-layout=list].custom-related-posts-i2__post-img-link {
    margin-top: 1rem;
}

@media only screen and (max-width: 640px) {
    .custom-related-posts-i2__row {
        display:block;
        margin-top: 0;
    }

    .custom-related-posts-i2__row[data-post-count] .custom-related-posts-i2__post {
        margin: 1rem 0 0;
        max-width: none;
    }

    .custom-related-posts-i2__post-img-link {
        margin-top: 1rem;
    }

    .custom-related-posts-i2__post-img-link img {
        width: 350px;
    }
}

#custom-relatedposts {
    clear: both;
    display: none;
    margin: 1em 0;
    padding-top: 1em;
    position: relative;
}

.custom-relatedposts:after {
    clear: both;
    content: "";
    display: block;
}

#custom-relatedposts h3.custom-relatedposts-headline {
    display: inline-block;
    float: left;
    font-family: inherit;
    font-size: 9pt;
    font-weight: 700;
    margin: 0 0 1em;
}

#custom-relatedposts h3.custom-relatedposts-headline em:before {
    border-top: 1px solid #dcdcde;
    border-top: 1px solid rgba(0,0,0,.2);
    content: "";
    display: block;
    margin-bottom: 1em;
    min-width: 30px;
    width: 100%;
}

#custom-relatedposts h3.custom-relatedposts-headline em {
    font-style: normal;
    font-weight: 700;
}

#custom-relatedposts .custom-relatedposts-items {
    clear: left;
}

#custom-relatedposts .custom-relatedposts-items-visual {
    margin-right: -20px;
}

#custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    float: left;
    margin: 0 0 1em;
    width: 33%;
}

#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post {
    filter: alpha(opacity=80);
    -moz-opacity: .8;
    opacity: .8;
    padding-right: 20px;
}

#custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post:nth-child(3n+4),
#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post:nth-child(3n+4) {
    clear: both;
}

#custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post:hover .custom-relatedposts-post-title a {
    text-decoration: underline;
}

#custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post:hover {
    filter: alpha(opacity=100);
    -moz-opacity: 1;
    opacity: 1;
}

#custom-relatedposts .custom-relatedposts-items p,
#custom-relatedposts .custom-relatedposts-items time,
#custom-relatedposts .custom-relatedposts-items-visual h4.custom-relatedposts-post-title {
    font-size: 14px;
    line-height: 20px;
    margin: 0;
}

#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post-nothumbs {
    position: relative;
}

#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post-nothumbs a.custom-relatedposts-post-aoverlay {
    border-bottom: 0;
    bottom: 0;
    display: block;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post-nothumbs p.custom-relatedposts-post-excerpt {
    overflow: hidden;
}

#custom-relatedposts .custom-relatedposts-items-visual .custom-relatedposts-post-nothumbs span {
    margin-bottom: 1em;
}

#custom-relatedposts .custom-relatedposts-list .custom-relatedposts-post {
    clear: both;
    width: 100%;
}

#custom-relatedposts .custom-relatedposts-list .custom-relatedposts-post img.custom-relatedposts-post-img {
    float: left;
    margin-right: 3%;
    max-width: 33%;
    overflow: hidden;
}

#custom-relatedposts .custom-relatedposts-list h4.custom-relatedposts-post-title {
    display: inline-block;
    max-width: 63%;
}

@media only screen and (max-width: 640px) {
    #custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post {
        width: 50%;
    }

    #custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post:nth-child(3n) {
        clear: left;
    }

    #custom-relatedposts .custom-relatedposts-items-visual {
        margin-right: 20px;
    }
}

@media only screen and (max-width: 320px) {
    #custom-relatedposts .custom-relatedposts-items .custom-relatedposts-post {
        clear: both;
        margin: 0 0 1em;
        width: 100%;
    }

    #custom-relatedposts .custom-relatedposts-list .custom-relatedposts-post img.custom-relatedposts-post-img,
    #custom-relatedposts .custom-relatedposts-list h4.custom-relatedposts-post-title {
        float: none;
        margin-right: 0;
        max-width: 100%;
    }
}

@media print {
    .custom-relatedposts {
        display: none !important;
    }
}
