/* The CMS Staff plugin's cards (staff/templates/staff/staff_item.html), prefix .staff-card.
   1x1: a portrait card with a brand line under the photo. 1x3: a wide card of one
   height, the whole photo in a square on the left and the bio, scrolling when it is
   long, on the right, with the profile links, phone and e-mail under it.
   Same tokens as the page tabs and the programme pages: the brand blue, Roboto
   Slab from the body, 16px radius, soft blue shadows. sekizai's css block comes
   before styles.css and the cards often sit in a tab pane (page-tabs.css), so
   every rule takes two classes to win over their element rules. */

.staff-card {
    --sc-primary: var(--bs-primary, #0096db);
    --sc-primary-dark: #0987c2;
    --sc-primary-deep: #075e87;
    --sc-ink: #1e293b;
    --sc-text: #334155;
    --sc-muted: #64748b;
    --sc-line: #e2e8f0;
    --sc-photo-bg: #eaf4fb;
    --sc-tint: rgba(0, 150, 219, .08);
    --sc-radius: 16px;
    --sc-shadow: 0 10px 30px -12px rgba(2, 74, 110, .22);
    --sc-shadow-up: 0 18px 40px -16px rgba(2, 74, 110, .35);

    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    overflow: hidden;
    color: var(--sc-ink);
    transition: transform .2s ease, box-shadow .2s ease;
}

.staff-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sc-shadow-up);
}

/* ---------- Photo ---------- */

.staff-card .staff-card__photo {
    background: var(--sc-photo-bg);
}

.staff-card .staff-card__photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}

.staff-card .staff-card__nophoto {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    color: rgba(0, 150, 219, .35);
    font-size: 64px;
}

/* ---------- Text ---------- */

.staff-card .staff-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    padding: 16px 18px 18px;
    border-top: 3px solid var(--sc-primary);
}

.staff-card .staff-card__role {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--sc-tint);
    color: var(--sc-primary-deep);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
}

.staff-card .staff-card__name {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--sc-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
}

.staff-card .staff-card__contacts {
    display: grid;
    gap: 6px;
}

.staff-card .staff-card__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--sc-text);
    min-width: 0;
}

.staff-card .staff-card__row > i {
    flex: none;
    width: 16px;
    margin-top: 3px;
    color: var(--sc-primary);
    font-size: 13px;
    text-align: center;
}

.staff-card .staff-card__link {
    color: var(--sc-text);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.staff-card .staff-card__link:hover {
    color: var(--sc-primary-dark);
    text-decoration: underline;
}

.staff-card .staff-card__ext {
    display: block;
    color: var(--sc-muted);
    font-size: 12.5px;
}

/* ---------- Profile links ---------- */

.staff-card .staff-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.staff-card .staff-card__icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sc-tint);
    color: var(--sc-primary-deep);
    font-size: 15px;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}

.staff-card .staff-card__icon:hover {
    background: var(--sc-primary);
    color: #fff;
}

.staff-card :is(.staff-card__icon, .staff-card__link):focus-visible {
    outline: 3px solid rgba(0, 150, 219, .45);
    outline-offset: 2px;
}

/* ---------- 1x3: the wide card, one height for all ---------- */

.staff-card.staff-card--wide {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    height: 300px;
    margin-bottom: 20px;
}

.staff-card.staff-card--wide:hover {
    transform: none;
}

/* the whole photo, never cut: a 250px square centred in the column, a photo
   of another shape on white; the brand line beside it */
.staff-card--wide .staff-card__photo {
    height: 100%;
    min-height: 0;
    background: #fff;
    border-right: 3px solid var(--sc-primary);
}

.staff-card--wide .staff-card__photo img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
}

.staff-card--wide .staff-card__nophoto {
    height: 100%;
    aspect-ratio: auto;
}

.staff-card--wide .staff-card__body {
    gap: 8px;
    min-height: 0;
    padding: 18px 12px 16px 22px;
    border-top: 0;
}

.staff-card--wide .staff-card__name {
    font-size: 17px;
}

/* a long bio scrolls inside the card: a thin brand scrollbar and a fade that says there is more */
.staff-card--wide .staff-card__bio {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 150, 219, .45) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
}

.staff-card--wide .staff-card__bio::-webkit-scrollbar {
    width: 6px;
}

.staff-card--wide .staff-card__bio::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 219, .45);
    border-radius: 6px;
}

.staff-card--wide .staff-card__bio p {
    margin: 0 0 24px;
    color: var(--sc-text);
    font-size: 14.5px;
    line-height: 1.65;
}

.staff-card--wide .staff-card__bio:focus-visible {
    outline: 3px solid rgba(0, 150, 219, .35);
    outline-offset: 2px;
    border-radius: 6px;
}

.staff-card--wide .staff-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--sc-line);
}

/* no links and no contacts: no empty line under the bio */
.staff-card--wide .staff-card__foot:not(:has(*)) {
    display: none;
}

.staff-card--wide .staff-card__foot .staff-card__links {
    margin-top: 0;
}

.staff-card--wide .staff-card__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}

@media (max-width: 575.98px) {
    .staff-card.staff-card--wide {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .staff-card--wide .staff-card__photo {
        height: auto;
        aspect-ratio: 1;
        border-right: 0;
        border-bottom: 3px solid var(--sc-primary);
    }

    .staff-card--wide .staff-card__body {
        padding: 16px 12px 16px 18px;
    }

    .staff-card--wide .staff-card__bio {
        flex: none;
        max-height: 220px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .staff-card,
    .staff-card:hover {
        transition: none;
        transform: none;
    }
}
