/* Join. Desktop: the card starts as the design's 1202.915×602 card; join.js gives the section its scroll runway
   and grows the box to the viewport with transform + clip-path (--kx/--ky pull the inner elements to the centre).
   Without JS it stays the static card of the design. */
.znh-join {
    position: relative;
    height: 650px;
}

/* the expansion's scroll runway: from the first paint, so the page height never changes after load */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .znh-join {
        height: calc(var(--znh-join-run) + var(--znh-vh, 900px) / 2);
    }
}

.znh-join__box {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    will-change: transform;
}

/* the design's crop of the photo inside the card */
.znh-join__media {
    position: absolute;
    top: -333.761px;
    left: -436.238px;
    width: 2182.91px;
    height: 1218.369px;
    will-change: transform;
}

.znh .znh-join__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    translate: 0 var(--py, 0px);
    transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}

.znh-join__box:hover .znh-join__img {
    transform: scale(1.045);
}

.znh-join__el {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(calc(var(--ex) * var(--kx, 1) * 1px - 50%), calc(var(--ey) * var(--ky, 1) * 1px - 50%));
}

/* title + ratings pill. At rest the title starts at its design top and the pill keeps its place (the gap gives);
   grown (--ky .5) the two are centred as one block 24.5px apart, so a longer translation never runs into the pill
   or off the card / screen. 140px + 329px × ky = the English block (5-line title) */
.znh-join__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24.5px;
    min-height: calc(140px + 329px * var(--ky, 1));
    transform: translate(calc(var(--ex) * var(--kx, 1) * 1px - 50%), calc(var(--ey) * var(--ky, 1) * 1px - 115px - (1 - var(--ky, 1)) * (100% - 140px - 329px * var(--ky, 1))));
}

.znh .znh-join__title {
    width: 442px;
    margin: 0;
    color: #fff;
}

.znh-join__ratings {
    width: 432px;
    height: 50px;
    padding: 14px 0 0 20px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 87px;
    background: rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(5.15px);
    backdrop-filter: blur(5.15px);
}

.znh-join__live {
    gap: 33px;
    width: max-content;
}

.znh-join__badges {
    display: none;
}

/* 196×230 with the English title; a longer translation wraps, and the card widens to its longest word */
.znh-join__qr-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min-content;
    min-width: 196px;
    padding: 19px 14.95px 18px 16px;
    border-radius: 10.051px;
    background: #fff;
}

.znh .znh-join__qr-title {
    align-self: center;
    color: #000;
    font-size: 25.128px;
    font-style: italic;
    font-weight: 900;
    line-height: .95;
    min-height: 18px;
    letter-spacing: -.5026px;
    text-align: center;
    text-transform: uppercase;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
}

/* centred in a widened card, at the design's x in the 196px one */
.znh .znh-join__qr-img {
    margin-left: calc(50% - 82.525px);
    width: 163px;
    height: 163px;
}

@media (max-width: 899px) {
    .znh-join {
        height: auto;
        margin-top: 35px;
    }

    .znh .znh-join__box {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 625px !important;
        border-radius: 18px !important;
        background: #000;
    }

    .znh-join__box::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .65) 80%);
        pointer-events: none;
    }

    .znh .znh-join__media {
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .znh .znh-join__img {
        object-fit: cover;
        object-position: 52% center;
        position: absolute;
        transform: scale(1.3);
        top: -90px;
    }

    .znh .znh-join__el {
        transform: translateX(-50%) !important;
    }

    /* bottom-anchored: a longer translation grows upward, not into the badges */
    .znh .znh-join__head {
        top: auto;
        bottom: 107px;
        width: 100%;
        min-height: 0;
        align-items: center;
        gap: 7px;
    }

    .znh .znh-join__title {
        width: 317px;
        max-width: calc(100% - 20px);
        text-align: center;
    }

    .znh-join__qr-card,
    .znh-join__live {
        display: none !important;
    }

    .znh .znh-join__ratings {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
        width: 330px;
        max-width: calc(100% - 16px);
        height: 39px;
        padding: 0 10px;
    }

    .znh-join__badges {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .znh-join__badges .znh-rate {
        width: auto;
        height: 14px;
    }

    .znh .znh-join__cta {
        position: absolute;
        top: 528px;
        left: 50%;
        z-index: 2;
        width: 330px;
        max-width: calc(100% - 16px);
        margin: 0;
        transform: translateX(-50%);
    }
}
