﻿/* ----------------------------------------
    Block
   ---------------------------------------- */
.text-and-media {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--block-max-width);
}

.text-and-media--margin-top {
    margin-top: var(--block-margin);
}

.text-and-media--margin-bottom {
    margin-bottom: var(--block-margin);
}

/*
    Block modifiers
*/
.text-and-media--background-color {
    background-color: var(--background-secondary);
}

.text-and-media--border {
    border: 1px solid black;
}

.text-and-media--rounded-corners {
    border-radius: var(--border-radius);
}

.text-and-media--media-behind {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.text-and-media--media-below {
    flex-direction: column;
}

.text-and-media--media-above {
    flex-direction: column-reverse;
}

.text-and-media--media-left {
    flex-direction: row-reverse;
}

.text-and-media--media-right {
    flex-direction: row;
}

/* ----------------------------------------
    Text Container Element
   ---------------------------------------- */

.text-and-media__text-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 5rem;
    width: 100%;
}

/*
    Text Container Modifiers
*/
.text-and-media__text-container--horizontal {
    width: 50%;
}

.text-and-media__text-container--media-behind {
    color: white;
    padding: 2rem;
    text-align: left;
    align-items: start;
    width: 50%;
}

.text-and-media__text-container--background-color {
    background-color: white;
    margin: 3rem;
    color: black;
}

@media screen and (max-width: 768px) {
    .text-and-media__text-container--media-behind {
        width: 100%;
        margin: 0;
    }
}

.text-and-media__text-container--rounded-corners {
    border-radius: var(--border-radius);
}

.text-and-media__text-container--center {
    align-items: center;
    text-align: center;
}

.text-and-media__text-container--left {
    align-items: start;
    text-align: left;
}

.text-and-media__text-container--right {
    align-items: end;
    text-align: right;
}

.text-and-media__text ul {
    list-style-type: disc;
}

.text-and-media__text ul,
.text-and-media__text ol {
    margin-top: 12px;
    width: fit-content;
}

.text-and-media__text-container--center ul,
.text-and-media__text-container--center ol {
    margin: 12px auto;
}

/* ----------------------------------------
    Pre Heading Element
   ---------------------------------------- */
.text-and-media__pre-heading {
    text-transform: uppercase;
    font-weight: normal;
    font-size: var(--font-size-pre-heading);
    letter-spacing: 0.3em;
    line-height: 1;
    opacity: 0.8;
}

/* ----------------------------------------
    Heading Element
   ---------------------------------------- */

.text-and-media__heading {
    line-height: var(--heading-line-height);
    margin-top: 0.6rem;
}

/* ----------------------------------------
    Text Element
   ---------------------------------------- */

.text-and-media__text {
    max-width: var(--text-column-max-width);
}

.text-and-media__text ul {
    margin-left: 2rem;
}

.text-and-media__text p:first-of-type {
    margin-top: 0;
}
/* ----------------------------------------
CTA Element
---------------------------------------- */
/*
    CTA Modifiers
*/
    .text-and-media__call-to-action--media-behind:not(.text-and-media__call-to-action--background-color) .button--transparent {
        border-color: var(--white);
        color: var(--white);
    }
.text-and-media__call-to-action--media-behind.text-and-media__call-to-action--background-color .button--transparent {
    border-color: var(--black);
    color: var(--black);
}

/* ----------------------------------------
    Media Container Element
   ---------------------------------------- */

.text-and-media__media-container {
    height: 100%;
    width: 100%;
    position: relative;
}

/*
    Media Container Modifiers
*/

.text-and-media__media-container--horizontal {
    width: 50%;
}

.text-and-media__media-container--media-behind {
    position: absolute;
    z-index: -1;
    width: 100%;
    top: 0;
}

.text-and-media__media-container--has-iframe {
    height: calc(100vw / 2.2);
}

/* ----------------------------------------
    iframe Container Element
   ---------------------------------------- */
.text-and-media__iframe-container {
    height: 100%;
    width: 100%;
}


/* ----------------------------------------
    Media Elements
   ---------------------------------------- */

.text-and-media__iframe {}

.text-and-media__figure {
    height: 100%;
    width: 100%;
}

.text-and-media__figure-image,
.text-and-media__video,
.text-and-media__iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-and-media__figure--contain {
    object-fit: contain;
}

/*
    Media Modifiers
*/

.text-and-media__figure-image--rounded-corners-left,
.text-and-media__iframe--rounded-corners-left,
.text-and-media__video--rounded-corners-left {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.text-and-media__figure-image--rounded-corners-right,
.text-and-media__iframe--rounded-corners-right,
.text-and-media__video--rounded-corners-right {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.text-and-media__figure-image--rounded-corners-above,
.text-and-media__iframe--rounded-corners-above,
.text-and-media__video--rounded-corners-above {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.text-and-media__figure-image--rounded-corners-below,
.text-and-media__iframe--rounded-corners-below,
.text-and-media__video--rounded-corners-below {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.text-and-media__figure-image--circled {
    border-radius: 50%;
    padding: 2rem;
}

/* ----------------------------------------
    Media Caption Elements
   ---------------------------------------- */

.text-and-media__video-caption,
.text-and-media__figure-caption {
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    position: absolute;
    right: 0;
    bottom: -2.4rem;
    background-color: var(--background-secondary);
    padding: 1rem 2rem;
    margin: 1rem;
    opacity: 0.9;
}

/* 
    Media Caption Modifiers
*/

.text-and-media__video-caption--behind,
.text-and-media__figure-caption--behind {
    bottom: 0;
}

.text-and-media__video-caption--rounded-corners,
.text-and-media__figure-caption--rounded-corners {
    border-radius: var(--border-radius);
}

/* ------------------------------------------
    Small screen adjustments
   ------------------------------------------ */

@media screen and (max-width: 1300px) {
    .text-and-media {
        margin-top: var(--block-margin);
    }

    .text-and-media--media-left, .text-and-media--media-right {
        flex-direction: column;
    }

    .text-and-media__media-container {
        width: 100%;
    }

    .text-and-media__text-container {
        padding: 2rem;
        width: 100%;
    }

    .text-and-media__figure-image--rounded-corners-left,
    .text-and-media__iframe--rounded-corners-left,
    .text-and-media__video--rounded-corners-left {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }

    .text-and-media__figure-image--rounded-corners-right,
    .text-and-media__iframe--rounded-corners-right,
    .text-and-media__video--rounded-corners-right {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
}

