/* World Class Faculty — loaded only by v2/index.html. */

section.fx-faculty#tutor-bg {
    padding: 110px 0 118px;
    background-color: #132f5b;
    background-image: url("../../images/world_class_bg.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    font-family: 'Noto Sans SC', system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.fx-faculty *,
.fx-faculty *::before,
.fx-faculty *::after {
    box-sizing: border-box;
    font-family: inherit;
}

.fx-inner {
    width: calc(100% - 2 * var(--v2-gutter));
    max-width: 1440px;
    margin: 0 auto;
}

.fx-title {
    margin: 0 0 24px;
    color: var(--v2-heading-color);
    font-family: var(--v2-font-display);
    font-size: 50px;
    font-weight: 700;
    line-height: 60px;
    letter-spacing: 0;
    text-align: center;
}

.fx-lead,
.fx-summary {
    color: #fff;
    font-size: var(--v2-body-size);
    font-weight: 500;
    line-height: 1.8;
    text-align: center;
}

.fx-lead {
    margin: 0;
}

.fx-summary {
    margin: 0;
    text-wrap: pretty;
}

/*
 * Five columns on desktop, two on phones. Without JavaScript all profiles wrap
 * into centered rows; the enhanced grid below overlays responsive pages.
 */
.fx-grid {
    --fx-cols: 5;
    --fx-gap: 40px;
    --fx-card-max: 9999px;
    --fx-card-text: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--fx-gap);
    /*
     * Hold the row width down rather than the card width: a narrower card
     * inside a full-width row just lets a further card pack in beside it.
     */
    max-width: calc(var(--fx-cols) * var(--fx-card-max) + (var(--fx-cols) - 1) * var(--fx-gap));
    margin: 54px auto 0;
}

.fx-card {
    flex: 0 0 auto;
    /* Trim a hundredth of a pixel so rounding never wraps a full row. */
    width: calc((100% - (var(--fx-cols) - 1) * var(--fx-gap)) / var(--fx-cols) - .01px);
    min-width: 0;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

.fx-card:hover,
.fx-card:focus {
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .v2-index .fx-card {
        position: relative;
        transition: scale .28s ease;
    }
    .v2-index .fx-card:is(:hover, :focus-visible) {
        scale: 1.025;
        z-index: 1;
    }
    .v2-index .fx-card-frame { transition: filter .28s ease; }
    .v2-index .fx-card:is(:hover, :focus-visible) .fx-card-frame {
        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .28));
    }
}

.fx-card-frame {
    position: relative;
    padding: 0 0 8px 8px;
}

.v2-index .fx-card-frame {
    isolation: isolate;
}

/* Match Program's separate, offset artwork instead of painting the photo frame. */
.v2-index .fx-card-frame::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: calc((100% - 6px) * 24 / 232.36);
    left: calc(6px - (100% - 6px) * 8 / 200);
    width: calc((100% - 6px) * 201.86 / 200);
    aspect-ratio: 201.86 / 217.41;
    background: url('../images/program-faculty-backdrop-pixso.svg') left top / 100% 100% no-repeat;
}

.v2-index .fx-card-frame img {
    aspect-ratio: 200 / 232.36;
}

/*
 * `teacher.avatar` is the 220x220 headshot; `teacher.picture` is the
 * 295x200 landscape crop, which lost the side of a face when it was forced
 * into this portrait frame. The square source keeps every head whole here
 * and only trims background from the sides.
 */
.fx-card-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 250 / 290;
    object-fit: cover;
    object-position: center top;
    background-color: #fff;
}

