/*
 * YouTube banner (Figma "YouTube banner for blog": Size=768 and Size=375).
 *
 * The layout follows the banner's own width, not the viewport: the post column is
 * 444px on a 1024 screen, so the narrow variant is the default and the wide one is
 * a container query. Texts keep their px sizes; the collage scales with the width
 * through --u (1 design px of the matching frame: 295 or 768 wide), never above 1px:
 * the card stays 865 / 768 tall in a wider column, the collage centred.
 * Classes on every rule: .post-body img / p / a set margins and sizes for content.
 */

.yt-banner {
    container-type: inline-size;
    margin: 60px 0 0;
}

.yt-banner .yt-banner__card {
    --u: min(100cqw / 295, 1px);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 100px;
    padding: 60px 50px 50px;
    overflow: hidden;
    background-color: var(--blue-dark);
    border-radius: 30px;
    isolation: isolate;
}

/* Content */

.yt-banner .yt-banner__content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    /* In the 375 frame the text and the button run past the 50px card padding:
       the content box is 30px wider on each side, so the title keeps 3 lines. */
    width: calc(100% + 60px);
    text-align: center;
}

.yt-banner .yt-banner__title {
    margin: 0;
    font-size: 40px;
    font-weight: 400;
    line-height: 40px;
    letter-spacing: -0.02em;
    font-feature-settings: "liga" 0;
    color: var(--white);
}

.yt-banner .yt-banner__description {
    margin: 0;
    font-size: 18px;
    line-height: 25px;
    letter-spacing: 0.01em;
    font-feature-settings: "liga" 0;
    color: var(--grey);
}

/* Narrow variant: no arrow, symmetric padding (as in the design) */
.yt-banner .yt-banner__button {
    padding: 0 20px;
    justify-content: center;
    white-space: nowrap;
    font-feature-settings: "liga" 0;
}

.yt-banner .yt-banner__button svg.arrow {
    display: none;
}

/* Collage */

.yt-banner .yt-banner__media {
    position: relative;
    width: 100%;
    height: calc(350 * var(--u));
}

.yt-banner .yt-banner__media img {
    display: block;
    max-width: none;
    margin: 0;
}

/* The blurred glow is a raster: WebKit drops large blur radii (see genie-section). */
.yt-banner .yt-banner__glow {
    position: absolute;
    z-index: 0;
    left: calc(50% - 763.5 * var(--u));
    top: calc(-455 * var(--u));
    width: calc(2040 * var(--u));
    height: calc(1370 * var(--u));
    pointer-events: none;
}

.yt-banner .yt-banner__shot {
    position: absolute;
    width: calc(247.234 * var(--u));
    height: calc(180 * var(--u));
    overflow: hidden;
    border-radius: 4px;
}

.yt-banner .yt-banner__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-banner .yt-banner__shot::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(8, 44, 90, 0.2);
}

.yt-banner .yt-banner__shot--1::after,
.yt-banner .yt-banner__shot--3::after {
    background-color: rgba(8, 44, 90, 0.5);
}

/* Positions from the 375 frame: x from the card centre, y from the collage top */
.yt-banner .yt-banner__shot--1 { z-index: 1; left: calc(50% - 71.73 * var(--u)); top: calc(130 * var(--u)); }
.yt-banner .yt-banner__shot--3 { z-index: 2; left: calc(50% - 185.8 * var(--u)); top: calc(40 * var(--u)); }
.yt-banner .yt-banner__shot--4 { z-index: 3; left: calc(50% - 22.17 * var(--u)); top: calc(-40 * var(--u)); }
.yt-banner .yt-banner__shot--2 { z-index: 4; left: calc(50% - 195.35 * var(--u)); top: calc(220 * var(--u)); }

.yt-banner .yt-banner__phone {
    position: absolute;
    z-index: 6;
    left: 50%;
    top: 0;
    width: calc(170.962 * var(--u));
    height: calc(350 * var(--u));
    transform: translateX(-50%);
}

.yt-banner .yt-banner__phone-frame {
    width: 100%;
    height: 100%;
}

.yt-banner .yt-banner__phone-screen {
    position: absolute;
    left: calc(6.92 * var(--u));
    top: calc(6.11 * var(--u));
    width: calc(157.35 * var(--u));
    height: calc(337.887 * var(--u));
}

/* Wide variant (Size=768) */
@container (min-width: 600px) {
    .yt-banner .yt-banner__card {
        --u: min(100cqw / 768, 1px);
        gap: 30px;
        padding-bottom: 0;
    }

    .yt-banner .yt-banner__content {
        width: 100%;
    }

    .yt-banner .yt-banner__title {
        font-size: 60px;
        line-height: 60px;
    }

    .yt-banner .yt-banner__description {
        font-size: 20px;
        line-height: 30px;
    }

    .yt-banner .yt-banner__button {
        justify-content: space-between;
        padding: 0 20px 0 30px;
    }

    .yt-banner .yt-banner__button svg.arrow {
        display: block;
    }

    /* Visible part of the phone: the card ends at 768 in the design and clips it */
    .yt-banner .yt-banner__media {
        height: calc(388 * var(--u));
    }

    .yt-banner .yt-banner__glow {
        left: calc(50% - 1000 * var(--u));
        top: calc(-370 * var(--u));
    }

    .yt-banner .yt-banner__shot--1,
    .yt-banner .yt-banner__shot--3 {
        width: calc(296.68 * var(--u));
        height: calc(216 * var(--u));
        top: calc(172 * var(--u));
    }

    .yt-banner .yt-banner__shot--2,
    .yt-banner .yt-banner__shot--4 {
        width: calc(318.657 * var(--u));
        height: calc(232 * var(--u));
        top: calc(60 * var(--u));
    }

    .yt-banner .yt-banner__shot--1 { z-index: 1; left: calc(50% + 92.11 * var(--u)); }
    .yt-banner .yt-banner__shot--2 { z-index: 2; left: calc(50% + 0.16 * var(--u)); }
    .yt-banner .yt-banner__shot--3 { z-index: 3; left: calc(50% - 388.67 * var(--u)); }
    .yt-banner .yt-banner__shot--4 { z-index: 4; left: calc(50% - 318.49 * var(--u)); }

    .yt-banner .yt-banner__phone {
        width: calc(244.232 * var(--u));
        height: calc(500 * var(--u));
    }

    .yt-banner .yt-banner__phone-screen {
        left: calc(9.89 * var(--u));
        top: calc(8.73 * var(--u));
        width: calc(224.786 * var(--u));
        height: calc(482.696 * var(--u));
    }
}
