/* 
 * Team Module Styles with Viewport-Relative Scaling
 * Provides three layout options: grid, carousel, and profiles
 */

.team-module {
    padding: calc(var(--current-scale) * (4vw + 2vh)) 0;
    position: relative;
    overflow: hidden;
}

.team-container {
    width: var(--container-width);
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 calc(var(--current-scale) * (0.9375vw + 0.46875vh));
}

/* Header Styles */
.team-header {
    text-align: center;
    margin-bottom: calc(var(--current-scale) * (3vw + 1.5vh));
}

.team-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: calc(var(--current-scale) * (0.05vw + 0.025vh));
    margin-bottom: calc(var(--current-scale) * (0.5vw + 0.25vh));
    font-weight: 600;
}

.team-title {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin-bottom: calc(var(--current-scale) * (1vw + 0.5vh));
    line-height: var(--line-height-tight, 1.3);
    font-weight: 600;
}

.team-description {
    font-size: var(--font-size-md);
    color: var(--text-muted);
    max-width: calc(var(--current-scale) * (50vw));
    margin: 0 auto;
    line-height: var(--line-height-normal, 1.6);
}

/* Common Team Member Styles */
.team-member {
    background: var(--bg-light);
    border-radius: calc(var(--current-scale) * (0.75vw + 0.375vh));
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.member-image-container {
    position: relative;
    overflow: hidden;
}

.member-image-wrapper {
    width: 100%;
    height: 0;
    padding-top: 100%; /* 1:1 Aspect ratio */
    position: relative;
    overflow: hidden;
}

.member-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-member:hover .member-image-wrapper img {
    transform: scale(1.05);
}

.member-info {
    padding: calc(var(--current-scale) * (1.5vw + 0.75vh));
}

.member-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: calc(var(--current-scale) * (0.4vw + 0.2vh));
    color: var(--text-dark);
}

.member-title {
    font-size: var(--font-size-sm);
    color: var(--primary);
    margin-bottom: calc(var(--current-scale) * (1vw + 0.5vh));
    font-weight: 500;
}

.member-bio {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: calc(var(--current-scale) * (1vw + 0.5vh));
}

.member-social-links {
    display: flex;
    gap: calc(var(--current-scale) * (0.5vw + 0.25vh));
}

.member-social-links .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--current-scale) * (2vw + 1vh));
    height: calc(var(--current-scale) * (2vw + 1vh));
    background-color: var(--neutral-200);
    color: var(--primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.member-social-links .social-link:hover {
    background-color: var(--primary);
    color: var(--text-light);
}

/* Highlighted Member */
.team-member.highlighted {
    border: calc(var(--current-scale) * (0.15vw + 0.075vh)) solid var(--primary);
    box-shadow: var(--shadow-lg);
}

/* Card Style Variations */
.team-style-cards .team-member {
    box-shadow: var(--shadow-md);
}

.team-style-cards .team-member:hover {
    transform: translateY(calc(var(--current-scale) * (-0.5vw + -0.25vh)));
    box-shadow: var(--shadow-lg);
}

/* Minimal Style Variations */
.team-style-minimal .team-member {
    box-shadow: none;
    background: transparent;
}

.team-style-minimal .member-image-wrapper {
    border-radius: 50%;
    width: 80%;
    padding-top: 80%;
    margin: 0 auto;
    border: calc(var(--current-scale) * (0.3vw + 0.15vh)) solid rgba(189, 39, 58, 0.1);
}

.team-style-minimal .member-info {
    text-align: center;
}

.team-style-minimal .member-social-links {
    justify-content: center;
}

/* Photo Focus Style Variations */
.team-style-photo-focus .member-image-wrapper {
    padding-top: 130%; /* Taller image area */
}

.team-style-photo-focus .member-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--text-light);
    padding: calc(var(--current-scale) * (2vw + 1vh)) calc(var(--current-scale) * (1.5vw + 0.75vh)) calc(var(--current-scale) * (1.5vw + 0.75vh));
}

.team-style-photo-focus .member-name {
    color: var(--text-light);
}

.team-style-photo-focus .member-title {
    color: var(--primary-light);
}