.fx-card-name,
.fx-card-name-en,
.fx-card-school {
    padding-left: 12px;
    font-size: var(--fx-card-text);
    line-height: 1.5;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.fx-card-name,
.fx-card-name-en {
    white-space: pre-line;
}

.fx-card-name {
    margin-top: 16px;
    color: var(--v2-heading-color);
    font-weight: 600;
}

.fx-card-name-en {
    margin-top: 2px;
    color: var(--v2-heading-color);
    font-weight: 600;
}

.fx-card-school {
    margin-top: 2px;
    color: #fff;
    font-weight: 600;
}

.fx-cta-row {
    display: flex;
    justify-content: center;
    margin-top: 70px;
}

.fx-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 284px;
    min-height: 76px;
    padding: 16px 34px;
    border: 1px solid var(--cta-border);
    border-radius: var(--cta-radius);
    background: var(--cta-gradient);
    box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
    color: var(--cta-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .12em;
    text-align: center;
    transition: filter .2s;
}

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

.fx-card:focus-visible,
.fx-cta:focus-visible {
    outline: 3px solid #f3df9a;
    outline-offset: 6px;
}

/* Overlay every page in one row so longer credentials cannot move the controls.
 * Two tracks per card also center incomplete pages in both layout modes. */
.fx-grid.is-enhanced {
    display: grid;
    grid-template-columns: repeat(calc(2 * var(--fx-cols)), minmax(0, 1fr));
    touch-action: pan-y;
}

.fx-grid.is-enhanced .fx-card {
    grid-row: 1;
    grid-column: var(--fx-column) / span 2;
    width: calc(100% - .01px);
}

.fx-grid.is-enhanced .fx-card:not(.is-active) {
    visibility: hidden;
    pointer-events: none;
}

.fx-pagination {
    display: none;
}

.fx-pagination:not([hidden]) {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 64px;
}

.fx-dot {
    display: grid;
    place-items: center;
    width: 25px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.fx-dot::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
}

.fx-dot[aria-current="true"]::before,
.fx-dot:hover::before {
    background: #fff;
}

.fx-dot:focus-visible {
    outline: 2px solid #f3df9a;
    outline-offset: -4px;
}

@media (max-width: 767px) {
    section.fx-faculty#tutor-bg {
        padding: clamp(40px, 6vw, 72px) 0;
    }

    .fx-inner {
        width: calc(100% - clamp(40px, 10.67vw, 64px));
    }

    .fx-title {
        margin-bottom: 22px;
        font-size: clamp(25px, calc(17.86px + 1.905vw), 36px);
        line-height: 1.2;
    }

    .fx-lead,
    .fx-summary {
        max-width: 660px;
        margin-inline: auto;
        font-size: clamp(11px, calc(7.43px + .952vw), 16px);
        font-weight: 600;
        line-height: 1.91;
        line-break: strict;
    }

    .fx-lead span {
        display: inline-block;
        white-space: nowrap;
    }

    .fx-summary span {
        display: block;
        white-space: nowrap;
    }

    .fx-grid {
        --fx-cols: 2;
        --fx-gap: clamp(24px, 8vw, 48px);
        --fx-card-text: clamp(12px, calc(7.71px + 1.143vw), 18px);
        max-width: 600px;
        margin-top: clamp(36px, 7vw, 56px);
    }

    .fx-card-frame {
        padding: 0 0 6px 6px;
    }

    .fx-card-name,
    .fx-card-name-en,
    .fx-card-school {
        padding-left: 6px;
        line-break: strict;
    }

    .fx-card-name {
        margin-top: 10px;
    }

    .fx-pagination:not([hidden]) {
        display: flex;
        justify-content: center;
        margin-top: 12px;
    }

    .fx-cta-row {
        margin-top: 20px;
    }

    .fx-cta {
        width: 100%;
        max-width: clamp(312px, 60vw, 440px);
        min-width: 0;
        min-height: 44px;
        padding: 8px 14px;
        font-size: clamp(18px, 2.4vw, 22px);
        line-height: 1.4;
    }
}

/* Clip moving pages at the grid edges; keep portrait decoration above/below. */
.v2-index .fx-grid.is-sliding {
    overflow-x: clip;
    clip-path: inset(-30px 0);
}
