/* CSS for Shared Team Component */

:root {
    --team-accent: #e87d52;
    /* Terracotta */
    --team-bg: #0a0a0a;
    --team-text: #f5f5f5;
    --team-text-muted: #a0a0a0;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
}

.team-component-container {
    padding: 6rem 2rem;
    background-color: var(--team-bg);
    color: var(--team-text);
    text-align: center;
}

.team-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--team-text);
}

.team-intro {
    font-size: 1.1rem;
    color: var(--team-text-muted);
    margin-bottom: 4rem;
    font-weight: 300;
}

/* Common separator style */
.team-component-container .separator-center {
    width: 60px;
    height: 2px;
    background-color: var(--team-accent);
    margin: 1rem auto 2rem auto;
}

/* Display Modes */
/* Default is carousel-ready, but we use JS to toggle classes */

.team-display-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.team-scroll-container {
    overflow: hidden;
    width: 100%;
}

.team-members-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease-in-out;
    scroll-behavior: smooth;
    align-items: stretch;
}

/* CARD STYLES */
.team-member-card {
    flex: 0 0 100%;
    /* Default mobile: 1 per view */
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.team-member-card:hover {
    transform: translateY(-10px);
    background: var(--card-hover-bg);
    border-color: rgba(232, 125, 82, 0.3);
}

.member-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.member-image {
    width: 100%;
    height: 350px;
    background-color: #1a1a1a;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.team-member-card:hover .member-image img {
    filter: grayscale(0%);
}

.member-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Ocupa tot l'espai vertical disponible */
}

.member-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--team-text);
}

.member-role {
    font-size: 0.9rem;
    color: var(--team-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.member-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 70px;
    /* Alçada suficient per a 2-3 línies, assegura alineació total */
    align-content: flex-start;
}

.member-specialties .specialty {
    font-size: 0.75rem;
    background: rgba(232, 125, 82, 0.1);
    color: var(--team-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
}

.member-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--team-text-muted);
    margin-bottom: 1.5rem;
    /* Igual que a la Home */
    font-weight: 300;
    flex-grow: 1;
    /* Empeny el botó cap avall */
}

.cta-member {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--team-accent);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.team-member-card:hover .cta-member {
    border-bottom: 1px solid var(--team-accent);
    padding-left: 5px;
    gap: 10px;
}

/* CAROUSEL CONTROLS */
.carousel-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: var(--team-accent);
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--team-accent);
    transform: scale(1.3);
}

/* GRID MODE (When class .is-grid is applied to #teamDisplayWrapper) */
.is-grid .team-members-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    width: 100%;
}

.is-grid .team-member-card {
    flex: none;
}

.is-grid .carousel-nav,
.is-grid .carousel-indicators {
    display: none !important;
}

/* RESPONSIVE BREAKPOINTS for Carousel */
@media (min-width: 768px) {
    .team-member-card {
        flex: 0 0 calc(50% - 1rem);
        /* 2 items on tablet */
    }
}

@media (min-width: 1100px) {
    .team-member-card {
        flex: 0 0 calc(33.333% - 1.34rem);
        /* 3 items on desktop */
    }
}

@media (max-width: 600px) {
    .team-header h2 {
        font-size: 2rem;
    }

    .carousel-nav {
        display: none;
        /* Hide buttons on mobile, use touch scroll */
    }

    .team-scroll-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .team-member-card {
        scroll-snap-align: center;
    }

    .team-component-container {
        padding: 4rem 1rem;
    }
}