/* NOTE: VIDEO EMBED + VIDEO FEATURE (inc/new/sections/video-embed.php, video-feature.php) */

.kmd-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--kmd-black);
}

.kmd-video iframe,
.kmd-video__cover {
    width: 100%;
    height: 100%;
    border: 0;
}

.kmd-video__cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: var(--kmd-black);
    cursor: pointer;
}

.kmd-video__cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kmd-video__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    transition: background-color .2s;
}

.kmd-video__cover:hover::after {
    background: rgba(0, 0, 0, .2);
}

.kmd-video__play {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--kmd-white);
}

.kmd-video__play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border: 2px solid var(--kmd-white);
    border-radius: 50%;
    background: var(--kmd-black);
    transition: transform .2s;
}

.kmd-video__cover:hover .kmd-video__play-icon {
    transform: scale(1.06);
}

.kmd-video__play-label {
    font-size: 18px;
    font-weight: 700;
}

@media screen and (max-width: 767px) {
    .kmd-video__play-icon {
        width: 64px;
        height: 64px;
    }

    .kmd-video__play-icon svg {
        width: 38px;
        height: 38px;
    }

    .kmd-video__play-label {
        font-size: 15px;
    }
}

/* NOTE: VIDEO POPUP (created by javascript/new/embed.js for covers with data-embed-popup) */

.kmd-embed-popup {
    width: min(1100px, 100vw - 32px);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.kmd-embed-popup::backdrop {
    background: rgba(0, 0, 0, .8);
}

/* 16:9, but never taller than the screen (leaves room for the close button above it) */
.kmd-embed-popup__frame {
    width: min(100%, (100vh - 120px) * 16 / 9);
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: var(--kmd-black);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.kmd-embed-popup__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.kmd-embed-popup__close {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: var(--kmd-white);
    cursor: pointer;
}

.kmd-embed-popup__close:hover {
    background: rgba(255, 255, 255, .25);
}

/* the page behind the open popup does not scroll */
html.kmd-embed-popup-open {
    overflow: hidden;
}

/* NOTE: IFRAME EMBED (inc/new/sections/iframe-embed.php): virtual tours, street view */

.kmd-iframe {
    position: relative;
    width: 100%;
    height: var(--kmd-iframe-height, 640px);
    overflow: hidden;
    background: #111111;
}

/* play overlay first (iframe-embed.php), replaced by the iframe on click (javascript/new/embed.js) */
.kmd-iframe iframe,
.kmd-iframe__launch {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.kmd-iframe__launch {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #111111;
    color: var(--kmd-white);
    cursor: pointer;
}

.kmd-iframe__launch img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.kmd-iframe__launch::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    transition: background-color .2s;
}

.kmd-iframe__launch:hover img {
    transform: scale(1.03);
}

.kmd-iframe__launch:hover::after {
    background: rgba(0, 0, 0, .2);
}

.kmd-iframe__cta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.kmd-iframe__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border: 2px solid var(--kmd-white);
    border-radius: 50%;
    background: var(--kmd-black);
    transition: transform .2s;
}

.kmd-iframe__icon svg {
    margin-left: 4px;
}

.kmd-iframe__launch:hover .kmd-iframe__icon {
    transform: scale(1.06);
}

.kmd-iframe__label {
    padding: 8px 16px;
    background: rgba(0, 0, 0, .55);
    font-size: 16px;
    font-weight: 700;
}

@media screen and (max-width: 767px) {
    .kmd-iframe {
        height: 460px;
    }

    .kmd-iframe__icon {
        width: 64px;
        height: 64px;
    }

    .kmd-iframe__label {
        font-size: 14px;
    }
}
