/*---*\
Half Text + Half Media
50/50 text and image or video section with reversible layout.

KEY FEATURES:
- Mobile-first stacked layout; side-by-side at 1200px+
- Image or video media with Fancybox popup for video
- Decorative corner accents on media frame
\*---*/

.breadcrumbs:has(+ .full-width > .content-area > .page-flexible-content > .half-text-half-media) {
    margin-top: 0;
}

.half-text-half-media__row {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.half-text-half-media__text h2 {
    margin-bottom: 18px;
}

.half-text-half-media__divider {
    display: block;
    width: 146px;
    height: auto;
    margin-bottom: 20px;
}

.half-text-half-media__content {
    color: #474747;
}

.half-text-half-media__content p:last-child {
    margin-bottom: 0;
}

.half-text-half-media__media-link {
    display: block;
    text-decoration: none;
    border-radius: 5px;
}

.half-text-half-media__media-link:focus-visible {
    outline: 2px solid #4797a3;
    outline-offset: 4px;
}

.half-text-half-media__media-frame {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    min-height: 220px;
    background-color: #f0ece7;
}

.half-text-half-media__media-frame--video::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.4s ease;
    pointer-events: none;
}

.half-text-half-media__media-link:hover .half-text-half-media__media-frame--video::after,
.half-text-half-media__media-link:focus-visible .half-text-half-media__media-frame--video::after {
    background-color: rgba(0, 0, 0, 0.2);
}

.half-text-half-media__image {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.half-text-half-media__media-link:hover .half-text-half-media__image,
.half-text-half-media__media-link:focus-visible .half-text-half-media__image {
    transform: scale(1.05);
}

.half-text-half-media__corner {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    width: 65px;
    height: auto;
}

.half-text-half-media__corner--tl {
    top: 16px;
    left: 16px;
}

.half-text-half-media__corner--br {
    right: 16px;
    bottom: 16px;
    transform: rotate(-90deg) scaleY(-1);
}

.half-text-half-media__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.half-text-half-media__play-button {
    display: block;
    width: 62px;
    height: 62px;
    transition: transform 0.4s ease;
}

.half-text-half-media__media-link:hover .half-text-half-media__play-button,
.half-text-half-media__media-link:focus-visible .half-text-half-media__play-button {
    transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
    .half-text-half-media__image,
    .half-text-half-media__play-button,
    .half-text-half-media__media-frame--video::after {
        transition-duration: 0.01ms;
    }

    .half-text-half-media__media-link:hover .half-text-half-media__image,
    .half-text-half-media__media-link:focus-visible .half-text-half-media__image,
    .half-text-half-media__media-link:hover .half-text-half-media__play-button,
    .half-text-half-media__media-link:focus-visible .half-text-half-media__play-button {
        transform: none;
    }
}

@media (min-width: 768px) {
    .half-text-half-media__row {
        gap: 40px;
    }

    .half-text-half-media__media-frame {
        min-height: 280px;
    }

    .half-text-half-media__image {
        min-height: 280px;
    }

    .half-text-half-media__corner {
        width: 90px;
    }

    .half-text-half-media__corner--tl {
        top: 24px;
        left: 24px;
    }

    .half-text-half-media__corner--br {
        right: 24px;
        bottom: 24px;
    }

    .half-text-half-media__play-button {
        width: 72px;
        height: 72px;
    }
}

@media (min-width: 1200px) {
    .half-text-half-media__row {
        flex-direction: row;
        align-items: center;
        gap: 150px;
    }

    .half-text-half-media__row--reverse {
        flex-direction: row-reverse;
    }

    .half-text-half-media__text,
    .half-text-half-media__media {
        flex: 1;
        min-width: 0;
    }

    .half-text-half-media__text {
        max-width: 614px;
    }

    .half-text-half-media__media {
        max-width: 505px;
        margin-left: auto;
    }

    .half-text-half-media__row--reverse .half-text-half-media__media {
        margin-left: 0;
        margin-right: auto;
    }

    .half-text-half-media__media-frame {
        min-height: 361px;
    }

    .half-text-half-media__image {
        min-height: 361px;
    }

    .half-text-half-media__corner {
        width: 123px;
    }

    .half-text-half-media__corner--tl {
        top: 30px;
        left: 30px;
    }

    .half-text-half-media__corner--br {
        right: 30px;
        bottom: 30px;
    }

    .half-text-half-media__play-button {
        width: 78px;
        height: 78px;
    }
}