.team-style-photo-focus .member-bio {
    color: var(--neutral-300);
    font-size: var(--font-size-xs);
}

.team-style-photo-focus .member-social-links .social-link {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.team-style-photo-focus .member-social-links {
    margin-top: calc(var(--current-scale) * (1vw + 0.5vh));
}

/* Grid Layout Styles */
.team-grid {
    display: grid;
    gap: calc(var(--current-scale) * (2vw + 1vh));
}

.team-columns-1 .team-grid {
    grid-template-columns: 1fr;
}

.team-columns-2 .team-grid {
    grid-template-columns: repeat(2, 1fr);
}

.team-columns-3 .team-grid {
    grid-template-columns: repeat(3, 1fr);
}

.team-columns-4 .team-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Social links position for grid - photo-focus style */
.team-style-photo-focus .team-grid .member-social-links {
    position: absolute;
    bottom: calc(var(--current-scale) * (1.5vw + 0.75vh));
    right: calc(var(--current-scale) * (1.5vw + 0.75vh));
}

/* Carousel Layout Styles */
.team-carousel-wrapper {
    position: relative;
    padding: calc(var(--current-scale) * (2vw + 1vh)) 0;
}

.team-carousel {
    overflow: hidden;
}

.team-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.team-carousel .team-member {
    flex: 0 0 100%;
    padding: calc(var(--current-scale) * (1vw + 0.5vh));
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.team-carousel .team-member.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    height: auto;
}

.team-style-cards .team-carousel .team-member {
    flex-direction: row;
    align-items: center;
}

.team-style-cards .team-carousel .member-image-container {
    flex: 0 0 40%;
}

.team-style-cards .team-carousel .member-info {
    flex: 0 0 60%;
    padding: calc(var(--current-scale) * (2vw + 1vh));
}

.team-carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: calc(var(--current-scale) * (2vw + 1vh));
}

.team-carousel-prev,
.team-carousel-next {
    background: var(--primary);
    border: none;
    color: var(--text-light);
    width: calc(var(--current-scale) * (2.5vw + 1.25vh));
    height: calc(var(--current-scale) * (2.5vw + 1.25vh));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    margin: 0 calc(var(--current-scale) * (0.75vw + 0.375vh));
}

.team-carousel-prev:hover,
.team-carousel-next:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.team-carousel-prev svg,
.team-carousel-next svg {
    width: calc(var(--current-scale) * (1.5vw + 0.75vh));
    height: calc(var(--current-scale) * (1.5vw + 0.75vh));
}

.team-carousel-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-carousel-pagination-bullet {
    width: calc(var(--current-scale) * (0.5vw + 0.25vh));
    height: calc(var(--current-scale) * (0.5vw + 0.25vh));
    background-color: var(--neutral-400);
    border-radius: 50%;
    margin: 0 calc(var(--current-scale) * (0.25vw + 0.125vh));
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}

.team-carousel-pagination-bullet.active {
    width: calc(var(--current-scale) * (1.5vw + 0.75vh));
    background-color: var(--primary);
    border-radius: calc(var(--current-scale) * (0.25vw + 0.125vh));
}

/* Profiles Layout Styles */
.team-profiles {
    display: flex;
    gap: calc(var(--current-scale) * (2vw + 1vh));
    margin-top: calc(var(--current-scale) * (2vw + 1vh));
}

.profiles-navigation {
    flex: 0 0 30%;
    border-right: 1px solid var(--neutral-300);
    padding-right: calc(var(--current-scale) * (2vw + 1vh));
}

.profile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    padding: calc(var(--current-scale) * (1vw + 0.5vh));
    margin-bottom: calc(var(--current-scale) * (1vw + 0.5vh));
    border-radius: calc(var(--current-scale) * (0.5vw + 0.25vh));
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.profile-nav-item:hover,
.profile-nav-item.active {
    background-color: rgba(189, 39, 58, 0.1);
}

