/* GRID FIX */
.team-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:30px;
}

.team-grid.team-grid-small {
    gap: 10px;
    margin: 0px 100px;
}

.team-card{
    background:#fff;
    padding:10px 10px 30px 10px;
    text-align:center;
    cursor:pointer;
}

.team-img {
    position: relative;
    overflow: hidden;
}

/* Overlay only on image */
.team-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(96,94,94,0.52);
    opacity: 0;
    transition: 0.3s ease;
}

/* Show overlay ONLY when image hovered */
.team-img:hover::after {
    opacity: 1;
}

/* Zoom effect only image */

.team-card img{
    width:100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.team-card h4 {
    margin-top: 20px;
    font-family: "P22 Underground W01 Heavy", Sans-serif !important;
    font-size: 16px;
    font-weight: 600;
    color: #005577;
    letter-spacing: 1px;
    text-transform: capitalize !important;
    line-height: 15px;
}

.team-card span {
    font-family: "Avenir Regular", Sans-serif;
    font-size: 14px;
    line-height: 16px;
    color: #EE7725;
}


/* POPUP OVERLAY */
.team-popup-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);

    display:flex; /* ✅ always flex */
    align-items:center;
    justify-content:center;

    z-index:9999;
    padding:20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* ✅ prevent click when hidden */

    transition: opacity 0.3s ease;
}

.team-popup-overlay.active{
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* ✅ enable click */
}


/* POPUP BOX */
.team-popup-content{
    background:#f5f5f5;
    max-width:1000px;
    width:100%;
    padding:50px 60px;
    position:relative;

    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.35s ease;
}

.team-popup-overlay.active .team-popup-content{
    transform: scale(1) translateY(0);
    opacity: 1;
}


/* CLOSE BUTTON */
.team-close {
    position: absolute;
    right: 40px;
    top: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    cursor: pointer;
    color: #303030;
    z-index: 10;
}
/*.team-close:hover {
    background: #005577;
    box-shadow: 0px 10px 30px 0px rgba(0,0,0,0.5) !important;
}*/

/* LAYOUT FIX */
.team-popup-inner {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
}

p#pBio {
    margin-top: 20px;
    color: #303030;
}

/* IMAGE FIX (IMPORTANT) */
.team-popup-inner img{
    width:140px;
    height:180px; /* ✅ fixed height */
    object-fit:cover; /* ✅ prevent stretch */
}


/* TEXT ALIGNMENT FIX */
.team-popup-text{
    flex:1;
    text-align:left;
}


/* NAME */
.team-popup-text h2{
    font-family: "Avenir Regular", Sans-serif !important;
    font-weight:400;
    font-size:26px;
    letter-spacing:2px;
    color:#003b5c;
    margin-bottom:5px;
}


/* ROLE */
.team-popup-text h4{
    font-family: "Avenir Regular", Sans-serif !important;
    font-weight:400;
    color:#f47c20;
    margin-bottom:20px;
}


/* BIO */
.team-popup-text p {
    color: #333;
    line-height: 1.8;
    margin-bottom: 15px;
}

/*.team-card h4::after{
    content: "";
    display: block;
    width: 23px;
    height: 2px;
    background: #005577;
    margin: 8px auto 10px;
}*/


@media (min-width: 768px) and (max-width: 1024px){

    .team-grid{
        grid-template-columns: repeat(4, 1fr); /* 2 columns */
        gap: 25px;
    }

    .team-card{
        padding: 12px;
    }

    .team-card h4{
        font-size: 16px;
    }

    /* Popup */
    .team-popup-content{
        padding: 40px 30px;
    }

    .team-popup-inner{
        gap: 25px;
    }

    .team-popup-inner img{
        width: 120px;
        height: 160px;
    }

    .team-grid.team-grid-small {
        gap: 30px;
        margin: 0px 50px;
    }
}

@media (max-width: 767px){

    /* GRID */
    .team-grid{
        grid-template-columns: 1fr; /* 1 column */
        gap: 20px;
    }

    .team-card{
        padding: 12px;
    }

    .team-card img{
        aspect-ratio: 3/4;
    }

    .team-card h4{
        font-size: 15px;
    }

    .team-card span{
        font-size: 12px;
    }

    /* POPUP */
    .team-popup-content{
        padding: 25px 20px;
        max-height: 90vh;
        overflow-y: auto; /* ✅ scroll popup */
    }

    .team-popup-inner{
        flex-direction: column; /* ✅ stack layout */
        align-items: center;
        text-align: center;
    }

    .team-popup-inner img{
        width: 120px;
        height: 150px;
        margin-bottom: 15px;
    }

    .team-popup-text{
        text-align: center; /* ✅ center on mobile */
    }

    .team-popup-text h2{
        font-size: 20px;
    }

    .team-popup-text h4{
        font-size: 14px;
    }

    .team-popup-text p{
        font-size: 14px;
        line-height: 1.6;
    }

    /* CLOSE BUTTON */
    .team-close{
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }

    .team-grid.team-grid-small {
        gap: 30px;
        margin: 0px;
    }

}


