/* ==========================================================================
   Team Grid
   ========================================================================== */

.team-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
}

.team-grid__person {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
}

.team-grid__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-grid__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 39, 94, 0.88);
    opacity: 0;
    transition: opacity 200ms ease;
}

.team-grid__name {
    color: #fff;
    text-align: center;
}

.team-grid__person:hover .team-grid__overlay,
.team-grid__person:focus-visible .team-grid__overlay {
    opacity: 1;
}

.team-grid__person:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: -3px;
}


/* ==========================================================================
   Team Modal: Base
   ========================================================================== */

body.team-modal-open {
    overflow: hidden;
}

body.team-modal-open #main-site-header {
    z-index: 1 !important;
}

body.team-modal-open footer.et-l.et-l--footer {
    position: relative;
    z-index: 0 !important;
}

.team-modal[hidden] {
    display: none;
}

.team-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 300ms ease,
        visibility 300ms ease;
}

.team-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 300ms ease;
}

.team-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.team-modal.is-open .team-modal__backdrop {
    opacity: 1;
}

.team-modal.is-open .team-modal__dialog {
    opacity: 1;
    transform: translateY(0);
}

.team-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 90vh;
    margin-top: 4em;
    overflow-y: auto;
    background: #fff;
    opacity: 0;
    transform: translateY(60px);
    transition:
        transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 300ms ease;
}

.team-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

.team-modal__close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.team-modal__content {
    padding: 30px;
}


/* ==========================================================================
   Team Modal: Profile
   ========================================================================== */

.team-modal__profile {
    display: grid;
    grid-template-columns: minmax(320px, 38%) minmax(0, 1fr);
}

.team-modal__sidebar,
.team-modal__main {
    min-width: 0;
}

.team-modal__portrait-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.team-modal__portrait {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.team-modal__sidebar-content {
    padding: 2rem 0.9rem 2.5rem 2.5rem;
}

.team-modal__main {
    padding: clamp(3.5rem, 6vw, 7rem);
}

.team-modal__header {
    margin-bottom: 1em;
    padding-right: 3rem;
}

.team-modal__title {
    margin: 0;
    padding-bottom: 0;
    font-weight: 500;
}

.team-modal__position {
    margin: 0.5rem 0 0;
    font-weight: 500;
}

.team-modal__bio {
    max-width: 70ch;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.team-modal__bio > :first-child {
    margin-top: 0;
}

.team-modal__bio > :last-child {
    margin-bottom: 0;
}


/* ==========================================================================
   Team Modal: Secondary Information
   ========================================================================== */

.team-modal__information-group {
    margin: 0 0 0.75rem;
    line-height: 1.35;
}

.team-modal__information-group + .team-modal__information-group {
    margin-top: 0.15rem;
}

.team-modal__information-group h3 {
    display: inline;
    margin: 0;
    font: inherit;
    font-weight: 600;
}

.team-modal__information-group h3::after {
    content: ": ";
}

.team-modal__information-group ul,
.team-modal__information-group div {
    display: inline;
    margin: 0;
    padding: 0;
    list-style: none;
}

.team-modal__information-group li {
    display: inline;
    margin: 0;
}

.team-modal__education li + li::before,
.team-modal__registrations li + li::before {
    content: ", ";
}

.team-modal__organizations {
    white-space: pre-line;
}

.team-modal__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-top: 2.5rem;
}

.team-modal__email:not([hidden]),
.team-modal__linkedin:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}


/* ==========================================================================
   Team Modal: Featured Projects
   ========================================================================== */

.team-modal__projects {
    margin-top: clamp(3rem, 6vw, 5rem);
}

.team-modal__projects[hidden] {
    display: none !important;
}

.team-modal__projects > h3 {
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.team-modal__projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 0.5rem;
}

.team-modal__project {
    display: block;
    color: inherit;
    text-decoration: none;
}

.team-modal__project-image-wrapper {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.team-modal__project-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 250ms ease;
}

