.mds-post-preview {
    display: block;
    height: 100%;
    transition: opacity 0.5s;
    margin-bottom: 1rem !important;
    padding-bottom: 20px !important;
}

.mds-post-preview .content {
    display: flex;
}

.mds-post-preview .content .checkbox-col {
    display: flex;
    align-items: center;
    max-width: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: max-width 0.3s;
}

.mds-post-preview .content .checkbox-col.open {
    max-width: 100px;
}

.post-preview:not(.post-preview--leftimg, .post-preview--leftverticalimg, .post-preview--backgroundimg, .has-checkbox) {
    position: relative;
    box-sizing: border-box;
    height: 100%;
}

.post-preview:not(.post-preview--leftimg, .post-preview--leftverticalimg, .post-preview--backgroundimg, .has-checkbox) .footer {
    position: relative;
    bottom: 0px;
    left: 0px;
    right: 0px;
}

.post-preview--toptimg {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {

    .post-preview--leftimg,
    .post-preview--leftverticalimg {
        display: grid;
        align-items: flex-start;
        -moz-column-gap: 2rem;
        column-gap: 2rem;
    }

    .post-preview--leftimg {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }

    .post-preview--leftverticalimg {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

}

.post-preview--backgroundimg {
    position: relative;
    border-radius: 0.75rem;
}

.post-preview .image {
    overflow: hidden;
    border-radius: 0.75rem;
    --tw-bg-opacity: 1;
    background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}

.post-preview .post-preview-img-wrapper {
    height: 0;
    padding-top: 66.6%;
    position: relative;
}

.post-preview .post-preview-img-wrapper img {
    position: absolute;
    top: 0;
    max-height: 100%;
    height: 100vh;
    object-fit: cover;
    width: 100%;
}

.maggiolidxp-agency-post .post-preview .image {
    background-color: #fff;
    border: 2px solid rgba(var(--brand-dxp-elevation-03), var(--tw-border-opacity));
}

.maggiolidxp-agency-post .post-preview .post-preview-img-wrapper img {
    object-fit: contain;
}

.post-preview .post-preview-img-wrapper[aspect-ratio="3/2"] {
    padding-top: 50%;
}

.post-preview .post-preview-img-wrapper[aspect-ratio="2/3"] {
    padding-top: 150%;
}

.post-preview .post-preview-img-wrapper[aspect-ratio="1/1"] {
    padding-top: 100%;
}

.post-preview .post-preview-img-wrapper[aspect-ratio="2/1"] {
    padding-top: 50%;
}

@media (min-width: 1216px) {
    .post-preview .post-preview-img-wrapper[aspect-ratio="3/2"] {
        padding-top: 66.67%;
    }

    .post-preview .post-preview-img-wrapper[aspect-ratio="1/1"] {
        padding-top: 100%;
    }

    .post-preview .post-preview-img-wrapper[aspect-ratio="2/1"] {
        padding-top: 50%;
    }
}

@media (max-width: 767px) {
    .post-preview.post-preview--leftimg .post-preview-img-wrapper[aspect-ratio="1/1"] {
        padding-top: 50%;
    }
}

.post-preview--backgroundimg [data-block-type="post-preview"] {
    position: relative;
    border-radius: 0.75rem;
}

.post-preview--backgroundimg [data-block-type="image"] {
    --tw-text-opacity: 1;
    color: rgb(0 0 0 / var(--tw-text-opacity));
    margin-bottom: 1rem;
}

.post-preview--backgroundimg [data-block-type="content"] .title a {
    --tw-text-opacity: 1;
    color: rgb(0 0 0 / var(--tw-text-opacity));
    -webkit-text-decoration-line: none;
    text-decoration-line: none;
}

@media (min-width: 1216px) {
    .post-preview--backgroundimg [data-block-type="content"] {
        position: absolute;
        left: 0px;
        right: 0px;
        bottom: 0px;
        border-bottom-right-radius: 0.75rem;
        border-bottom-left-radius: 0.75rem;
        padding: 1.5rem;
        --tw-text-opacity: 1;
        color: rgb(255 255 255 / var(--tw-text-opacity));
        background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75));
    }

    .post-preview--backgroundimg [data-block-type="content"] .title a {
        --tw-text-opacity: 1;
        color: rgb(255 255 255 / var(--tw-text-opacity));
        -webkit-text-decoration-line: none;
        text-decoration-line: none;
    }

    .post-preview--backgroundimg [data-block-type="image"] {
        color: rgb(255 255 255 / var(--tw-text-opacity));
        margin-bottom: 0rem;
    }
}

