/* === VÙNG CHUNG === */
.work {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background-color: #000;
}

.work-avatar {
  position: relative;
  width: 100%;
  height: 500px; /* Chiều cao cố định cho ảnh nền */
}

/* === ẢNH NỀN === */
.work-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
  animation: fadeBg 15s infinite ease-in-out, bgZoom 45s infinite ease-in-out;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-color: #222; /* fallback */
}
.work-bg.bg1 {
  animation-delay: 0s, 0s;
}
.work-bg.bg2 {
  animation-delay: 5s, 0s; /* bắt đầu sau 5s */
}
.work-bg.bg3 {
  animation-delay: 10s, 0s; /* bắt đầu sau 10s */
}
@keyframes fadeBg {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  45%  { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes bgZoom {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* === NỘI DUNG OVERLAY === */
.overlay-work {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: flex-end;
  height: 100%;
  width: 100%;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  gap: 2rem;
}

/* === CỘT TRÁI === */
.work-left-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 100%;
  overflow-wrap: break-word;
}

.work-left-text h2 {
  color: white;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.45;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  white-space: normal;
  word-break: break-word;
  margin: 0;
}

.work-right-text {
  text-align: right;
  align-self: flex-end;
  max-width: 100%;
  overflow-wrap: break-word;
}


.works-section {
  position: relative;
  width: 100%;
  /* min-height: 100vh; */
  background-color: #f3f6f3;
  background-image: url('/image/用紙配置.png');
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: contain;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  animation: bgZoom 40s ease-in-out infinite;
}

.work-heading {
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    line-height: 1;
    margin: 0;
    font-family: 'Times New Roman', Times, serif;
}

.work-info {
    color: white;
    font-size: clamp(1rem, 1.2vw, 1.3rem);
    font-weight: 500;
    text-shadow: 1px 1px 2px black;
    display: inline-block;
    margin-bottom: 0.3rem;
}
/* Khối nội dung chính */
.works-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 1200px;
  width: 100%;
  padding: 40px;
  box-sizing: border-box;
}
.works-image-link {
  display: block;
  position: relative; /* để works-title bám theo */
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
}
.work-company-info {
  color: white;
  font-size: clamp(1rem, 1.2vw, 1.3rem);
  font-weight: 500;
  text-shadow: 1px 1px 2px black;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.works-image-wrapper {
  position: relative;
  bottom: 17px;
}

.works-main {
  width: 100%;
  height: auto;
  display: block;
}

/* Tiêu đề xanh to */
.works-title {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  padding: 20px 40px;
  /* background: linear-gradient(135deg, #0a853a, #0f9f4b); */
  clip-path: polygon(0 0, 100% 0, 100% 80%, 85% 100%, 0 100%);
  text-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.works-text {
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: right;
  cursor: pointer;
  color:#111;
  transition: transform 0.3s ease;

}
.works-text:hover {
  transform: scale(1.03);
}


/* Nút liên kết ở dưới */
.work-link-wrapper {
  margin-top: 20px;
  text-align: right;
  max-width: 500px;
  position: relative;
  width: 100%;
}

.work-link {
  position: relative;
  display: block;
  overflow: visible;
  /* border-radius: 4px; */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  margin-bottom: 30px;
  border: 1px solid #000;
}

.work-link img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.work-link:hover {
  transform: scale(1.03);
}

.arrow-text {
  display: inline-block;
  margin-right: -22px;
  transform: translateY(1px);
}
.arrow-label {
   
  color: #333;
}

/* Overlay chữ */
.overlay-box-work {
  position: absolute;
  bottom: 14px;
  right: 14px;
  color: #ffffff;
  text-align: right;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.overlay-box-work .line5 {
  font-size: 2rem;
  font-weight: 700;
  text-shadow:
     0 0 2px black,
     0 0 3px black,
     0 0 4px black;
  z-index: 1;
  position: relative;
  bottom: 23px;
}

.overlay-box-work .line6 {
  font-size: 1.1rem;
  font-weight: 900;
  position: absolute;
  bottom: -23px;
  right: 0;
  background-color: transparent;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0px 1px 0 #000, 1px 0px 0 #000, 0px -1px 0 #000, -1px 0px 0 #000;
  z-index: 2;
  white-space: nowrap;
}

/* Gradient overlay để khi hover mượt hơn */
.works-image-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.4), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
}
/* Hover mượt */
.works-image-link:hover .works-main {
  transform: scale(1.08); /* Zoom nhẹ */
  filter: brightness(0.85); /* Tối nhẹ */
}

.works-image-link:hover::before {
  opacity: 1; /* Hiện gradient */
}

.works-image-link:hover .works-title {
  transform: translateY(-50%) scale(1.08);
  opacity: 1;
  text-shadow: 3px 3px 10px rgba(0,0,0,0.7);
}

@keyframes bgZoom {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@media (max-width: 1024px) {

  .works-content {
    max-width: 95%;
  }

  .works-title {
    font-size: 1.5rem;
    right: 5%;
  }

  .works-text {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {

  .work-right-text{
    text-align: left;
    align-self: flex-start;
  }

  .works-content {
    max-width: 95%;
  }

  .works-title {
    font-size: 1.2rem;
    right: 5%;
  }

  .works-text {
    font-size: 0.9rem;
  }
  .overlay-box-work .line5{
    font-size: 1.6rem;
  }
  .overlay-box-work .line6{
    font-size: 1.2rem;
  }
  .work-heading {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
}
}

@media (max-width: 600px) {

  .works-content {
    max-width: 95%;
    transform: scale(1.0);
    opacity: 1;
  }

  .works-title {
    font-size: 1.0rem;
    right: 5%;
  }

  .works-text {
    font-size: 0.6rem;
  }
  .overlay-box-work .line5{
    font-size: 1.2rem;
  }
  .overlay-box-work .line6{
    font-size: 0.8rem;
  }
}


@media (max-width: 480px) {

  .works-title {
    font-size: 0.7rem;
    right: -10%;
  }

  .works-text {
    font-size: 0.6rem;
  }
  .overlay-box-work .line5{
    font-size: 1.0rem;
    bottom: 10px;
  }
  .overlay-box-work .line6{
    font-size: 0.7rem;
  }

}

@media (max-width: 360px) {

  .works-title {
    font-size: 0.7rem;
    right: -10%;
  }

  .works-text {
    font-size: 0.6rem;
  }
  .overlay-box-work .line5{
    font-size: 0.7rem;
  }
  .overlay-box-work .line6{
    font-size: 0.5rem;
  }
}
