.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
    width: 100%;
}

.team-member-profile {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px 20px; /* Increased vertical padding to make tiles longer */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .team-member-profile .team-member-photo {
        width: 195px; /* 150 * 1.3 = 195 */
        height: 195px; /* 150 * 1.3 = 195 */
        border-radius: 50%;
        object-fit: cover;
        margin-bottom: 15px;
        border: 3px solid var(--color-primary);
    }

    .team-member-profile h2 {
        color: var(--color-primary);
        margin-bottom: 10px;
        text-shadow: 0px 0px 5px var(--shadow-color); /* Subtle text shadow for gradient effect */
    }

    .team-member-profile p {
        color: var(--color-primary);
        width: 97%;
        text-align: center;
        font-size: 1em;
        line-height: 1.5;
        text-shadow: 0px 0px 5px var(--shadow-color); /* Subtle text shadow for gradient effect */
    }

.team-member-linkedin-link {
    text-decoration: none;
}

.team-member-name-box {
    padding: 0px 15px;
    border: 2px solid var(--color-primary);
    border-radius: 15px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease;
}

    .team-member-name-box h2 {
        transition: color 0.3s ease;
    }

    .team-member-name-box .linkedin-icon {
        height: 28px;
        width: 0;
        fill: var(--color-primary);
        opacity: 0;
        transition: width 0.3s ease, opacity 0.3s ease, margin-left 0.3s ease, fill 0.3s ease;
        margin-left: 0;
    }

    .team-member-name-box:hover {
        border-color: var(--color-hover);
    }

 .team-member-name-box:hover h2 {
     color: var(--color-hover);
 }

 .team-member-name-box:hover .linkedin-icon {
     width: 28px;
     opacity: 1;
     margin-left: 10px;
     fill: var(--color-hover);
 }

.role-tag {
    display: flex;
    align-items: end;
    justify-content: center;
    color: var(--color-header);
    margin-top: 15px;
    font-family: var(--font-navigation);
    font-size: 0.9em;
    text-transform: uppercase;
    width: 80%;
}

/* --- Styles for Tablets (e.g., iPads) --- */
@media (min-width: 768px) and (max-width: 1368px) {
    .team-grid {
        display: grid;
        flex-wrap: wrap;
        gap: 1.5rem;
        width: 93%;
    }

    .team-member-profile p {
        font-size: 1.1em;
        text-align: left;
        line-height:1.8em;
    }

    .team-member-name-box h2 {
        font-size: 1.2em; /* Adjust name font size for tablets */
    }
    

    .team-member-name-box .linkedin-icon {
        width: 28px;
        opacity: 1;
        margin-left: 10px;
    }
    .role-tag {
        font-size: 0.8em;

    }
}

/* --- Styles for Mobile --- */
@media (max-width: 700px) {

    .team-grid {
        gap: 1rem;
        width: 90%;
    }

    .team-member-profile {
        padding: 20px 15px;
    }

    .team-member-profile .team-member-photo {
        width: 160px;
        height: 160px;
    }

    .team-member-profile p {
        font-size: 0.9em;
    }

    .role-tag {
        font-size: 0.8em;
    }

    .team-member-name-box .linkedin-icon {
        width: 25px;
        opacity: 1;
        margin-left: 10px;
    }
}
