/* Team Section Balance Fix */

/* Center team members when there are only 2 */
.tm-wrapper .row {
    justify-content: center;
}

/* Ensure consistent height for team member cards */
.team-member {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Consistent image container height */
.team-member-photo {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect ratio */
    overflow: hidden;
    margin-bottom: 20px;
}

.team-member-photo .hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.team-member-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Ensure consistent spacing */
.tm-meta {
    margin-bottom: 20px;
    min-height: 60px; /* Ensure consistent height even with different title lengths */
}

.tm-bio {
    flex-grow: 1; /* Take up remaining space */
    display: flex;
    flex-direction: column;
}

.tm-bio p {
    margin-bottom: 0;
}

/* Specific fixes for 2-column layout */
@media (min-width: 768px) {
    .tm-wrapper .col-md-6:nth-child(1) {
        padding-right: 30px;
    }
    
    .tm-wrapper .col-md-6:nth-child(2) {
        padding-left: 30px;
    }
}

/* Center the two team members on larger screens */
@media (min-width: 992px) {
    .tm-wrapper .col-lg-3 {
        width: 33.333333%;
        max-width: 350px;
    }
}

/* Ensure equal height for bio sections */
.tm-bio {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Fix any overflow issues with long text */
.tm-bio p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Ensure social icons are properly centered */
.tm-social {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-overlay:hover .tm-social {
    opacity: 1;
}

/* Additional spacing adjustments */
.team-member {
    margin-bottom: 40px;
}

/* Fix for the specific image aspect ratios */
.team-member-photo img.portrait {
    object-position: center top;
}