.profile-nav-image {
    width: calc(var(--current-scale) * (3vw + 1.5vh));
    height: calc(var(--current-scale) * (3vw + 1.5vh));
    border-radius: 50%;
    overflow: hidden;
    margin-right: calc(var(--current-scale) * (1vw + 0.5vh));
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.profile-nav-item:hover .profile-nav-image,
.profile-nav-item.active .profile-nav-image {
    border-color: var(--primary);
}

.profile-nav-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-nav-info {
    display: flex;
    flex-direction: column;
}

.profile-nav-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: var(--font-size-sm);
}

.profile-nav-title {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.profiles-content {
    flex: 0 0 70%;
    position: relative;
}

.profile-detail {
    display: flex;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    height: 0;
    overflow: hidden;
    gap: calc(var(--current-scale) * (2vw + 1vh));
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.profile-detail.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    height: auto;
}

.profile-image {
    flex: 0 0 40%;
    border-radius: calc(var(--current-scale) * (0.5vw + 0.25vh));
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: auto;
    display: block;
}

.profile-info {
    flex: 0 0 60%;
}

.profile-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: calc(var(--current-scale) * (0.5vw + 0.25vh));
    color: var(--text-dark);
}

.profile-title {
    font-size: var(--font-size-md);
    color: var(--primary);
    margin-bottom: calc(var(--current-scale) * (1vw + 0.5vh));
    font-weight: 500;
}

.profile-bio {
    font-size: var(--font-size-md);
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: calc(var(--current-scale) * (1.5vw + 0.75vh));
}

.profile-social-links {
    display: flex;
    gap: calc(var(--current-scale) * (0.5vw + 0.25vh));
}

.profile-social-links .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--current-scale) * (2.5vw + 1.25vh));
    height: calc(var(--current-scale) * (2.5vw + 1.25vh));
    background-color: var(--neutral-200);
    color: var(--primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.profile-social-links .social-link:hover {
    background-color: var(--primary);
    color: var(--text-light);
}

/* Animation for team members */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.team-grid .team-member {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .team-columns-3 .team-grid,
    .team-columns-4 .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-description {
        max-width: calc(var(--current-scale) * (70vw));
    }
    
    .team-profiles {
        flex-direction: column;
    }
    
    .profiles-navigation {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid var(--neutral-300);
        padding-right: 0;
        padding-bottom: calc(var(--current-scale) * (2vw + 1vh));
    }
    
    .profile-nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: calc(var(--current-scale) * (1vw + 0.5vh));
    }
    
    .profile-nav-item {
        flex: 0 0 calc(50% - calc(var(--current-scale) * (1vw + 0.5vh)));
    }
    
    .profiles-content {
        flex: 0 0 100%;
        margin-top: calc(var(--current-scale) * (2vw + 1vh));
    }
}

@media (max-width: 768px) {
    .team-title {
        font-size: calc(var(--font-size-xl) * 0.85);
    }
    
    .team-description {
        max-width: calc(var(--current-scale) * (90vw));
        font-size: var(--font-size-base);
    }
    
    .team-columns-2 .team-grid,
    .team-columns-3 .team-grid,
    .team-columns-4 .team-grid {
        grid-template-columns: 1fr;
    }
    
    .team-style-cards .team-carousel .team-member {
        flex-direction: column;
    }
    
    .team-style-cards .team-carousel .member-image-container,
    .team-style-cards .team-carousel .member-info {
        flex: 0 0 100%;
    }
    
    .team-style-cards .team-carousel .member-info {
        padding: calc(var(--current-scale) * (1.5vw + 0.75vh));
    }
    
    .profile-detail {
        flex-direction: column;
    }
    
    .profile-image,
    .profile-info {
        flex: 0 0 100%;
    }
    
    .profile-image {
        margin-bottom: calc(var(--current-scale) * (1.5vw + 0.75vh));
    }
    
    .profile-nav-item {
        flex: 0 0 100%;
    }
    
    .member-name {
        font-size: var(--font-size-md);
    }
}

@media (max-width: 480px) {
    .team-module {
        padding: calc(var(--current-scale) * (3vw + 1.5vh)) 0;
    }
    
    .member-image-wrapper {
        padding-top: 75%; /* 4:3 Aspect ratio for mobile */
    }
    
    .team-style-minimal .member-image-wrapper {
        width: 60%;
        padding-top: 60%;
    }
}