/* Why HKUST EMBA: loaded only by the v2 index. */
.wx-why {
    position: relative;
    padding: var(--v2-section-space) 0;
    background: linear-gradient(105deg, rgba(8, 31, 65, .62), rgba(20, 46, 112, .58)),
        url('/static/emba/images/roadmaptolearn_bg_default.png') center / cover;
    background-color: #092350;
}

.wx-why,
.wx-why * {
    box-sizing: border-box;
    font-family: var(--v2-font-body);
}

.wx-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    width: calc(100% - 2 * var(--v2-gutter));
    max-width: 1565px;
    margin: 0 auto;
}

.wx-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    min-height: 254px;
    isolation: isolate;
    background: #102b50;
    border: 1px solid rgba(173, 200, 230, .2);
}

.wx-card-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The Pixso gradient follows each photo's full frame on desktop and mobile. */
.v2-index .wx-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: url('../images/why-pixso-mask.svg?v=2') center / 100% 100% no-repeat;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .v2-index .wx-card {
        transition: scale .28s ease, box-shadow .28s ease;
    }
    .v2-index .wx-card:hover {
        scale: 1.025;
        z-index: 1;
        box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
    }
}

.wx-card-copy {
    width: 100%;
    padding: 72px 24px 24px;
    background: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.wx-card-copy h3 {
    margin: 0 0 10px;
    color: #f5dfa0;
    font-size: 29px;
    font-weight: 700;
    line-height: 42px;
    text-shadow: 0 4px 4px rgb(0, 0, 0);
}

.wx-card-copy p {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 30px;
    text-shadow: 0 4px 4px rgb(0, 0, 0);
    overflow-wrap: break-word;
}

.wx-card-school { grid-area: 1 / 1; }
.wx-card-faculty { grid-area: 1 / 2; }
.wx-card-innovation { grid-area: 3 / 1; }
.wx-card-rigour { grid-area: 3 / 2; }

.wx-intro {
    grid-area: 2 / 1 / 3 / -1;
    display: grid;
    grid-template-columns: 491px minmax(0, 1fr) 284px;
    gap: 40px;
    align-items: center;
    min-width: 0;
}

.wx-campus {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: 100%;
    min-width: 0;
    height: 254px;
    border: 1px solid rgba(173, 200, 230, .3);
}

.wx-campus img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wx-headings {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-self: center;
}

.wx-title {
    margin: 0;
    /* The loaded Alimama glyphs need 1px beyond the 593px design frame to keep line two intact. */
    max-width: 594px;
    color: var(--v2-heading-color);
    font-size: 50px;
    font-weight: 700;
    line-height: 60px;
    letter-spacing: 0;
}

.wx-why .wx-title,
.wx-why .wx-title span { font-family: var(--v2-font-display); }
.wx-title > span { display: block; }
.wx-title-program { display: inline-block; white-space: nowrap; }

.wx-lead {
    margin: 16px 0 0;
    color: #fff;
    font-size: var(--v2-body-size);
    font-weight: 700;
    line-height: 1.6;
}

.wx-cta {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    align-self: end;
    margin-bottom: 20px;
    width: 100%;
    max-width: 284px;
    min-height: 72px;
    padding: 18px 24px;
    border: 1px solid var(--cta-border);
    border-radius: var(--cta-radius);
    background: var(--cta-gradient);
    box-shadow: inset 0 0 0 3px rgba(255, 246, 212, .3), 3px 4px 0 rgba(3, 22, 52, .35);
    color: var(--cta-text);
    text-align: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .02em;
    transition: filter .2s;
}

.wx-cta:hover,
.wx-cta:focus {
    color: var(--cta-text);
    text-decoration: none;
    filter: brightness(1.07);
}

.wx-cta:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
}

@media (max-width: 767px) {
    .wx-why {
        padding: 34px 0 60.5px;
        background: url('../images/why-mobile-background.png') center / cover,
            linear-gradient(105deg, #0c1d3e, #082d76);
    }
    .wx-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        width: 83.0666667%;
        margin-left: 8.1333333%;
        margin-right: 8.8%;
    }
    .wx-intro { grid-area: auto; grid-template-columns: minmax(0, 1fr); }
    .wx-headings { grid-column: 1; grid-row: 1; }
    .wx-campus,
    .wx-cta { display: none; }
    .wx-title { font-size: 22px; line-height: 26.5px; }
    .wx-lead {
        margin-top: 20.5px;
        font-family: var(--v2-font-display);
        font-size: 12px;
        line-height: 14.5px;
    }
    .wx-card {
        grid-area: auto;
        /* 254 / 750 preserves the landscape crop while allowing copy to grow. */
        min-height: 33.8666667vw;
        border: 0;
    }
    .wx-card-school { margin-top: 18.5px; }
    .wx-card-faculty { margin-top: 16px; }
    .wx-card-innovation { margin-top: 22px; }
    .wx-card-rigour { margin-top: 10.5px; }
    .wx-card-copy {
        padding: 20px 8px 7.5px;
        background: none;
    }
    .wx-why:not(.wx-en) .wx-card-copy br { display: none; }
    .wx-card-copy h3 {
        margin-bottom: 4px;
        color: #ffda96;
        font-size: 13px;
        font-weight: 600;
        line-height: 19px;
        text-shadow: 0 2px 2px #000;
    }
    .wx-card-copy p {
        font-size: 8px;
        font-weight: 500;
        line-height: 15px;
        text-shadow: 0 2px 2px #000;
    }
}

.v2-index .wx-why { overflow: clip; }

@media (prefers-reduced-motion: no-preference) {
    .v2-index #isWhy .why-motion-pending { opacity: 0; }
}