/*
Array.from(blocks).forEach(block => {
    let img = null;
    if (block.dataset?.blockType === 'image') {
        img = block.querySelector('mds-img');
    }
    if (matches && block.dataset?.imagePosition === 'background') {
        //under 1215
        block.classList.remove(`${block.dataset?.blockType}--${block.dataset?.imagePosition}img`);
        block.classList.add(`${block.dataset?.blockType}--topimg`);
        block.dataset.wasImagePosition = 'background';
    } else if (block.dataset?.wasImagePosition === 'background') {
        block.classList.remove(`${block.dataset?.blockType}--topimg`);
        block.classList.add(`${block.dataset?.blockType}--${block.dataset?.imagePosition}img`);
        block.dataset.wasImagePosition = null;
    }
*/

.post-preview .image--topimg {
    margin-bottom: 1rem;
}

.post-preview .image--leftimg,
.post-preview .image--leftverticalimg {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {

    .post-preview .image--leftimg,
    .post-preview .image--leftverticalimg {
        grid-column: span 2 / span 2;
        margin-bottom: 0px;
    }
}

.post-preview .image mds-img {
    display: flex;
}

.post-preview .content--leftimg {
    grid-column: span 9 / span 9;
}

.post-preview .content--leftverticalimg {
    grid-column: span 12 / span 12;
}

@media (min-width: 768px) {
    .post-preview .content--leftimg {
        grid-column: span 7 / span 7;
    }

    .post-preview .content--leftverticalimg {
        grid-column: span 10 / span 10;
    }
}

/* .post-preview .content--backgroundimg {
    position: absolute;
    left: 0px;
    right: 0px;
    bottom: 0px;
    border-bottom-right-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    padding: 1.5rem;
    --tw-text-opacity: 1;
    color: rgb(255 255 255 / var(--tw-text-opacity));
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75));
} */

.post-preview .header>.badge .maggiolidxp-badge-link .badge {
    min-height: 24px;
    min-width: 2rem;
}

.post-preview .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1;
}

.post-preview .title a {
    --tw-text-opacity: 1;
    color: rgb(0 0 0 / var(--tw-text-opacity));
    -webkit-text-decoration-line: none;
    text-decoration-line: none;
    word-break: break-word;
}

.post-preview .title a:hover {
    -webkit-text-decoration-line: underline;
    text-decoration-line: underline;
}

:not(.post-preview--backgroundimg).post-preview .content--backgroundimg .title,
:not(.post-preview--backgroundimg).post-preview .content--backgroundimg .title a {
    --tw-text-opacity: 1;
    color: rgb(255 255 255 / var(--tw-text-opacity));
}

.post-preview .logo {
    margin-bottom: 0.5rem;
}

.post-preview .title,
.post-preview .subtitle,
.post-preview .footer {
    margin-top: 0.5rem;
}

.post-preview .tools {
    text-align: right;
}

.post-preview .author {
    display: inline-block;
    font-weight: 700;
    margin-right: 0.5rem;
}

.post-preview .author-link {
    --tw-text-opacity: 1;
    color: rgb(0 0 0 / var(--tw-text-opacity));
    -webkit-text-decoration-line: none;
    text-decoration-line: none;
}

.post-preview .author-link:hover {
    -webkit-text-decoration-line: underline;
    text-decoration-line: underline;
}

.post-preview .author .date {
    display: inline-block;
    border-width: 0px;
}
