/* --- 1. Variables & Base Setup --- */
:root {
  /* ใช้ clamp เพื่อให้ขนาดปรับตามความกว้างหน้าจอ (Fluid Typography) */
  --header-size: clamp(3.5rem, 12vw, 7.5rem);
  --arrow-size: clamp(2.5rem, 5vw, 3.125rem);
  --career-text-size: clamp(1.25rem, 4vw, 2.1875rem);
  --right-box-text-size: clamp(1rem, 3vw, 1.875rem);

  /* Colors */
  --bg-creme: #edebde;
  --bg-dark: #1a1a1a;
  --item-dark: #333333;
  --gradient-rainbow: linear-gradient(
    90deg,
    #ffc502,
    #88d04a,
    #028dfe,
    #425cf8,
    #8336cd,
    #fc7c0b,
    #f93f14
  );
}

#careers-section {
  font-family: "GothamBold", sans-serif;
  background-color: var(--bg-creme);
  overflow-x: hidden; /* ป้องกันหน้าจอเลื่อนซ้ายขวาในมือถือ */
}

/* --- 2. Header Section --- */
#head-careers {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-dark);
  height: 40vh;
  min-height: 300px;
  text-align: center;
  padding: 0 1rem;
}

#head-careers h1 {
  color: white;
  text-transform: uppercase;
  font-weight: bold;
  font-size: var(--header-size);
  margin-bottom: 1rem;
  line-height: 1;
}

.arrow-head {
  width: var(--arrow-size);
  height: auto;
}

.arrow-head img {
  width: 100%;
  height: auto;
}

/* --- 3. Careers List Container --- */
.careers-container {
  max-width: 1140px;
  margin: 3.3rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.25rem;
}

/* --- 4. Careers Item (The Card) --- */
.careers-item {
  width: 100%;
  min-height: 10rem;
  display: grid;
  /* Desktop: 3 columns */
  grid-template-columns: 120px 1fr 180px;
  align-items: center;
  text-transform: uppercase;
  background-color: var(--item-dark);
  border-radius: 1.25rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Rainbow Border Animation on Hover */
.careers-item:before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 0.3em;
  background: var(--gradient-rainbow);
  border-radius: inherit;
  --m: conic-gradient(#000 0 0);
  mask:
    var(--m) content-box exclude,
    var(--m);
  -webkit-mask:
    var(--m) content-box exclude,
    var(--m);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.careers-item:hover::before {
  opacity: 1;
}

.careers-item:hover {
  background-color: transparent;
}

/* Internal Components of the Card */
.left-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
}

.left-box img {
  width: 100%;
  max-width: 100px;
  height: auto;
  filter: invert(100%);
  transition: all 0.3s ease;
}

.careers-name {
  padding: 0 2rem;
  height: 70%;
  display: flex;
  align-items: center;
  font-size: var(--career-text-size);
  border-right: 2px solid #666;
  color: white;
}

.right-box {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--right-box-text-size);
  color: white;
}

.right-box p {
  margin: 0;
  font-family: "GothamBook", sans-serif;
}

/* Hover States for Content */
.careers-item:hover .left-box img {
  content: url("https://wyndigitalgroup.com/wp-content/uploads/2025/03/wyn.webp");
  filter: invert(0%);
  transform: scale(1.1);
}

.careers-item:hover .careers-name,
.careers-item:hover .careers-name span,
.careers-item:hover .right-box p {
  color: var(--bg-dark);
}

/* --- 5. Popup / Modal Style --- */
.popup-content {
  background-color: var(--bg-creme);
  font-family: "GothamBold", sans-serif;
  padding: 1rem;
}

.popup-header {
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(
    0.25turn,
    #ffc502,
    #88d04a,
    #028dfe,
    #425cf8,
    #8336cd,
    #fc7c0b,
    #f93f14
  );
  border-image-slice: 1;
  padding-bottom: 1rem;
}

.popup-header h5 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  text-align: center;
  width: 100%;
}

.upload-box {
  border: 1px dashed #666;
  border-radius: 10px;
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.05);
}

.upload-icon {
  background-color: #cbcbcb;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

/* --- 6. Responsive Media Queries --- */

/* Tablet & Smaller Desktop (992px and down) */
@media (max-width: 991.98px) {
  .careers-item {
    grid-template-columns: 100px 1fr; /* เหลือ 2 คอลัมน์ */
    height: auto;
    padding: 1.5rem 0.5rem;
  }

  .careers-name {
    border-right: none;
    padding: 0 1rem;
  }

  .right-box {
    grid-column: 2; /* ย้าย Full-time มาอยู่ใต้ชื่อตำแหน่ง */
    justify-content: flex-start;
    padding-left: 1rem;
    margin-top: 0.5rem;
  }
}

/* Mobile (576px and down) */
@media (max-width: 575.98px) {
  #head-careers {
    height: 30vh;
  }

  .careers-item {
    grid-template-columns: 1fr; /* กลายเป็นคอลัมน์เดียวแนวตั้ง */
    text-align: center;
    padding: 2rem 1rem;
  }

  .left-box {
    width: 80px;
    margin: 0 auto 1rem;
  }

  .careers-name {
    justify-content: center;
    padding: 0;
    margin-bottom: 0.5rem;
  }

  .right-box {
    grid-column: 1;
    justify-content: center;
    padding: 0;
  }

  .arrow-bottom {
    padding: 2rem 0;
  }

  .text-one {
    font-size: 12px;
    text-align: center;
  }

  .text-two {
    font-size: 11px;
  }

  .text-three {
    font-size: 11px;
  }

  .text-part-one {
    font-size: 14px;
    text-align: center;
  }

  .text-part-two {
    font-size: 11px;
  }
  .text-part-three {
    font-size: 10px;
  }

  .margin-left {
    margin-left: -32px;
  }

  .left-turnstile {
    margin-left: -20px;
  }
}

/* --- 7. Footer Arrow --- */
.arrow-bottom {
  width: 100%;
  padding: 3.125rem 0;
  display: flex;
  justify-content: center;
}

.arrow-bottom img {
  width: var(--arrow-size);
}
