/* Extracted from staff/templates/staff_plugins/staff_list_plugin.html. Linked via sekizai so a page loads it once,
   however many instances it renders. */

.staff-grid-plugin,
.staff-grid-plugin * {
    box-sizing: border-box;
    font-family: "NYU Perstare", sans-serif;
}

.staff-grid-plugin {
    width: 100%;
    min-width: 0;
    transition: opacity 160ms ease;
}

.staff-grid-plugin.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.staff-grid-plugin__heading {
    margin: 0 0 20px;
    color: #57068C;
    font-size: 32px;
    line-height: 41px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.staff-grid-plugin__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.staff-grid-plugin__count {
    margin: 0;
    color: #4B4B4B;
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
}

.staff-grid-plugin__count strong {
    color: #161616;
    font-weight: 500;
}

.staff-grid-plugin__topbar .directory-mobile-filter-slot {
    display: none;
}

.staff-grid-plugin__sort {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4B4B4B;
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
    white-space: nowrap;
}

.staff-grid-plugin__sort select {
    height: 32px;
    min-width: 70px;
    border: 1px solid #CECECE;
    border-radius: 3px;
    background: #FFFFFF;
    color: #4B4B4B;
    padding: 0 10px;
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
    cursor: pointer;
    outline: none;
}

.staff-grid-plugin__sort select:focus,
.staff-grid-plugin__sort select:focus-visible {
    outline: none;
    border-color: #CECECE;
    box-shadow: none;
}

.staff-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(var(--staff-card-min-width, 245px), 1fr));
    gap: var(--staff-row-gap, 34px) var(--staff-column-gap, 36px);
    align-items: start;
}

.staff-grid-plugin--fixed-columns .staff-grid {
    grid-template-columns: repeat(var(--staff-grid-columns), minmax(0, 1fr));
}

.staff-featured {
    margin-bottom: var(--staff-row-gap, 34px);
    padding-bottom: var(--staff-row-gap, 34px);
    border-bottom: 1px solid #E0E0E0;
}

.staff-grid-plugin__visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.staff-featured__heading {
    margin: 0 0 20px;
    color: #161616;
    font-size: 24px;
    line-height: 30px;
    font-weight: 400;
    letter-spacing: -0.04em;
}

.staff-card {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    padding: 0;
    background: #F7F7F7;
    color: #161616;
    text-align: left;
    transition: transform 240ms ease, box-shadow 240ms ease;
}

button.staff-card {
    cursor: pointer;
}

.staff-card--copy:hover,
.staff-card--copy:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    outline: none;
}

.staff-card__badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

/* !important throughout: the chip's own Tailwind classes set the same
   properties, and this card is the one place they must give way. */
.staff-card__badges > * {
    height: 25px !important;
    min-width: 33px !important;
    padding: 0 7px !important;
    border-radius: 2px !important;
    font-size: 13px !important;
    line-height: 17px !important;
    font-weight: 500 !important;
    letter-spacing: -0.04em !important;
    background-color: color-mix(in srgb, var(--badge-bg) 92%, transparent) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.staff-card__image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 3px;
    background: #E7E7E7;
}

.staff-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 400ms ease;
}

.staff-card--copy:hover .staff-card__image {
    transform: scale(1.04);
}

.staff-card__body {
    min-height: 108px;
    padding: 17px 18px 20px;
    background: #F7F7F7;
    transition: background-color 240ms ease;
}

.staff-card__name {
    margin: 0 0 8px;
    color: #161616;
    font-size: 19px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: -0.04em;
    transition: color 240ms ease;
}

/* Matches .faculty-card__title: the title sits directly under the name
   with no "Position" label. */
.staff-card__title {
    color: #161616;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: -0.03em;
    transition: color 240ms ease;
}

/* Signed-in cards carry office / phone / email below the title. */
.staff-card__body--contact {
    min-height: 186px;
}

.staff-card__details {
    margin-top: 14px;
    display: grid;
    gap: 7px;
    color: #161616;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: -0.03em;
    transition: color 240ms ease;
}

