/* Container Layout */
.team-members-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Card Styles */
.team-member, .team-member:link, .team-member:visited {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
    padding: 0;
    text-decoration: none;
    color: #000;
    width: 280px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    height: 100%; /* Ensure all cards are the same height */
}

.team-member:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.team-member-img {
    width: 100%;
    position: relative;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
}

.team-member-img img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.team-member:hover .team-member-img img {
    transform: scale(1.03);
    transition: transform 0.3s ease;
}

/* Member Info */
.team-member-info {
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1; /* Allow info section to grow and fill space */
}

.team-member-designation {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.team-member-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .team-members-grid {
        gap: 20px;
    }

    .team-member,
    .team-member:link,
    .team-member:visited {
        width: calc(33.333% - 20px);
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .team-member,
    .team-member:link,
    .team-member:visited {
        width: calc(50% - 15px);
        min-width: 220px;
    }

    .team-member-img img {
        max-height: 200px;
    }

    .team-member-designation {
        font-size: 11px;
    }

    .team-member-name {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .team-members-grid {
        gap: 15px;
        padding: 15px;
    }

    .team-member,
    .team-member:link,
    .team-member:visited {
        width: 100%;
        max-width: 320px;
    }

    .team-member-img img {
        max-height: 180px;
    }

    .team-member-designation {
        font-size: 10px;
    }

    .team-member-name {
        font-size: 14px;
    }
}

/* Social Media Links */
.team-member-social {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.team-member-social h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    color: #495057;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.social-link i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
    font-size: 12px;
    line-height: 1;
}

.social-link:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    text-decoration: none;
    transform: translateY(-1px);
}

.social-link.phone:hover {
    background: #28a745;
    border-color: #28a745;
}

.social-link.email:hover {
    background: #dc3545;
    border-color: #dc3545;
}

.social-link.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.social-link.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.social-link.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.social-link.instagram:hover {
    background: #e4405f;
    border-color: #e4405f;
}

/* Rich Description Styling */
.team-member-rich-desc {
    margin-top: 15px;
    line-height: 1.6;
    color: #555;
}

.team-member-rich-desc p {
    margin-bottom: 10px;
}

.team-member-rich-desc ul,
.team-member-rich-desc ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.team-member-rich-desc h4,
.team-member-rich-desc h5,
.team-member-rich-desc h6 {
    margin: 15px 0 10px 0;
    color: #333;
}