/* Team List Widget Styles */
.team-list-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.team-list-wrapper {
    position: relative;
}

.team-list-card {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.4s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.team-list-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: all 0.4s ease;
}

.team-list-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.team-list-card:hover::after {
    opacity: 1;
}

.team-list-card-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    transition: all 0.4s ease;
}

.team-list-card:hover .team-list-card-content {
    justify-content: center;
}

/* Content Alignment Fixes */
.team-list-card-content[style*="align-items: flex-start"] .team-list-member-name,
.team-list-card-content[style*="align-items: flex-start"] .team-list-member-position,
.team-list-card-content[style*="align-items: flex-start"] .team-list-member-bio {
    text-align: left;
}

.team-list-card-content[style*="align-items: flex-end"] .team-list-member-name,
.team-list-card-content[style*="align-items: flex-end"] .team-list-member-position,
.team-list-card-content[style*="align-items: flex-end"] .team-list-member-bio {
    text-align: right;
}

/* Typography Styles */
.team-list-member-name {
    margin-bottom: 10px;
    transition: all 0.4s ease;
    width: 100%;
}

/* Container for position and bio to occupy same space */
.team-list-content-container {
    position: relative;
    margin-bottom: 15px;
    min-height: 1.5em; /* Minimum height to prevent layout shift */
    width: 100%;
}

.team-list-member-position {
    max-width: 80%;
    opacity: 1;
    transition: all 0.4s ease;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

.team-list-divider-line {
    margin-bottom: 15px;
    transition: all 0.4s ease;
}

.team-list-member-bio {
    max-width: 90%;
    opacity: 0;
    transition: all 0.4s ease;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

/* Hover Effects - Position hides, Bio shows in exact same space */
.team-list-card:hover .team-list-member-position {
    opacity: 0;
}

.team-list-card:hover .team-list-member-bio {
    opacity: 1;
}

/* Clickable Card Styles */
.team-list-card.no-link {
    cursor: default;
}

.team-list-card.has-link {
    cursor: pointer;
}

/* Prevent link styles from affecting card design */
a.team-list-card {
    color: inherit;
    text-decoration: none;
}

a.team-list-card:hover,
a.team-list-card:focus,
a.team-list-card:active,
a.team-list-card:visited {
    color: inherit;
    text-decoration: none;
}

/* Ensure unique styling per widget instance */
[id^="team-list-"] .team-list-card {
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .team-list-member-name {
        font-size: 24px !important;
    }
    
    .team-list-member-position {
        font-size: 14px !important;
    }
    
    .team-list-member-bio {
        font-size: 12px !important;
        max-width: 95%;
    }
    
    .team-list-divider-line {
        width: 50px !important;
    }
}

@media (max-width: 480px) {
    .team-list-member-name {
        font-size: 20px !important;
    }
    
    .team-list-member-position {
        font-size: 12px !important;
    }
    
    .team-list-member-bio {
        font-size: 11px !important;
    }
    
    .team-list-card {
        padding: 20px !important;
    }
}

/* Accessibility */
.team-list-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.team-list-card:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .team-list-card::before {
        background: linear-gradient(360deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%) !important;
    }
    
    .team-list-card:hover::before {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.9) 100%) !important;
    }
}

/* Print styles */
@media print {
    .team-list-card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .team-list-member-bio {
        opacity: 1 !important;
        transform: none !important;
    }
}