﻿img {
    width: 100%;
}

.staff-card {
    background-color: #fafafa !important;
    box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.staff-card .moreInfo {
    color: #9c0001 !important;
}

.staff-card:hover {
    background-color: #d5b7b7 !important;
    cursor: pointer;
    transform: scale(1.1);
    z-index: 1;
    box-shadow: 10px 10px 10px rgba(0,0,0,0.4);
}
/* Disable hover effects and pointer cursor in list view */
.staff-directory.list-view .staff-card,
.staff-directory.list-view .staff-card:hover {
    background-color: #fafafa !important;
    transform: none !important;
    z-index: auto;
    cursor: default !important;
    transition: box-shadow 0.2s ease-in-out;
}


.staff-card:hover .moreInfo {
    color: #fafafa !important;
}

.box-shadow-zoom {
    box-shadow: 4px 4px 5px rgba(0,0,0,0.4);
    transition: transform .2s;
    transition: box-shadow 0.2s ease-in-out;
}

img.box-shadow-zoom {
    width: 100%;
}

.box-shadow-zoom:hover {
    cursor: pointer;
    transform: scale(1.1);
    z-index: 1;
    box-shadow: 10px 10px 10px rgba(0,0,0,0.4);
}

.moreInfo {
    display: none;
}

.staff-contact [hidden],
#staffModalPhoneRow[hidden],
#staffModalEmailRow[hidden] {
    display: none !important;
}


/* ========================================
   VIEW TOGGLE
======================================== */

.staff-view-controls .btn.active {
    background-color: #495057;
    color: #fff;
}

/* ========================================
   CARD VIEW (DEFAULT)
======================================== */

.staff-directory .staff-card {
    height: 100%;
    cursor: pointer;
}

.staff-directory .staff-card .staff-image {
    max-width: 100%;
    height: auto;
}

/* ========================================
   LIST VIEW
======================================== */

.staff-directory.list-view .staff-col {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}

.staff-directory.list-view .staff-card {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    align-items: stretch;
    text-align: left !important;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.staff-directory.list-view .staff-card > h5 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    text-align: left;
}

.staff-directory.list-view .staff-card > .staff-image {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    align-self: stretch;
}

.staff-directory.list-view .staff-card > .row {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    justify-content: flex-start !important;
    text-align: left !important;
}

.staff-directory.list-view .staff-card .staff-contact {
    text-align: left;
}

.staff-directory.list-view .staff-card .staff-list-bio {
    grid-column: 2;
    grid-row: 3;
    margin-top: 0.25rem;
}

.staff-directory.list-view .staff-card .staff-list-bio p:last-child {
    margin-bottom: 0;
}

/* Keep the hidden source biography hidden. */
.staff-directory .staff-bio {
    display: none !important;
}

/* ========================================
   MOBILE LIST VIEW
======================================== */

@media (max-width: 575.98px) {
    .staff-directory.list-view .staff-card {
        grid-template-columns: 100px minmax(0, 1fr);
        column-gap: 0.75rem;
        padding: 0.75rem;
    }

        .staff-directory.list-view .staff-card > .staff-image {
            max-width: 100px;
        }

        .staff-directory.list-view .staff-card > h5 {
            font-size: 1rem;
        }

        .staff-directory.list-view .staff-card .staff-list-bio {
            font-size: 0.9rem;
        }
}
/* Hide More Info in list view */
.staff-directory.list-view .moreInfo {
    display: none !important;
}

/* Hide the list biography in card view */
.staff-directory:not(.list-view) .staff-list-bio {
    display: none !important;
}

/* Show the biography only in list view */
.staff-directory.list-view .staff-list-bio {
    display: block;
}

@media (max-width: 575.98px) {
    .staff-directory.list-view .staff-card {
        grid-template-columns: 120px minmax(0, 1fr);
    }
}
/* Larger name and title in list view */
.staff-directory.list-view .staff-card > h5 {
    font-size: 1.5rem;
    line-height: 1.3;
}

