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

.team-card{
    background:#fff;
    padding:10px 10px 30px 10px;
    border-radius:12px;
    text-align:center;
    cursor:pointer;
    box-shadow: 0px 10px 30px rgba(238, 119, 37, 0.15);
    transform: translateY(5px);
    transition: all 0.4s ease;
}

.team-card:hover {
    transform: translateY(0px) scale(1);
}

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

.team-card h3{
    margin-top:20px;
    font-size:16px;
    font-family: "P22 Underground W01 Heavy", Sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #005577;
    letter-spacing:1px;
}

.team-card span{
    font-family: "Avenir Regular", Sans-serif;
    font-size:16px;
    line-height: 16px;
    font-weight: 600;
    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%;
    border-radius:16px;
    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: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    background: #EE7725;
    border-radius: 50%;
    color: #fff;
    z-index: 10;
    box-shadow: 0px 10px 25px rgba(237,119,37,0.3);
}

.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;
    align-items:flex-start;
}


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


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


/* NAME */
.team-popup-text h2{
    font-size:26px;
    letter-spacing:2px;
    color:#003b5c;
    margin-bottom:5px;
}


/* ROLE */
.team-popup-text h4{
    color:#f47c20;
    margin-bottom:20px;
    font-weight:600;
}


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

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

@media (max-width: 1024px){

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

    .team-card{
        padding: 12px;
    }

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

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

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

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

@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 h3{
        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;
    }
}