.team-modal__project-title {
    display: block;
    margin-top: 0.75rem;
    line-height: 1.2;
}

.team-modal__project:hover .team-modal__project-image,
.team-modal__project:focus-visible .team-modal__project-image {
    transform: scale(1.03);
}

.team-modal__project:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}


/* ==========================================================================
   Team Modal: Navigation
   ========================================================================== */

.team-modal__navigation {
    padding: clamp(1.5rem, 3vw, 3rem);
    background: #fff;
}

.team-modal__navigation-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
}

.team-modal__navigation-viewport {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.team-modal__navigation-viewport::-webkit-scrollbar {
    display: none;
}

.team-modal__navigation-thumbnails {
    display: flex;
    gap: 0;
    width: max-content;
    min-width: 100%;
}

.team-modal__navigation-button {
    position: relative;
    flex: 0 0 clamp(65px, 7vw, 105px);
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: #ddd;
    opacity: 0.3;
    cursor: pointer;
    transition:
        opacity 200ms ease,
        transform 200ms ease;
}

.team-modal__navigation-button:hover,
.team-modal__navigation-button:focus-visible,
.team-modal__navigation-button.is-active {
    opacity: 1;
}

.team-modal__navigation-button:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.team-modal__navigation-thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.team-modal__navigation-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.5rem;
}

.team-modal__navigation-arrow {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(44px, 4vw, 60px);
    padding: 0;
    border: 0;
    background: #fff;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.team-modal__navigation-arrow:hover,
.team-modal__navigation-arrow:focus-visible {
    background: #f0f0f0;
}

.team-modal__navigation-arrow:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: -3px;
}

.team-modal__navigation-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.team-modal__navigation-arrow[hidden] {
    display: none !important;
}

.team-modal__navigation-progress {
    position: relative;
    width: 100%;
    height: 4px;
    margin-top: 1.25rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.team-modal__navigation-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: #00275e;
    transition: width 300ms ease;
}


/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1100px) {
    .team-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .team-modal__profile {
        grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
    }

    .team-modal__main {
        padding: 4rem 3rem;
    }
}

@media (max-width: 900px) {
    .team-modal__projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .team-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .team-modal__dialog {
        width: 100%;
        height: 100%;
        max-height: none;
    }

    .team-modal__content {
        padding: 30px 0;
    }

    .team-modal__profile {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    /*
     * Flatten the desktop wrappers so their children can be reordered
     * within the mobile profile grid.
     */
    .team-modal__sidebar,
    .team-modal__main {
        display: contents;
    }

    .team-modal__portrait-wrapper {
        order: 1;
        aspect-ratio: 4 / 5;
        max-height: 75vh;
    }

    .team-modal__portrait {
        min-height: 0;
    }

    .team-modal__header {
        order: 2;
        margin: 0;
        padding: 2.5rem 1.5rem 0;
    }

    .team-modal__bio {
        order: 3;
        max-width: none;
        margin: 0;
        padding: 1.5rem 1.5rem 0;
    }

    .team-modal__sidebar-content {
        order: 4;
        padding: 2rem 1.5rem 0;
    }

    .team-modal__projects {
        order: 5;
        margin: 0;
        padding: 3rem 1.5rem 0;
    }

    .team-modal__close {
        position: fixed;
        top: 0.75rem;
        right: 0.75rem;
    }

    .team-modal__navigation {
        padding: 1.25rem;
    }

    .team-modal__navigation-button {
        flex-basis: 72px;
    }
}

@media (max-width: 479px) {
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-modal,
    .team-modal__backdrop,
    .team-modal__dialog,
    .team-modal__project-image,
    .team-grid__overlay,
    .team-modal__navigation-button,
    .team-modal__navigation-progress-bar {
        transition: none;
    }
}

.team-stats {
    color: #fff !important;
    font-size: clamp(1.25rem, 2vw, 1.75rem) !important;
}
