/* ========================================================
   1. ĐỒNG BỘ FONT CHỮ LATO & THIẾT LẬP CHUNG
   ======================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,400&display=swap');

:root {
  --color-primary: #003055;
  --color-accent: #da8300;
  --bg-light: #f7f7f7;
  --bg-white: #ffffff;
  --text-dark: #121213;
  --text-muted: #595959;
  --border-color: #e7e7e7;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: subpixel-antialiased;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 102.4px;
  overflow-x: hidden !important;
  font-size: 16px;
  /* Chuẩn hóa lại kích thước gốc */
}

body,
html,
* {
  font-family: 'Lato', sans-serif !important;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
}

/* Khung chứa bo góc chung */
.job-container {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

article {
  background-color: var(--bg-light);
}

/* ========================================================
   2. TỐI ƯU HIỂN THỊ CHO PHẦN CÔNG VIỆC (JOB HEADER)
   ======================================================== */
.job-header {
  background-color: #121213;
  padding: 60px 0;
  color: #ffffff;
}

.job-header .job-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.job-header .job-header-title {
  text-align: left;
  padding: 0 !important;
}

.job-header .job-header-title__eyebrow {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  /* Màu cam điểm nhấn của Zing */
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.job-header .job-header-title__main {
  font-size: 32px !important;
  font-weight: 800;
  color: #ffffff !important;
  /* Hiện rõ chữ trắng trên nền tối */
  line-height: 1.25;
  margin: 0;
}

.job-header .job-header-toolbar {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}

.job-header .job-header-info--wrap {
  display: flex;
  flex-direction: column-reverse;
  /* Mobile: Nút Apply lên trước, nút Quay lại ở dưới */
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.job-header .back-to-search {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.job-header .back-to-search:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Style cho nút Apply Now chung */
#job-details .btn,
.job-header .apply-button.btn {
  background-color: var(--color-primary);
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-out;
  width: 100%;
  /* Full-width trên mobile */
  height: fit-content;
}

#job-details .btn:hover,
.job-header .apply-button.btn:hover {
  background-color: var(--color-accent);
}

/* ========================================================
   3. BỐ CỤC NỘI DUNG CHÍNH (JOB BODY - MOBILE FIRST)
   ======================================================== */
.job-body {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* Cột mô tả công việc bên trái */
.job-body .job-content {
  width: 100%;
  font-size: 16px;
  background-color: var(--bg-white);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.job-body .job-content .job-location {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 48px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.job-body .job-content .job-location::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23183761" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-map-pin"%3E%3Cpath d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/%3E%3Ccircle cx="12" cy="10" r="3"/%3E%3C/svg%3E') no-repeat center/24px 24px;
}

/* Định dạng các thẻ HTML nội dung bài viết đổ từ ATS về */
.job-body .job-description {
  margin: 0 0 38px;
}

.job-description .description h1 {
  font-size: 24px !important;
  color: var(--color-primary);
  margin: 32px 0 16px;
  font-weight: 700;
  /* border-bottom: 1px solid var(--border-color); */
  padding-bottom: 8px;
}

.job-description .description h2 {
  font-size: 20px;
  color: var(--text-dark);
  margin: 24px 0 12px;
  font-weight: 700;
}

.job-description .description p {
  margin-bottom: 16px;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Đồng bộ toàn bộ các thẻ tiêu đề nhánh H3 và H4 bên trong văn bản */
.job-description .description h3,
.job-description .description h4 {
  font-size: 24px !important;
  color: var(--color-primary) !important;
  margin: 38px 0 16px 0 !important;
  font-weight: 700 !important;
  padding-bottom: 8px;
  text-transform: none;
  letter-spacing: normal;
}

/* Phân cấp riêng cho tiêu đề nhỏ H4 */
.job-description .description h4 {
  font-size: 20px !important;
  border-bottom: none;
  padding-bottom: 0;
  margin: 28px 0 12px 0 !important;
}

.job-description .description ul {
  padding-left: 20px;
  margin-bottom: 24px;
  list-style-type: disc;
}

.job-description .description li {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.job-description hr {
  border: none;
  /* border-top: 1px solid var(--border-color); */
  margin: 32px 0;
}

/* Cột tóm tắt thông tin bên phải (Sidebar) */
.job-body .job-post-summary {
  flex-shrink: 0;
  position: relative;
  width: 100%;
}

.job-body .job-post-summary .summary-position-wrapper {
  padding: 32px;
  background-color: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.job-body .job-post-summary .summary-title {
  font-size: 18px;
  margin-bottom: 24px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--color-primary);
}

.job-body .job-post-summary .summary-list {
  padding: 0;
  margin: 0 0 40px;
  list-style-type: none;
}

.job-body .job-post-summary .summary-list-item {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
}

.job-body .job-post-summary .summary-list-item .summary-label {
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.5px;
}

.job-body .job-post-summary .summary-list-item .summary-value {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.job-body .job-post-summary .summary-list-item:has(.summary-value:empty) {
  display: none;
}

/* Nhóm nút tương tác ở Sidebar */
.job-body .job-post-apply .apply-button-group {
  display: flex;
  position: relative;
  align-items: center;
  flex-direction: column;
  gap: 12px;
}

.job-body .job-post-apply .apply-button-group .share-button {
  width: 100%;
  background-color: var(--bg-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  box-shadow: none;
}

.job-body .job-post-apply .apply-button-group .share-button:hover {
  background-color: #f2f5f8;
  color: var(--color-primary);
}

/* Cấu trúc phần Dropdown menu chia sẻ link */
.job-body .job-post-apply .apply-button-group .dropdown-wrapper {
  display: inline-block;
  position: relative;
  width: 100%;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-button {
  margin-right: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu {
  width: 100%;
  min-width: 180px;
  position: absolute;
  z-index: 800;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  bottom: 100% !important;
  top: unset !important;
  border-radius: 8px;
  display: none;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu.top.dropdown-menu-show {
  display: block;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu .dropdown-menu-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  list-style-type: none;
  margin: 0;
  padding: 8px;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu .dropdown-menu-list>li {
  padding: 0;
  width: 100%;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu .dropdown-menu-list>li a {
  all: unset;
  display: block;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  text-transform: uppercase;
  transition: 0.2s ease;
  cursor: pointer;
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu .dropdown-menu-list>li a:hover {
  background-color: var(--bg-light);
  color: var(--color-primary);
}

.job-body .job-post-apply .apply-button-group .dropdown-wrapper .dropdown-menu .dropdown-menu-list>li.dropdown-menu-divider {
  height: 1px;
  padding: 0;
  margin: 6px 0;
  background-color: var(--border-color);
}

/* ========================================================
   4. PHÂN TÁCH GIAO DIỆN MÀN HÌNH LỚN (DESKTOP >= 1024PX)
   ======================================================== */
@media screen and (min-width: 1024px) {

  /* Khung Header trên PC */
  .job-header {
    padding: 80px 0;
  }

  .job-header .job-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
  }

  .job-header .job-header-title {
    flex: 1;
  }

  .job-header .job-header-title__main {
    font-size: 42px !important;
    /* Chữ lớn, cân đối tinh tế */
  }

  .job-header .job-header-toolbar {
    width: auto;
    justify-content: flex-end;
  }

  .job-header .job-header-info--wrap {
    flex-direction: column;
    /* Đổi lại chiều dọc trên PC */
    align-items: flex-end;
    gap: 12px;
    width: auto;
  }

  .job-header .apply-button.btn {
    width: max-content;
    /* Trở lại kích thước tự nhiên của nút */
  }

  /* Bố cục chia cột trên PC */
  .job-body {
    flex-direction: row;
    align-items: flex-start;
    padding: 60px 20px;
  }

  .job-body .job-content {
    flex: 1;
    padding: 40px;
    order: 1;
    /* Cột mô tả bên trái */
  }

  .job-body .job-content .job-location {
    font-size: 16px;
  }

  .job-description .description h1 {
    font-size: 28px !important;
  }

  .job-body .job-post-summary {
    width: 360px;
    /* Khóa độ rộng thanh bên phải */
    order: 2;
    /* Đẩy thanh tóm tắt sang bên phải */
    position: sticky;
    /* Ghim cứng khung thông tin khi người dùng cuộn xem nội dung dài */
    top: 120px;
  }
}