.staff-card__detail {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.staff-card__label {
    color: #4B4B4B;
    font-size: 10px;
    line-height: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    transition: color 240ms ease;
}

.staff-card__value {
    overflow-wrap: anywhere;
}

.staff-card__copied {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: #57068C;
    font-size: 11px;
    line-height: 14px;
    font-weight: 800;
    opacity: 0;
    transition: opacity 180ms ease;
}

.staff-card.is-copied .staff-card__copied {
    opacity: 1;
}

.staff-card--copy:hover .staff-card__body,
.staff-card--copy:focus-visible .staff-card__body {
    background: #57068C;
}

.staff-card--copy:hover .staff-card__name,
.staff-card--copy:hover .staff-card__title,
.staff-card--copy:hover .staff-card__details,
.staff-card--copy:hover .staff-card__label,
.staff-card--copy:focus-visible .staff-card__name,
.staff-card--copy:focus-visible .staff-card__title,
.staff-card--copy:focus-visible .staff-card__details,
.staff-card--copy:focus-visible .staff-card__label {
    color: #FFFFFF;
}

.staff-card--copy:hover .staff-card__copied,
.staff-card--copy:focus-visible .staff-card__copied {
    color: #FFFFFF;
}

/* A card with a profile link (School Leadership, for faculty): the photo is the link. It zooms and lifts the
   card as a whole-card button does, but only the photo answers, since only the photo goes anywhere. */
.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

/* And the body inverts to NYU violet, as the Staff List Grid's copy cards and the Faculty List's cards do. */
.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) .staff-card__body {
    background: #57068C;
}

.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) .staff-card__name,
.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) .staff-card__title,
.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) .staff-card__details,
.staff-card--linked:has(.staff-card__image-link:hover, .staff-card__image-link:focus-visible) .staff-card__label {
    color: #FFFFFF;
}

/* The badges sit over the photo; let a click on one reach the link beneath. */
.staff-card--linked .staff-card__badges {
    pointer-events: none;
}

.staff-card__image-link {
    position: relative;
    display: block;
    cursor: pointer;
}

/* The focus ring is an inset overlay rather than an outline: the card clips anything drawn outside the photo,
   and the zoomed photo (transformed, so painted later) would cover an outline drawn inside it. */
.staff-card__image-link:focus-visible {
    outline: none;
}

.staff-card__image-link:focus-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    box-shadow: inset 0 0 0 3px #57068C;
    pointer-events: none;
}

.staff-card__image-link:hover .staff-card__image,
.staff-card__image-link:focus-visible .staff-card__image {
    transform: scale(1.04);
}

.staff-empty {
    grid-column: 1 / -1;
    background: #F7F7F7;
    padding: 40px;
    color: #4B4B4B;
    text-align: center;
    font-size: 14px;
    line-height: 18px;
}

.staff-grid-pagination {
    width: 100%;
    margin-top: 48px;
}

.staff-grid-pagination-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 18px;
}

.staff-grid-pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.staff-grid-pagination-line {
    height: 1px;
    flex: 1 1 auto;
    background: #DBDBDB;
}

.staff-grid-page-link,
.staff-grid-page-current,
.staff-grid-page-ellipsis {
    display: inline-flex;
    width: 31px;
    height: 31px;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.staff-grid-page-link {
    border: 1px solid #DBDBDB;
    background: #F7F7F7;
    color: #4B4B4B;
    transition:
        border-color 180ms ease,
        color 180ms ease,
        background-color 180ms ease;
}

.staff-grid-page-link:hover {
    border-color: #57068C;
    color: #57068C;
    background: #FFFFFF;
}

.staff-grid-page-current {
    border: 1px solid #57068C;
    background: #FFFFFF;
    color: #57068C;
}

.staff-grid-page-ellipsis {
    width: auto;
    min-width: 18px;
    border: 0;
    background: transparent;
    color: rgba(75, 75, 75, 0.65);
    letter-spacing: 0.06em;
}

@media (max-width: 900px) {
    .staff-grid-plugin__topbar {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 14px;
        margin-bottom: 16px;
    }

    .staff-grid-plugin__topbar .courant-filter-mobile-trigger {
        order: 1;
        flex: 0 0 auto;
    }

    .staff-grid-plugin__topbar .directory-mobile-filter-slot {
        display: inline-flex;
        order: 1;
        flex: 0 0 auto;
    }

    .staff-grid-plugin__topbar .directory-mobile-filter-slot:empty {
        display: none;
    }

    .staff-grid-plugin__count {
        order: 3;
        flex: 0 0 100%;
        font-size: 12px;
        line-height: 16px;
    }

    .staff-grid-plugin__sort {
        order: 2;
        margin-left: auto;
        gap: 8px;
        font-size: 12px;
        line-height: 16px;
    }

    .staff-grid-plugin__sort select {
        height: 32px;
        min-width: 62px;
        padding: 0 8px;
        font-size: 13px;
        line-height: 17px;
    }

    .staff-grid,
    .staff-grid-plugin--fixed-columns .staff-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
        gap: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .staff-grid-plugin,
    .staff-card,
    .staff-card__image,
    .staff-card__body,
    .staff-card__name,
    .staff-card__title,
    .staff-card__details,
    .staff-card__label,
    .staff-grid-page-link {
        transition: none !important;
    }

    .staff-card--copy:hover,
    .staff-card--copy:focus-visible,
    .staff-card--copy:hover .staff-card__image,
    .staff-card--linked,
    .staff-card__image-link .staff-card__image {
        transform: none !important;
    }
}
