/* CSS สำหรับหน้าสาธารณะ */
.staff-directory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Kanit', sans-serif;
}

.staff-department {
    margin-bottom: 50px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.staff-department-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    font-family: 'Kanit', sans-serif;
}

/* ระดับตำแหน่ง */
.staff-level {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 30px;
}

.staff-level.director-level,
.staff-level.head-level {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 40px;
}

.staff-level.deputy-director-level,
.staff-level.deputy-head-level {
    display: grid;
    grid-template-columns: repeat(4, 180px);
    justify-content: center;
    align-items: start;
    gap: 25px;
    width: 100%;
    margin: 0 auto 40px;
    max-width: calc(180px * 4 + 25px * 3);
}

.staff-level.staff-level {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.staff-row {
    display: grid;
    grid-template-columns: repeat(4, 180px);
    justify-content: center;
    align-items: start;
    gap: 25px;
    width: 100%;
    margin: 0 auto 30px;
    max-width: calc(180px * 4 + 25px * 3);
}

/* การ์ดบุคลากร */
.staff-card {
    width: 180px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.staff-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.staff-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.staff-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.staff-card:hover .staff-card-image img {
    transform: scale(1.05);
}

.staff-card-info {
    padding: 15px;
    text-align: center;
}

.staff-card-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.4;
    font-family: 'Kanit', sans-serif;
}

.staff-card-position {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.staff-card-rank {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.staff-card-email {
    font-size: 12px;
    color: #0073aa;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.staff-card-email a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.staff-card-email a:hover {
    color: #005177;
    text-decoration: underline;
}

/* สไตล์พิเศษสำหรับผู้อำนวยการ */
.director-level .staff-card {
    width: 220px;
    border: 2px solid #0073aa;
}

.director-level .staff-card-image {
    height: 260px;
}

.director-level .staff-card-name {
    font-size: 18px;
    color: #0073aa;
}

/* สไตล์พิเศษสำหรับรองผู้อำนวยการ */
.deputy-director-level .staff-card {
    width: 200px;
    border: 2px solid #00a0d2;
}

.deputy-director-level .staff-card-image {
    height: 240px;
}

.deputy-director-level .staff-card-name {
    font-size: 17px;
    color: #00a0d2;
}

/* สไตล์พิเศษสำหรับหัวหน้ากลุ่มสาระ */
.head-level .staff-card {
    width: 200px;
    border: 2px solid #46b450;
}

.head-level .staff-card-image {
    height: 240px;
}

.head-level .staff-card-name {
    font-size: 17px;
    color: #46b450;
}

/* สไตล์พิเศษสำหรับรองหัวหน้ากลุ่มสาระ */
.deputy-head-level .staff-card {
    width: 190px;
    border: 2px solid #00ba37;
}

.deputy-head-level .staff-card-image {
    height: 230px;
}

.deputy-head-level .staff-card-name {
    font-size: 16px;
    color: #00ba37;
}

/* สำหรับหน้าจอใหญ่ - ขยายช่องว่างระหว่างการ์ด */
@media (min-width: 1400px) {
    .staff-level.deputy-director-level,
    .staff-level.deputy-head-level {
        gap: 40px;
        max-width: calc(180px * 4 + 40px * 3);
    }
    
    .staff-row {
        gap: 40px;
        max-width: calc(180px * 4 + 40px * 3);
    }
}

@media (min-width: 1600px) {
    .staff-level.deputy-director-level,
    .staff-level.deputy-head-level {
        gap: 50px;
        max-width: calc(180px * 4 + 50px * 3);
    }
    
    .staff-row {
        gap: 50px;
        max-width: calc(180px * 4 + 50px * 3);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .staff-directory-container {
        padding: 15px;
    }
    
    .staff-card {
        width: 160px;
    }
    
    .staff-card-image {
        height: 200px;
    }
    
    .staff-level.deputy-director-level,
    .staff-level.deputy-head-level {
        grid-template-columns: repeat(4, 160px);
        max-width: calc(160px * 4 + 25px * 3);
    }
    
    .staff-row {
        grid-template-columns: repeat(4, 160px);
        max-width: calc(160px * 4 + 25px * 3);
    }
}

@media (max-width: 768px) {
    .staff-directory-container {
        padding: 10px;
    }
    
    .staff-department-title {
        font-size: 24px;
    }
    
    .staff-card {
        width: 140px;
    }
    
    .staff-card-image {
        height: 180px;
    }
    
    .staff-card-name {
        font-size: 14px;
    }
    
    .staff-card-position {
        font-size: 12px;
    }
    
    .staff-level.deputy-director-level,
    .staff-level.deputy-head-level {
        grid-template-columns: repeat(2, 140px);
        max-width: calc(140px * 2 + 25px * 1);
    }
    
    .staff-row {
        grid-template-columns: repeat(2, 140px);
        max-width: calc(140px * 2 + 25px * 1);
        gap: 15px;
    }
    
    .director-level .staff-card,
    .deputy-director-level .staff-card,
    .head-level .staff-card,
    .deputy-head-level .staff-card {
        width: 160px;
    }
}

@media (max-width: 480px) {
    .staff-card {
        width: 120px;
    }
    
    .staff-card-image {
        height: 150px;
    }
    
    .staff-card-name {
        font-size: 13px;
    }
    
    .staff-level.deputy-director-level,
    .staff-level.deputy-head-level {
        grid-template-columns: 120px;
        max-width: 120px;
    }
    
    .staff-row {
        grid-template-columns: 120px;
        max-width: 120px;
        gap: 10px;
    }
}

