:root {
    --primary-color: #1c1d20;
    --secondary-color: #5a5a5c;
    --background-light: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --card-background: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --border-color: #eee;
}

/* Wrapper */
.main-content-member {
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 100px 20px 40px 20px;
    box-sizing: border-box;
    min-height: calc(100vh - 150px); 
}

/* ... (โค้ด .page-title, .page-subtitle, .gen-section ไม่เปลี่ยนแปลง) ... */
.page-title {
    color: var(--primary-color);
    font-size: 2.8em;
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}
.page-subtitle {
    font-size: 1.2em;
    font-weight: 300;
    color: var(--text-light);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto; 
    line-height: 1.7;
}
.gen-section {
    width: 100%;
    margin-top: 40px;
    margin-bottom: 80px; 
    text-align: center;
}
.gen-section h2 {
    color: var(--primary-color);
    font-size: 2.2em;
    margin-bottom: 40px; 
    font-weight: 450;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}
.gen-section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}
.member-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    row-gap: 50px; 
    column-gap: 30px; 
    width: 100%;
    justify-items: center;
    box-sizing: border-box;
}


/* ===== START: แก้ไข .member-card ที่นี่ ===== */

.member-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 320px; 
    text-align: center;
    box-shadow: 0 10px 25px var(--shadow-light);
    display: flex;
    flex-direction: column;
    height: 100%; 
    
    /* 1. สถานะเริ่มต้น (ซ่อนไว้) */
    opacity: 0;
    transform: translateY(30px);
    
    /* 2. Transition (รวมทุกอย่างที่นี่) */
    /* opacity/transform (สำหรับ .is-visible) จะใช้ 0.6s 
       box-shadow (สำหรับ :hover) จะใช้ 0.3s
       transition-delay จะถูกเพิ่มโดย JS
    */
    transition: opacity 0.6s ease-out, 
                transform 0.6s ease-out, 
                box-shadow 0.3s ease-in-out;
}

/* 3. คลาสที่ JS เพิ่มให้ (สถานะปกติ) */
.member-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4. สถานะ Hover (ต้องเจาะจงกว่า .is-visible) */
.member-card.is-visible:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    
    /* เร่งความเร็ว transition *เฉพาะ* ตอน hover */
    transition-duration: 0.3s; 
}

/* ===== END: แก้ไข .member-card ===== */


.member-card img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    aspect-ratio: 1 / 1; 
    object-fit: cover; 
    transition: transform 0.4s ease;
}

.member-card:hover img {
    transform: scale(1.05);
}

/* ... (โค้ด .member-card h3, .role, .gen, a, .disabled-link, @media... ไม่เปลี่ยนแปลง) ... */
.member-card h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.7em; 
    font-weight: 600; 
    margin-bottom: 10px;
}
.member-card .role {
    font-size: 1.05em;
    color: var(--text-light);
    margin: 0 0 10px 0;
    min-height: 2.2em; 
}
.member-card .gen {
    font-size: 1em;
    color: var(--text-dark);
    font-weight: 500;
    margin: 0 0 20px 0;
    padding: 5px 10px;
    background-color: #f4f4f4; 
    border-radius: 8px;
    display: inline-block;
}
.member-card .gen strong {
    color: var(--primary-color);
}
.member-card a {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    border-radius: 8px;
    margin-top: auto; 
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 600;
}
.member-card a:hover {
    background-color: #3f3f40;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}
.disabled-link {
    background-color: #aaa;
    color: #f0f0f0;
    cursor: not-allowed;
    pointer-events: none; 
}
@media (max-width: 768px) {
    .page-title {
        font-size: 2.2em;
        margin-bottom: 30px;
    }
    .page-subtitle {
        font-size: 1.1em;
        margin-bottom: 50px;
    }
    .gen-section h2 {
        font-size: 1.8em;
    }
    .main-content-member {
        padding-top: 80px;
    }

}
