/* หน้า "เกี่ยวกับ > บุคลากร" แบบใหม่ (ใช้คู่กับ assets/js/about-staff.js ซึ่งเติม class .staff-v2 ให้)
 * - แบนเนอร์ภาพอาคารสำนักงานอธิการบดี + ตัวเลขสรุป
 * - แถบลัดไปแต่ละแผนก + ช่องค้นหา (ลอยค้างตอนเลื่อน)
 * - การ์ดเจ้าหน้าที่แนวตั้ง 4 คอลัมน์ วงแหวนทอง แถบสีประจำแผนก
 * - การ์ดผู้บริหารกะทัดรัดบนมือถือ */

/* ---------- แบนเนอร์ ---------- */
.about-hero.staff-v2-hero {
    background:
        linear-gradient(135deg, rgba(0, 51, 102, .88) 0%, rgba(0, 26, 51, .82) 55%, rgba(10, 22, 40, .9) 100%),
        url("../npu/campus5.webp") center 35% / cover no-repeat;
    padding: 34px 0 30px;
}
.staff-v2-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.staff-v2-stats span {
    padding: 6px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 215, 0, .45); color: #fff;
    backdrop-filter: blur(4px);
}
.staff-v2-stats b { color: #FFD700; font-size: 1.05rem; margin-right: 4px; }

/* ---------- แถบลัด + ค้นหา ---------- */
.staff-v2-bar {
    position: sticky; top: var(--staff-bar-top, 80px); z-index: 20;
    margin: 0 0 28px; padding: 12px 14px; border-radius: 16px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0, 31, 77, .12); border: 1px solid #e6ecf5;
}
.staff-v2-search { position: relative; }
.staff-v2-chips { display: none !important; }   /* ซ่อนแถบลัดแผนก (ผู้ดูแลขอเหลือแค่ช่องค้นหา) */
.staff-v2-search input {
    width: 100%; padding: 10px 40px 10px 42px; border-radius: 999px;
    border: 1.5px solid #d4deec; font: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.staff-v2-search input:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0, 51, 102, .12); }
.staff-v2-search .fa-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #7a8aa3; }
.staff-v2-search .clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none;
    color: #7a8aa3; font-size: 1.1rem; cursor: pointer; display: none;
}
.staff-v2-search.has-text .clear { display: block; }
.staff-v2-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.staff-v2-chips button {
    flex: 0 0 auto; border: 1px solid #d4deec; background: #f5f8fc; color: #1d3557;
    padding: 6px 14px; border-radius: 999px; font: 500 .85rem 'Prompt', sans-serif; cursor: pointer; white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}
.staff-v2-chips button::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dept, #003366); margin-right: 6px; }
.staff-v2-chips button:hover, .staff-v2-chips button.on { background: #003366; color: #fff; border-color: #003366; }
.staff-v2-chips button small { opacity: .7; margin-left: 4px; }
.staff-v2-empty { display: none; text-align: center; color: #6b7a90; padding: 30px 0; }
.staff-v2-empty.show { display: block; }

/* ---------- หัวข้อแผนก ---------- */
.staff-v2 .staff-v2-section > h4 { border-left-color: var(--dept, #003366) !important; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; scroll-margin-top: 170px; }
.staff-v2-count {
    font-size: .8rem; font-weight: 600; padding: 3px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--dept, #003366) 12%, white); color: var(--dept, #003366);
}
.staff-v2-section.is-hidden { display: none; }

/* ---------- การ์ดเจ้าหน้าที่ ---------- */
@media (min-width: 576px) { .staff-v2 .staff-grid > [class*="col-"] { flex: 0 0 auto; width: 50%; } }
@media (min-width: 992px) { .staff-v2 .staff-grid > [class*="col-"] { width: 33.3333%; } }
@media (min-width: 1200px) { .staff-v2 .staff-grid > [class*="col-"] { width: 25%; } }
.staff-v2 .staff-grid > .is-hidden { display: none !important; }
.staff-v2 .staff-card {
    position: relative; overflow: hidden; border-left: 0 !important;
    transition: transform .3s ease, box-shadow .3s ease;
}
.staff-v2 .staff-card::before {                         /* แถบสีประจำแผนก + พื้นหลังไล่เฉดด้านบน */
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 74px;
    background: linear-gradient(135deg, var(--dept, #003366), color-mix(in srgb, var(--dept, #003366) 55%, #0a1628));
}
/* ตรามหาวิทยาลัยจาง ๆ มุมขวาบนของแถบสี (ลายน้ำ) + ตราเล็กชัด ๆ มุมซ้ายบน */
.staff-v2 .staff-card::after {
    content: ""; position: absolute; right: -14px; top: -10px; width: 78px; height: 104px;
    background: url("../images/logoNPU.png") center / contain no-repeat;
    opacity: .35; filter: grayscale(1) brightness(1.5); mix-blend-mode: screen; transform: rotate(12deg); pointer-events: none;   /* เห็นลายตราจริง ไม่ใช่แค่เงา */
}
.staff-v2 .staff-card .card-body::before {
    content: ""; position: absolute; left: 12px; top: 10px; width: 24px; height: 32px;
    background: url("../images/logoNPU.png") center / contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
.staff-v2 .personnel-card-new .card-header { position: relative; overflow: hidden; }
.staff-v2 .personnel-card-new .card-header::after {
    content: ""; position: absolute; right: -18px; top: -12px; width: 110px; height: 146px;
    background: url("../images/logoNPU.png") center / contain no-repeat;
    opacity: .3; filter: grayscale(1) brightness(1.5); mix-blend-mode: screen; transform: rotate(12deg); pointer-events: none;
}
.staff-v2 .staff-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(0, 31, 77, .16) !important; border-left: 0 !important; }
.staff-v2 .staff-card .card-body { flex-direction: column; text-align: center; padding: 26px 18px 20px !important; position: relative; }
.staff-v2 .staff-photo-wrapper {
    width: 108px; height: 108px; margin: 0 auto 14px !important;
    border: 4px solid #fff; box-shadow: 0 0 0 3px #FFD700, 0 8px 20px rgba(0, 0, 0, .18);
    transition: transform .3s ease;
}
.staff-v2 .staff-card:hover .staff-photo-wrapper { transform: scale(1.05); }
.staff-v2 .staff-card h6 { font-size: 1rem; margin-bottom: 4px !important; }
.staff-v2 .staff-card p { min-height: 2.6em; }
.staff-v2 .staff-card mark { background: #ffe58a; padding: 0 2px; border-radius: 3px; }

/* ---------- การ์ดผู้บริหารบนมือถือ: กะทัดรัด ---------- */
@media (max-width: 767.98px) {
    .staff-v2 .personnel-card-new .card-header { padding: 18px 0 !important; }
    .staff-v2 .personnel-photo-wrapper { width: 92px; height: 92px; margin-bottom: 0 !important; }
    .staff-v2 .personnel-card-new .card-body { padding: 14px !important; }
    .staff-v2 .personnel-card-new .card-body .d-flex { flex-wrap: wrap; }
    .staff-v2-bar { top: var(--staff-bar-top, 70px); padding: 10px; border-radius: 12px; }
    .about-hero.staff-v2-hero { padding: 22px 0 20px; }
}