.staff-directory.list-view .staff-card > h5 small {
    display: block;
    font-size: 1.1rem;
    margin-top: 0.25rem;
    color: #555;
}
.staff-directory.list-view .staff-card,
.staff-directory.list-view .staff-card:hover {
    box-shadow: none !important;
}
    /* No hover effects in list view */
    .staff-directory.list-view .staff-card:hover {
        border: none !important;
        border-bottom: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        background-color: transparent !important;
        transform: none !important;
    }
/* Remove all card styling in list view */
.staff-directory.list-view .staff-col,
.staff-directory.list-view .staff-card,
.staff-directory.list-view .staff-card:hover {
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    transform: none !important;
}

/* Keep only a subtle bottom divider */
.staff-directory.list-view .staff-card {
    border-bottom: 1px solid #dee2e6 !important;
}

/* Prevent focus outlines if cards receive focus */
.staff-directory.list-view .staff-card:focus,
.staff-directory.list-view .staff-card:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
    .staff-directory.list-view .staff-card,
    .staff-directory.list-view .staff-card:hover {
        border: none !important;
        border-bottom: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
    }
/* Slightly larger names in card view */
.staff-directory:not(.list-view) .staff-card > h5 {
    font-size: 1.25rem;
    line-height: 1.4;
}

    /* Slightly larger job titles in card view */
    .staff-directory:not(.list-view) .staff-card > h5 small {
        font-size: 1rem;
        display: inline-block;
        margin-top: 0.2rem;
    }
/* ========================================
   STAFF CARD VIEW: TEXT AND IMAGE ALIGNMENT
   ======================================== */

/* Keep the card content inside its own width */
.staff-directory:not(.list-view) .staff-card {
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    padding: 12px;
}

    /* Reserve the same vertical space for names and titles */
    .staff-directory:not(.list-view) .staff-card > h5 {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 4.5em;
        min-height: 4.5em;
        box-sizing: border-box;
        margin: 0 0 1px;
        padding: 0;
        line-height: 1.4;
        overflow: hidden;
        text-align: center;
    }

        /* Hide the old HTML line break without editing every page */
        .staff-directory:not(.list-view) .staff-card > h5 br {
            display: none;
        }

    /* Names must have a measurable width for JavaScript resizing */
    .staff-directory:not(.list-view) .staff-card .staff-name {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex: 0 0 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        font-size: 1em;
        line-height: 1.4;
        text-align: center;
    }

    /* Titles are resized independently from names */
    .staff-directory:not(.list-view) .staff-card .staff-title {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex: 0 0 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        font-size: 0.8em;
        font-weight: normal;
        line-height: 1.4;
        text-align: center;
        margin: 0;
    }

    /* Portrait staff photos: 4:5 aspect ratio */
    .staff-directory:not(.list-view) .staff-card > .staff-image {
        display: block;
        width: 100%;
        max-width: 250px;
        aspect-ratio: 4 / 5;
        height: auto;
        object-fit: cover;
        margin: 0 auto 15px;
    }

/* ========================================
   LIST VIEW: RESTORE NORMAL TEXT SIZING
   ======================================== */

.staff-directory.list-view .staff-card > h5 {
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    text-align: left;
}

.staff-directory.list-view .staff-card .staff-name {
    display: inline;
    width: auto;
    max-width: none;
    overflow: visible;
    white-space: normal;
    font-size: inherit;
    text-align: left;
}

.staff-directory.list-view .staff-card .staff-title {
    display: block;
    width: auto;
    max-width: none;
    overflow: visible;
    white-space: normal;
    font-size: 1.1rem;
    text-align: left;
    margin-top: 0.25rem;
}

/* Keep list-view image sizing controlled by your grid layout */
.staff-directory.list-view .staff-card > .staff-image {
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    object-fit: cover;
}