/**
 * DGA Team Member Styling - Final Version
 * ไฟล์นี้ควรอยู่ที่: child-theme/css/dga-team.css
 * ออกแบบตามภาพตัวอย่างที่ส่งมา
 */

/* =============== ส่วนของการ์ดหลัก =============== */
.dga-team-member {
    width: 280px;
    margin: 40px 25px 25px;
    border-radius: 0;
    overflow: visible;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: #f9f9f9;
    position: relative;
    opacity: 0;
}

.dga-team-member:hover {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 50;
}

/* =============== ส่วนของคอนเทนเนอร์ภาพ =============== */
.dga-team-image-container {
    height: 480px;
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dga-team-member:hover .dga-team-image-container {
    overflow: visible;
    height: 480px;
}

/* =============== ส่วนของภาพทีมงาน =============== */
.dga-team-image-half,
.dga-team-image-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, opacity;
}

.dga-team-image-half {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
    filter: contrast(1.05) saturate(1.05);
    background-position: center top;
}

.dga-team-image-full {
    opacity: 0;
    transform: scale(1);
    z-index: 2;
    filter: contrast(1.1) saturate(1.1) brightness(1.03);
    background-position: center top;
    box-shadow: none;
}

/* =============== เอฟเฟกต์เมื่อโฮเวอร์ภาพ =============== */
.dga-team-member:hover .dga-team-image-half {
    opacity: 0;
}

.dga-team-member:hover .dga-team-image-full {
    opacity: 1;
    transform: scale(1.2);
    transform-origin: 0px 0px;
    box-shadow: none;
}

/* =============== ส่วนข้อมูลตามภาพตัวอย่าง =============== */
.dga-team-info-tag {
    background: linear-gradient(to right, #ff5f6d, #ff8a00);
    color: white;
    padding: 15px 15px 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 6;
    display: flex;
    flex-direction: column;
}

.dga-team-info-tag:after {
    content: '';
    position: absolute;
    right: -20px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-left: 20px solid #ff8a00;
    border-bottom: 93px solid transparent;
}

/* เส้นใต้ชื่อในป้ายข้อมูล */
.dga-team-title {
    color: white;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    display: block;
    position: relative;
    padding-bottom: 10px;
}

.dga-team-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: white;
}

.dga-team-subtitle {
    color: white;
    opacity: 0.9;
    display: block;
    margin-top: 5px;
    font-size: 16px;
}

.dga-team-phone-overlay {
    color: white;
    margin-top: 5px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.dga-team-phone-overlay:before {
    content: '📞';
    margin-right: 5px;
    font-size: 14px;
}

/* =============== Animation และ Responsive =============== */
/* Animation สำหรับการแสดงผลครั้งแรก */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.dga-team-member.visible {
    animation: fadeInUp 0.8s forwards;
}

/* =============== Tablet (768px และต่ำกว่า) =============== */
@media (max-width: 768px) {
    .dga-team-member {
        width: 160px;
        margin: 10px auto;
    }

    .dga-team-image-container {
        height: 240px;
    }

    .dga-team-member:hover .dga-team-image-container {
        height: 240px;
    }

    .dga-team-image-half,
    .dga-team-image-full {
        background-size: contain;
        background-position: top center;
        background-repeat: no-repeat;
    }

    .dga-team-grid {
        gap: 15px;
        padding: 10px;
    }

    .dga-team-info-tag {
        padding: 10px;
    }

    .dga-team-title {
        font-size: 14px;
        padding-bottom: 6px;
    }

    .dga-team-title:after {
        width: 25px;
    }

    .dga-team-subtitle {
        font-size: 11px;
        margin-top: 3px;
    }

    .dga-team-phone-overlay {
        font-size: 10px;
        margin-top: 3px;
    }

    .dga-team-info-tag:after {
        border-bottom: 70px solid transparent;
        border-left: 15px solid #ff8a00;
        right: -15px;
    }
}

/* =============== Mobile (480px และต่ำกว่า) =============== */
@media (max-width: 480px) {
    .dga-team-member {
        width: 140px;
        margin: 8px auto;
    }

    .dga-team-image-container {
        height: 210px;
    }

    .dga-team-member:hover .dga-team-image-container {
        height: 210px;
    }

    .dga-team-image-half,
    .dga-team-image-full {
        background-size: contain;
        background-position: top center;
        background-repeat: no-repeat;
    }

    .dga-team-grid {
        gap: 10px;
        padding: 5px;
    }

    .dga-team-grid .dga-team-member {
        margin: 10px 0 0;
    }

    .dga-team-info-tag {
        padding: 8px;
    }

    .dga-team-title {
        font-size: 12px;
        padding-bottom: 4px;
    }

    .dga-team-title:after {
        width: 20px;
        height: 1px;
    }

    .dga-team-subtitle {
        font-size: 10px;
        margin-top: 2px;
    }

    .dga-team-phone-overlay {
        font-size: 9px;
        margin-top: 2px;
    }

    .dga-team-phone-overlay:before {
        font-size: 10px;
        margin-right: 3px;
    }

    .dga-team-info-tag:after {
        border-bottom: 55px solid transparent;
        border-left: 12px solid #ff8a00;
        right: -12px;
    }
}

/* =============== การจัดรูปแบบกริด =============== */
.dga-team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.dga-team-grid .dga-team-member {
    margin: 40px 0 0;
}

/* =============== ข้อความแจ้งเตือนข้อผิดพลาด =============== */
.dga-team-error {
    color: #FF5F6D;
    font-weight: bold;
    padding: 10px;
    border: 1px solid #FF5F6D;
    border-radius: 5px;
    background-color: rgba(255, 95, 109, 0.1);
}
