/**
 * Team Styles - Hero + Thumbnails Layout
 * 
 * Single .team-member class that changes size based on container
 * - In #hero-container: large
 * - In #thumbnails-container: small thumbnail
 */

/* ============================================
   HERO CENTER - Container for active image
   ============================================ */
.team-hero__center {
    position: relative;
    width: 280px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .team-hero__center {
        width: 340px;
        height: 420px;
    }
}

@media (min-width: 1024px) {
    .team-hero__center {
        width: 400px;
        height: 500px;
    }
}

/* Glow effect behind active image */
.team-hero__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(255, 140, 50, 0.5) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TEAM MEMBER - Single element, two states
   ============================================ */
.team-member {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.team-member__image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
    z-index: 1;

    &:before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle,rgba(244, 242, 233, 0) 40%, rgba(0, 0, 0, 1) 85%);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        mix-blend-mode: hard-light;
        z-index: 8;
    }

    .image_overflow_bg:nth-child(0n+1) {
        background: linear-gradient(0deg, rgba(244,242,233,0) 10%, rgba(0,0,0,1) 100%);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        mix-blend-mode: hard-light;
    }
    .image_overflow_bg:nth-child(0n+2) {
        background: linear-gradient(90deg, rgba(244,242,233,0) 10%, rgba(0,0,0,1) 100%);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        mix-blend-mode: hard-light;
    }
    .image_overflow_bg:nth-child(0n+3) {
        background: linear-gradient(180deg, rgba(244,242,233,0) 10%, rgba(0,0,0,1) 100%);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        mix-blend-mode: hard-light;
    }
    .image_overflow_bg:nth-child(0n+4) {
        background: linear-gradient(270deg, rgba(244,242,233,0) 10%, rgba(0,0,0,1) 100%);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        mix-blend-mode: hard-light;
    }  
}

.team-member.is-active {

    .team-member__image {
         &:before {
            opacity: 1;
        }

        .image_overflow_bg:nth-child(0n+1) {
            opacity: 1;
        }
        .image_overflow_bg:nth-child(0n+2) {
            opacity: 1;
        }
        .image_overflow_bg:nth-child(0n+3) {
            opacity: 1;
        }
        .image_overflow_bg:nth-child(0n+4) {
            opacity: 1;
        }   
    }
}

/* ============================================
   STATE: In Hero Container (Active/Large)
   ============================================ */
#hero-container .team-member {
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: default;
}

#hero-container .team-member__image {
    filter: grayscale(0%);
}

/* ============================================
   STATE: In Thumbnails Container (Small)
   ============================================ */
#thumbnails-container .team-member {
    flex-shrink: 0;
    width: 100px;
    height: 130px;
}

@media (min-width: 768px) {
    #thumbnails-container .team-member {
        width: 120px;
        height: 155px;
    }
}

@media (min-width: 1024px) {
    #thumbnails-container .team-member {
        width: 180px;
        height: 220px;
    }
}

/* Grayscale for thumbnails */
#thumbnails-container .team-member__image {
    filter: grayscale(100%);
}

/* Hover effects on thumbnails */
#thumbnails-container .team-member:hover .team-member__image {
    filter: grayscale(30%);
    transform: scale(1.05);
}

/* ============================================
   THUMBNAILS ROW
   ============================================ */
.team-thumbnails {
    position: relative;
}

.team-thumbnails__row {
    min-height: 130px;
    padding: 1rem 0;

    &:before {
        background: linear-gradient(180deg, rgba(244,242,233,0) 50%, rgba(0,0,0,1) 80%);
    }
}

@media (min-width: 768px) {
    .team-thumbnails__row {
        min-height: 155px;
    }
}

@media (min-width: 1024px) {
    .team-thumbnails__row {
        min-height: 180px;
    }
}

/* ============================================
   MOBILE SWIPER CAROUSEL
   ============================================ */
.team-thumbnails__swiper {
    position: relative;
    padding: 1rem 0;
    overflow: visible;
}

.team-swiper {
    width: 100%;
    overflow: visible;
}

.team-swiper .swiper-wrapper {
    align-items: flex-start;
}

.team-swiper .swiper-slide {
    height: auto;
    display: flex;
    justify-content: center;
}

/* Team members in swiper slides */
.team-swiper .swiper-slide .team-member {
    flex-shrink: 0;
    width: 100px;
    height: 130px;
    cursor: pointer;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .team-swiper .swiper-slide .team-member {
        width: 120px;
        height: 155px;
    }
}

/* Apply same grayscale and hover effects as desktop thumbnails */
.team-swiper .swiper-slide .team-member__image {
    filter: grayscale(100%);
}

.team-swiper .swiper-slide .team-member:hover .team-member__image {
    filter: grayscale(30%);
    transform: scale(1.05);
}

/* ============================================
   INFO ELEMENTS
   ============================================ */
#active-name {
    line-height: 1.1;
    letter-spacing: 0.05em;
}

#active-job {
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1023px) {
    .team-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .team-hero__left,
    .team-hero__right {
        width: 100% !important;
    }
    
    .team-hero__center {
        order: -1;
        margin-bottom: 2rem;
    }
}

/* ============================================
   GSAP FLIP - Important for smooth animations
   ============================================ */
#hero-container,
#thumbnails-container {
    position: relative;
}