/**
 * The 20 People Gallery - Frontend Styles
 * Responsive grid layout inspired by edataso.com team section
 */

.t20-people-gallery {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.t20-people-grid {
    list-style: none!important;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 100%;
}

/* Limit to 4 columns max */
@media (min-width: 1200px) {
    .t20-people-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .t20-people-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .t20-people-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 479px) {
    .t20-people-grid {
        grid-template-columns: 1fr;
    }
}

.t20-person-item {
    margin: 0;
    padding: 0;
}

.t20-person-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.t20-person-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.t20-person-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Member description container - stacked divs */
.member-desc {
    position: absolute;
    bottom: 1vh;
    left: 0;
    right: 0;
    z-index: 1;
}

/* Name styling */
.member-name {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: white;
    padding: 7px 10px;
    background: color-mix(in srgb, var(--theme-color) 90%, black);
}

/* Info/title styling */
.member-info {
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: white;
    padding: 7px 10px;
    background: color-mix(in srgb, var(--theme-sec_color, #666666) 60%, black);
}

/* Fallback for themes without Divi color variables */
body:not([class*="et-"]) .member-name {
    background: color-mix(in srgb, #2ea3f2 90%, black);
}

body:not([class*="et-"]) .member-info {
    background: color-mix(in srgb, #666666 60%, black);
}

/* Ensure proper spacing on smaller screens */
@media (max-width: 767px) {
    .t20-people-gallery {
        padding: 15px 0;
    }

    .t20-people-grid {
        gap: 15px;
    }

    .member-name {
        font-size: 16px;
    }

    .member-info {
        font-size: 13px;
    }

    .member-name-wrapper {
        padding: 8px 12px;
    }

    .member-info-wrapper {
        padding: 6px 12px;
    }
}

/* Animation for card entrance */
.t20-person-item {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.t20-person-item:nth-child(1) { animation-delay: 0.1s; }
.t20-person-item:nth-child(2) { animation-delay: 0.2s; }
.t20-person-item:nth-child(3) { animation-delay: 0.3s; }
.t20-person-item:nth-child(4) { animation-delay: 0.4s; }
.t20-person-item:nth-child(5) { animation-delay: 0.5s; }
.t20-person-item:nth-child(6) { animation-delay: 0.6s; }
.t20-person-item:nth-child(7) { animation-delay: 0.7s; }
.t20-person-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable animation for reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .t20-person-item {
        animation: none;
    }

    .t20-person-card {
        transition: none;
    }
}
