/* IdeaStructura Team Plugin - Public Styles */

/* Team list container */
.idis-team-list {
    margin: 20px 0;
    font-family: inherit;
}

/* Team members grid - Modern CSS Grid with Flexbox fallback */
.idis-team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Flexbox fallback for older browsers */
@supports not (display: grid) {
    .idis-team-members {
        display: flex;
        flex-wrap: wrap;
        margin: -10px;
    }
    
    .idis-member-card {
        flex: 1 1 280px;
        margin: 10px;
        max-width: calc(50% - 20px);
    }
}

/* Individual member card - Minimalist design */
.idis-member-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding-top: 32px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.idis-member-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #e0e0e0;
}

/* Member avatar */
.idis-member-avatar {
    margin-bottom: 16px;
    position: relative;
}

.idis-member-avatar img,
.idis-member-avatar .avatar {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 4px solid #f8f8f8;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.idis-member-card:hover .idis-member-avatar img,
.idis-member-card:hover .idis-member-avatar .avatar {
    border-color: #f0f0f0;
    transform: scale(1.05);
}

.idis-member-photo {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/* Member information */
.idis-member-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    height: 100%;
}

.idis-member-main-content {
    flex: 1;
    padding-bottom: 75px; /* Reserve space for larger contact area */
    margin-bottom: 10px;
    overflow: hidden;
}

.idis-member-name {
    margin: 0 0 8px 0;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--theme-palette-color-4);
}

.idis-member-title {
    margin: 0 0 12px 0;
    font-style: italic;
    font-size: 0.95em;
    font-weight: 500;
    color: #5d6d7e;
}

.idis-member-description {
    margin: 0 0 8px 0;
    line-height: 1.5;
    font-size: 0.9em;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    color: var(--theme-palette-color-4);
}

/* Contact information */
.idis-member-contact {
    position: absolute;
    bottom: 0; /* Flush to the very bottom */
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 18px 0 18px 0; /* Equal padding for divider */
    background: #ffffff;
    height: 80px; /* Increased height for full text visibility */
    justify-content: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.idis-member-contact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background-color: #e8e8e8;
}

.idis-member-email,
.idis-member-phone {
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    padding: 4px 0;
    background: transparent;
    transition: color 0.2s ease;
    display: block;
    width: 100%;
    word-break: break-word;
    white-space: nowrap;
    line-height: 1.5;
    text-align: center;
    max-width: 100%;
    overflow: visible;
    height: auto;
    min-height: 24px;
}

.idis-member-email:hover,
.idis-member-phone:hover {
    text-decoration: underline;
}

.idis-member-email:focus,
.idis-member-phone:focus {
    outline: 2px solid var(--theme-palette-color-1);
    outline-offset: 2px;
}


/* Accessibility improvements */
.idis-member-card:focus-within {
    outline: 2px solid var(--theme-palette-color-1);
    outline-offset: 2px;
}

/* Loading and empty states */
.idis-team-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.idis-team-list.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: idis-spin 1s linear infinite;
}

@keyframes idis-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Long email styling for big screens */
@media (min-width: 769px) {
    .idis-member-email.idis-long-email {
        font-size: 0.86em;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .idis-team-members {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .idis-member-card {
        padding: 20px;
    }
    
    .idis-member-contact {
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px 0 16px 0;
        height: 75px;
    }
    
    .idis-member-contact::before {
        left: 10px;
        right: 10px;
    }
    
    .idis-member-avatar img,
    .idis-member-avatar .avatar {
        width: 130px;
        height: 130px;
    }
    
    .idis-member-name {
        font-size: 1.1em;
    }
    
    .idis-member-contact {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .idis-team-list {
        margin: 16px 0;
    }
    
    .idis-team-members {
        gap: 12px;
    }
    
    .idis-member-card {
        padding: 16px;
    }
    
    .idis-member-main-content {
        margin-bottom: 5px;
    }
    
    .idis-member-contact {
        bottom: 0;
        left: 0;
        right: 0;
        padding: 14px 0 14px 0;
        height: 70px;
    }
    
    .idis-member-contact::before {
        left: 0;
        right: 0;
    }
    
    .idis-member-avatar img,
    .idis-member-avatar .avatar {
        width: 110px;
        height: 110px;
    }
    
    .idis-member-email,
    .idis-member-phone {
        font-size: 0.85em;
        padding: 3px 6px;
        min-height: 22px;
    }
}

/* Print styles */
@media print {
    .idis-member-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .idis-member-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .idis-member-email,
    .idis-member-phone {
        text-decoration: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .idis-member-card {
        border-width: 2px;
        border-color: currentColor;
    }
    
    .idis-member-email,
    .idis-member-phone {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .idis-member-card,
    .idis-member-avatar img,
    .idis-member-avatar .avatar,
    .idis-member-email,
    .idis-member-phone {
        transition: none;
    }
    
    .idis-member-card:hover {
        transform: none;
    }
    
    @keyframes idis-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
}
