.custom-content-with-media{
    margin: var(--block-margin) 0;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

.custom-content-with-media[data-media-position="left"] .custom-content-with-media-media .custom-content-with-media-media-wrapper.animate__animated,
.custom-content-with-media[data-media-position="right"] .custom-content-with-media-content-wrapper[data-button-position="with"] .custom-content-with-media-content-buttons.animate__animated,
.custom-content-with-media[data-media-position="left"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons.animate__animated,
.custom-content-with-media[data-title-position="above"] .custom-content-with-media-content-title.animate__animated,
.custom-content-with-media[data-title-position="with"][data-media-position="right"] .custom-content-with-media-content-title.animate__animated,
.custom-content-with-media[data-media-position="right"] .custom-content-with-media-content-text.animate__animated{
    animation-name: fadeInLeft;
}

.custom-content-with-media[data-media-position="right"] .custom-content-with-media-media .custom-content-with-media-media-wrapper.animate__animated,
.custom-content-with-media[data-media-position="left"] .custom-content-with-media-content-wrapper[data-button-position="with"] .custom-content-with-media-content-buttons.animate__animated,
.custom-content-with-media[data-media-position="right"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons.animate__animated,
.custom-content-with-media[data-title-position="with"][data-media-position="left"] .custom-content-with-media-content-title.animate__animated,
.custom-content-with-media[data-media-position="left"] .custom-content-with-media-content-text.animate__animated{
    animation-name: fadeInRight;
}

.custom-content-with-media-inner{
    display: grid;
    grid-auto-flow: dense;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--row-gap);
    column-gap: var(--column-gap);
    max-width: var(--wide-width);
    margin: 0 auto;
}

.custom-content-with-media-inner:has([data-media-shape="square-rotated"], [data-media-shape="pill-rotated"]){
    padding: calc((var(--wide-width)) * 0.035) 0 0;
}

.custom-content-with-media-media{
    width: 100%;
}

.custom-content-with-media-media[data-media-shape="square"]{
    aspect-ratio: 1;
    border-radius: 4rem;
    width: calc(100% + 8rem);
    overflow: hidden;
}

.custom-content-with-media-media[data-media-shape="square"] .custom-content-with-media-media-wrapper{
    border-radius: 4rem;
    overflow: hidden;
}

.custom-content-with-media[data-media-position="left"] .custom-content-with-media-media[data-media-shape="square"]{
    transform: translateX(-8rem);
}

.custom-content-with-media-media[data-media-shape="square-rotated"]{
    aspect-ratio: 1;
    width: calc(100% + 8rem);
}

.custom-content-with-media-media[data-media-shape="square-rotated"] img{
    border-radius: 4rem;
}

.custom-content-with-media[data-media-position="left"] .custom-content-with-media-media[data-media-shape="square-rotated"]{
    transform: translateX(-8rem) rotate(-3.5deg);
}

.custom-content-with-media[data-media-position="right"] .custom-content-with-media-media[data-media-shape="square-rotated"]{
    transform: rotate(3.5deg);
}

.custom-content-with-media-media[data-media-shape="pill"]{
    aspect-ratio: 0.7;
}

.custom-content-with-media-media[data-media-shape="pill"] img{
    border-radius: 40rem;
}

.custom-content-with-media-media[data-media-shape="pill-rotated"]{
    aspect-ratio: 0.7;
}

.custom-content-with-media-media[data-media-shape="pill-rotated"] img{
    border-radius: 40rem;
}

.custom-content-with-media[data-media-position="left"] .custom-content-with-media-media[data-media-shape="pill-rotated"]{
    transform: rotate(-3.5deg);
}

.custom-content-with-media[data-media-position="right"] .custom-content-with-media-media[data-media-shape="pill-rotated"]{
    transform: rotate(3.5deg);
}

.custom-content-with-media-media[data-media-shape="circle"]{
    aspect-ratio: 1;
}

.custom-content-with-media-media[data-media-shape="circle"] img{
    border-radius: 50%;
}

.custom-content-with-media-media-wrapper{
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

button.custom-content-with-media-media-wrapper:is(:hover, :focus, :active){
    outline: none;
}

button.custom-content-with-media-media-wrapper *{
    pointer-events: none;
}

.custom-content-with-media-media-wrapper :is(img, video){
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-content-with-media-media-wrapper iframe{
    border: none;
    position: absolute;
    min-width: 100%;
    width: auto;
    min-height: 100%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.custom-content-with-media-media:is([data-media-shape="landscape"], [data-media-shape="square"]) .custom-content-with-media-media-wrapper iframe{
    aspect-ratio: 16 / 9;
}

.custom-content-with-media-media[data-media-shape="portrait"] .custom-content-with-media-media-wrapper iframe{
    aspect-ratio: 9 / 16;
}

.custom-content-with-media-media-wrapper svg{
    width: 7.6rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.custom-content-with-media-media-wrapper svg *{
    transition: all 0.3s ease;
}

.custom-content-with-media-media-wrapper svg circle{
    fill: var(--primary-button-background-color);
}

.custom-content-with-media-media-wrapper svg path{
    fill: var(--primary-button-text-color);
}

button.custom-content-with-media-media-wrapper:is(:hover, :focus, :active) svg circle{
    fill: var(--primary-button-hover-background-color);
}

button.custom-content-with-media-media-wrapper:is(:hover, :focus, :active) svg path{
    fill: var(--primary-button-hover-text-color);
}

.custom-content-with-media-content-title .eyebrow{
    margin-bottom: calc(0.5em * var(--eyebrow-line-height));
    line-height: 1;
    letter-spacing: 0.2em;
}

.custom-content-with-media-content-title h2{
    font: var(--font-headline-1);
    text-transform: uppercase;
    margin-bottom: 2.4rem;
}

.custom-content-with-media-content-title h2[data-title-size="big"]{
    font: var(--font-headline-0);
}

.custom-content-with-media-content-title h2[data-title-size="bigger"]{
    font: var(--font-headline-00);
}

.custom-content-with-media-content-wrapper[data-content-alignment="top"],
.custom-content-with-media-content-wrapper[data-content-alignment="top"][data-button-position="beside"] .custom-content-with-media-content-inner{
    align-self: start;
}

.custom-content-with-media-content-wrapper[data-content-alignment="middle"],
.custom-content-with-media-content-wrapper[data-content-alignment="middle"][data-button-position="beside"] .custom-content-with-media-content-inner{
    align-self: center;
}

.custom-content-with-media-content-wrapper[data-content-alignment="bottom"],
.custom-content-with-media-content-wrapper[data-content-alignment="bottom"][data-button-position="beside"] .custom-content-with-media-content-inner{
    align-self: end;
}

.custom-content-with-media-content-wrapper[data-content-width="narrow"] .custom-content-with-media-content-text,
.custom-content-with-media-content-wrapper[data-content-width="narrow"][data-button-position="with"] .custom-content-with-media-content-buttons{
    max-width: 85%;
    margin-left: auto;
}

.custom-content-with-media-content-text > *:last-child{
    margin-bottom: 0;
}

.custom-content-with-media-content-buttons{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: calc(0.5em * var(--primary-line-height));
    column-gap: var(--item-column-gap);
    margin-top: var(--item-row-gap);
}

.custom-content-with-media-modal{
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--admin-bar-height));
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
    transition: all 0.5s ease-in;
    overflow: hidden;
}

.custom-content-with-media-modal.open{
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.custom-content-with-media-modal-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.custom-content-with-media-modal-controls{
    width: var(--full-width);
    text-align: right;
    padding-bottom: var(--item-row-gap);
    color: var(--link-color);
}

.custom-content-with-media-modal-close:is(:hover, :focus, :active){
    color: var(--hover-link-color);
}

.custom-content-with-media-modal-close svg{
    width: 4.8rem;
    height: auto;
}

.custom-content-with-media-modal-player-container{
    width: var(--wide-width);
    margin: 0 auto;
    margin-bottom: calc(4.8rem + var(--item-row-gap));
    position: relative;
}

.custom-content-with-media-modal-player-container :is(video, iframe){
    display: block;
    width: 100%;
    border: none;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - var(--admin-bar-height) - (var(--item-row-gap) * 2) - 5rem);
}

@media (min-width: 768px){
    .custom-content-with-media-inner{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-content-with-media-inner[data-section-width="narrow"]{
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 2fr));
    }

    .custom-content-with-media-inner:has([data-media-shape="square-rotated"], [data-media-shape="pill-rotated"]){
        padding: calc(((var(--wide-width) / 2)) * 0.035) 0;
    }


    .alignwide :is(.custom-content-with-media-media, .custom-content-with-media-content){
        --wide-width: 200%;
    }

    .custom-content-with-media:has(+ .custom-content-with-media){
        margin-bottom: 0;
    }

    .custom-content-with-media-media{
        min-height: 100%;
    }

    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-media{
        grid-column: 2;
    }

    .custom-content-with-media[data-media-position="left"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-media,
    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper,
    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-inner{
        grid-column: 2;
    }

    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-media,
    .custom-content-with-media[data-media-position="left"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper,
    .custom-content-with-media[data-media-position="left"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-inner{
        grid-column: 3;
    }

    .custom-content-with-media-content-wrapper[data-button-position="beside"]{
        display: contents;
    }

    .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-inner{
        grid-row: span 2;
    }

    .custom-content-with-media[data-title-position="above"] .custom-content-with-media-content-title{
        grid-row: -1;
        grid-column: 1 / span 2;
    }

    .custom-content-with-media[data-title-position="above"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-title{
        grid-column: 1 / span 3;
    }

    .custom-content-with-media[data-title-position="above"] .custom-content-with-media-content-title h2{
        margin-bottom: 0;
    }
    
    .custom-content-with-media-content-wrapper[data-content-width="narrow"] .custom-content-with-media-content-text,
    .custom-content-with-media-content-wrapper[data-content-width="narrow"][data-button-position="with"] .custom-content-with-media-content-buttons{
        max-width: 70%;
    }

    [data-button-position="beside"] .custom-content-with-media-content-buttons{
        margin-top: 0;
    }

    .custom-content-with-media[data-media-position="left"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons{
        grid-column: 1;
    }

    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons,
    .custom-content-with-media[data-media-position="left"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons{
        grid-column: 2;
    }
    
    .custom-content-with-media[data-media-position="right"] .custom-content-with-media-inner[data-section-width="narrow"] .custom-content-with-media-content-wrapper[data-button-position="beside"] .custom-content-with-media-content-buttons{
        grid-column: 3;
    }

    .custom-content-with-media-content{
        max-width: calc(var(--wide-width) / 2);
        margin: 0;
        padding: calc(var(--row-gap) / 2) 0;
        align-self: end;
    }
}