/* =========================================================================
   Team
   ========================================================================= */

.team {
    padding-top: calc(var(--header-h) + 4.5rem);
}

/* --- Intro -------------------------------------------------------------- */

.team-intro {
    font-size: var(--fs-lede);
    line-height: 1.3;
}

.team-intro p {
    margin: 0;
}

.team-intro p + p {
    margin-top: 1.3em;
}

/* --- Groups ------------------------------------------------------------- */

.team-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3.5rem var(--gutter);
    margin-top: 5.5rem;
}

/* The research team runs the full width; consultants and the graphic team
   sit side by side beneath it. */
.team-group-full {
    grid-column: 1 / -1;
}

.team-group-title {
    margin-bottom: 0.75rem;
}

.team-members {
    font-size: var(--fs-body);
    line-height: 1.2;
}

/* Members flow down columns and balance across them, which is what gives the
   design its 2/2/2/1 distribution without hand-placing anyone. */
.team-group-full .team-members {
    columns: 4;
    column-gap: var(--gutter);
}

/* In the half-width groups the members stay in a single column of the same
   width as the four above, rather than spreading across the half. */
.team-group-half .team-members {
    max-width: var(--col);
}

.team-member {
    /* Keep a member's name, role and institution together in one column. */
    break-inside: avoid;
    display: flex;
    flex-direction: column;
}

.team-member-sep {
    margin-block: 0.9em;
    font-style: italic;
}

/* Set by team.js on the first member of each column after the first. */
.team-member.is-column-start .team-member-sep {
    display: none;
}

.team-member-name {
    align-self: flex-start;
    font-size: inherit;
    text-align: left;
}

button.team-member-name {
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.team-member-name.is-linked {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.team-member-name.is-linked:hover {
    color: var(--c-mint);
}

.team-member-role {
    font-style: italic;
}

.team-member-institution {
    margin-top: 1.1em;
    font-style: italic;
}

/* --- Biography card ----------------------------------------------------- */

.team-card {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--page-margin);
    background: rgba(23, 23, 23, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.team-card[hidden] {
    display: none;
}

.team-card-panel {
    position: relative;
    width: 100%;
    max-width: 1003px;
    max-height: 80vh;
    padding: 1.5rem 2.5rem 3.5rem;
    overflow-y: auto;
    border-radius: var(--radius-card);
    background: rgba(0, 0, 0, 0.7);
}

.team-card-body {
    font-size: var(--fs-body);
    line-height: 1.3;
}

.team-card-body p {
    margin: 0 0 1em;
}

.team-card-body p:last-child {
    margin-bottom: 0;
}

.team-card-close {
    display: block;
    width: 12px;
    height: 12px;
    margin: 2rem auto 0;
    color: var(--c-ink);
}

.team-card-close svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Narrow ------------------------------------------------------------- */

@media (max-width: 1100px) {
    .team-group-full .team-members {
        columns: 3;
    }
}

@media (max-width: 900px) {
    .team {
        padding-top: calc(var(--header-h) + 2.5rem);
    }

    .team-groups {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
        margin-top: 3rem;
    }

    .team-group-full .team-members {
        columns: 2;
    }

    .team-group-half .team-members {
        max-width: none;
    }

    .team-card-panel {
        max-height: 85vh;
        padding: 1.25rem 1.25rem 2.5rem;
    }
}

@media (max-width: 560px) {
    .team-group-full .team-members {
        columns: 1;
    }
}
