/* Department Filter Section */
.department-filter {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 40px 0;
    background: #ffffff;
}

.department-header {
    margin-bottom: 32px;
}

.department-header h2 {
    font-family: 'Anuphan', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: 410px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
}

.department-grid.expanded {
    max-height: 2000px;
}

.department-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.department-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.department-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f2ff;
    border-radius: 50%;
    color: #0071e3;
}

.department-icon svg {
    width: 24px;
    height: 24px;
}

.department-content {
    flex: 1;
    min-width: 0;
}

.department-content h3 {
    font-family: 'Anuphan', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #303030;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.department-content p {
    font-family: 'Anuphan', sans-serif;
    font-size: 13px;
    color: #666666;
    margin: 0;
    line-height: 1.3;
}

.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    padding: 12px 24px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    font-family: 'Anuphan', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

.show-more-btn .btn-icon {
    transition: transform 0.3s ease;
}

.show-more-btn.expanded .btn-icon {
    transform: rotate(180deg);
}

/* ===========================
   HotelJob — Dept Browser
   =========================== */

/* ---- Section wrapper ---- */
.hj-dept-browser{
  width:100%;
  position:relative;
  z-index:0;
  margin-top: 40px;
}

/* ---- Heading ---- */
.hj-dept-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
}
.hj-dept-title{
  margin:0;
  font-size:20px;
  font-weight:700;
  color:#303030;
  display:flex;
  align-items:center;
  gap:8px;
}
.hj-dept-title-icon{
  font-size:20px;
  line-height:1;
}

/* ---- Grid Layout (3/2/1 columns) ---- */
.hj-dept-grid{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:16px;
  grid-template-columns:repeat(3,1fr);
}

  

/* ---- Card base ---- */
.hj-dept-card{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  padding:16px;
  border:1px solid #E0E6EA;
  border-radius:14px;
  background:#FFF;
}
.hj-dept-card:hover{
  border-color:#C2E7FF;
  box-shadow:0 2px 12px rgba(0,0,0,.04);
}
.hj-dept-card:active{ transform:translateY(1px); }

.hj-dept-card-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0; /* ให้ title truncate ได้ */
}
.hj-dept-card-text{ min-width:0; }
.hj-dept-card-title{
  font-size:16px;
  font-weight:700;
  color:#303030;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hj-dept-card-sub{
  font-size:13px;
  color:#7A7A73;
  padding-top: 8px;
}

/* คลิกได้ทั้งใบ */
.hj-dept-link{
  position:absolute;
  inset:0;
  border-radius:14px;
  text-indent:-9999px;
  overflow:hidden;
}

/* โฟกัสด้วยคีย์บอร์ด (ไม่กระทบเมาส์) */
.hj-dept-card:has(.hj-dept-link:focus-visible){
  outline:3px solid #C2E7FF;
  outline-offset:2px;
}

/* ---- Card: “ตำแหน่งงานทั้งหมด” (กว้างทั้งแถว) ---- */
.hj-dept-card.is-wide{
  grid-column:1 / -1;
}
.hj-dept-card.is-all{
  background:#F1F6FF;          /* ฟ้าอ่อนตามภาพ */
  
  padding-right:88px;           /* เผื่อพื้นที่เลขด้านขวา */
}
.hj-dept-card.is-all .hj-dept-card-icon{
  width:48px;
  height:48px;
  border-radius:12px;
  background:#2E6BFF;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
}
.hj-dept-all-count{
  position:absolute;
  right:18px;
  top:50%;
  transform:translateY(-50%);
  font-weight:800;
  font-size:24px;
  color:#303030;
  line-height:1;
  user-select:none;
}

/* ---- Badge ตัวเลขมุมขวาการ์ดทั่วไป ---- */
.hj-dept-card{ padding-right:68px; } /* กันพื้นที่ badge */
 .hj-dept-badge{
  position:absolute;
  right:16px;
  top:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:32px;
  height:28px;
  padding:0 10px;
  border-radius:999px;
  background:#F3F5F7;
  border:1px solid #E0E6EA;
  color:#303030;
  font-size:13px;
  font-weight:700;
  line-height:1;
  user-select:none;
} 

/* ---- Toggle button (ดูทั้งหมด / ซ่อนบางส่วน) ---- */
.hj-dept-toggle-wrap{
  display:flex;
  justify-content:center;
  margin-top:16px;
}
.hj-dept-toggle{
  appearance:none;
  border:1px solid #C2E7FF;
  background:#fff;
  color:#303030;
  font-weight:700;
  font-size:14px;
  padding:10px 16px;
  border-radius:999px;
  cursor:pointer;
  transition:background .2s, color .2s, border-color .2s, transform .02s;
}
.hj-dept-toggle:hover{ border-color:#FE7743; }
.hj-dept-toggle:active{ transform:translateY(1px); }
.hj-dept-toggle:focus-visible{
  outline:3px solid #C2E7FF;
  outline-offset:2px;
}

/* ---- Utility (กันคลาส framework ทับค่า) ---- */
.hj-dept-grid{ display:grid !important; }          /* กันกรณี framework ตั้ง flex/column */
.hj-dept-card{ background:#fff; }                  /* กันสีพื้นโดนทับ */



/* Responsive Breakpoints */
/* Desktop: 1400px and above - 4 columns */
@media (min-width: 1400px) {
    .department-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .show-more-btn{
        visibility: hidden;
    }

}

/* Mobile: 1200px and below - 1 column */
@media (max-width: 1200px) {
    
    .hj-dept-grid{ grid-template-columns:1fr; }
    .department-header h2 {
        font-size: 24px;
    }

    .department-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: 300px;
    }


    .department-card {
        padding: 16px;
        gap: 14px;
    }

    .department-icon {
        width: 44px;
        height: 44px;
    }

    .department-icon svg {
        width: 22px;
        height: 22px;
    }

    .department-content h3 {
        font-size: 18px;
    }

    .department-content p {
        font-size: 12px;
    }

    .show-more-btn {
        font-size: 14px;
        padding: 11px 20px;
    }
    
    /* ---- ลด motion เมื่อตั้งค่า prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce){
  .hj-dept-card,
  .hj-dept-toggle{ transition:none !important; }
}

}
