:root {
    --card-bg-595: #ffffff;
    --card-border-595: #E5DEC8;
    --card-radius-595: 16px;
    --photo-size-595: 120px;
    --dot-inactive-595: #D3D1C7;
    --font-serif-595: Georgia, 'Times New Roman', serif;
    --font-sans-595: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Default Theme Variables (Fallback) */
    --theme-main-color: #1D3557;
    --theme-accent-color: #E0952D;
    --theme-text-color: #6b7280;
    --theme-tag-bg: #FDF6F0;
    --theme-tag-text: #E0952D;
    --theme-arrow-hover: #627084;
}

/* Color Themes - Higher Specificity to override Elementor globals */
.team-section-595.theme-blue {
    --theme-main-color: #1D3557 !important;
    --theme-accent-color: #E0952D !important;
    --theme-text-color: #6b7280 !important;
    --theme-tag-bg: #FDF6F0 !important;
    --theme-tag-text: #E0952D !important;
    --theme-arrow-hover: #627084 !important;
}

.team-section-595.theme-gray {
    --theme-main-color: #627084 !important;
    --theme-accent-color: #1D3557 !important;
    --theme-text-color: #888 !important;
    --theme-tag-bg: #F5F5F0 !important;
    --theme-tag-text: #627084 !important;
    --theme-arrow-hover: #1D3557 !important;
}

.team-section-595.theme-pink {
    --theme-main-color: #E8336D !important;
    --theme-accent-color: #1D3557 !important;
    --theme-text-color: #6b7280 !important;
    --theme-tag-bg: #FDE8EF !important;
    --theme-tag-text: #E8336D !important;
    --theme-arrow-hover: #1D3557 !important;
}

.team-section-595 {
    padding: 60px 20px;
    font-family: var(--font-sans-595);
    text-align: center;
}

.team-title-595 {
    font-family: var(--font-serif-595);
    font-weight: bold;
    color: var(--theme-main-color) !important;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.team-subtitle-595 {
    color: var(--theme-text-color) !important;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.team-container-595 {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    /* JS will set --cols dynamically based on breakpoints and data-cols-* attributes */
    --cols: 3;
}

/* Card Styles */
.team-card-595 {
    background: var(--card-bg-595);
    border-radius: var(--card-radius-595);
    border: 1px solid var(--card-border-595);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: 100%;
}

a.team-card-link-595 {
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.team-card-link-595:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.team-photo-container-595 {
    width: var(--photo-size-595);
    height: var(--photo-size-595);
    margin-bottom: 20px;
    border: 4px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    /* Default theme accent background */
    background-color: var(--theme-accent-color);
}

.team-photo-container-595.shape-circle {
    border-radius: 50%;
}

.team-photo-container-595 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name-595 {
    font-family: var(--font-serif-595);
    font-weight: bold;
    color: var(--theme-main-color) !important;
    font-size: 1.25rem;
    margin-bottom: 8px;
    margin-top: 0;
}

.team-role-595 {
    color: var(--theme-text-color) !important;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.team-tag-595 {
    background-color: var(--theme-tag-bg) !important;
    color: var(--theme-tag-text) !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.team-languages-595 {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.team-lang-flag-595 {
    font-size: 1.5rem;
    cursor: help;
    display: inline-block;
    transition: transform 0.2s ease;
}

.team-lang-flag-595:hover {
    transform: scale(1.2);
}

/* Grid Mode */
.team-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    gap: 24px;
}

/* Carousel Mode */
.team-carousel-wrapper {
    overflow: hidden;
    width: 100%;
}

.team-carousel {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 24px;
}

/* Carousel Card Wrapper - exact width using calc */
.team-carousel > .team-card-wrapper-595 {
    flex: 0 0 calc((100% - (24px * (var(--cols) - 1))) / var(--cols));
    max-width: calc((100% - (24px * (var(--cols) - 1))) / var(--cols));
    box-sizing: border-box;
}

.team-controls-595 {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 20px;
}

.team-arrow-595 {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--theme-main-color) !important;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.team-arrow-595:hover {
    color: var(--theme-arrow-hover) !important;
}

.team-dots-595 {
    display: flex;
    gap: 8px;
}

.team-dot-595 {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--dot-inactive-595);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s;
}

.team-dot-595.active {
    background-color: var(--theme-main-color) !important;
}

/* Hide controls in grid mode */
.team-grid-container-595 .team-controls-595 {
    display: none;
}
