
/*
 * Homepage campaign video dialog
 *
 * Responsive sizing for portrait and landscape
 * displays, preserving the video's native ratio.
 *
 * This stylesheet loads after media-story.css.
 */

/* Video dialog: flexible desktop dimensions */

.home-media__dialog {
    box-sizing: border-box;

    width: min(92vw, 70rem);
    max-width: none;
    max-height: calc(100dvh - 2rem);

    padding: 0;
    overflow: auto;
}

/* Video player: preserve native aspect ratio */

.home-media__dialog .home-media__video {
    display: block;

    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 7rem);

    margin-inline: auto;

    aspect-ratio: auto;
    object-fit: contain;

    background: var(--color-black);
}

/*
 * Portrait screens
 *
 * Expand the dialog horizontally and reduce
 * the unused margin around the video.
 */

@media (orientation: portrait) {
    .home-media__dialog {
        width: min(98vw, 40rem);
        max-height: calc(100dvh - 1rem);
    }

    .home-media__dialog .home-media__video {
        max-height: calc(100dvh - 6rem);
    }
}

/*
 * Tablet and mobile widths
 */

@media (max-width: 48rem) {
    .home-media__dialog {
        width: 98vw;
        max-height: calc(100dvh - 0.75rem);
    }

    .home-media__dialog-header {
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .home-media__dialog .home-media__video {
        max-height: calc(100dvh - 5.5rem);
    }
}

/*
 * Very narrow mobile screens
 */

@media (max-width: 24rem) {
    .home-media__dialog {
        width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }

    .home-media__dialog-header {
        padding: 0.5rem 0.75rem;
    }

    .home-media__dialog .home-media__video {
        max-height: calc(100dvh - 4.5rem);
    }
}

/*
 * Temporary video availability message.
 *
 * Displayed when neither campaign video
 * is available.
 */

.home-media__video-message {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: clamp(15rem, 35vw, 25rem);

    padding: clamp(1.5rem, 4vw, 3rem);

    background: var(--color-surface-contrast);
    color: var(--color-text-on-contrast);

    text-align: center;
}

.home-media__video-message p {
    max-width: 36rem;
    margin: 0;

    font-family: var(--font-sans);
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.6;
}
