.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;
}


/* 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;
}

.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;
}

.work-link img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.work-link:hover {
  transform: scale(1.03);
}

/* Overlay chữ */
.overlay-box-work {
  position: absolute;
  bottom: 10px;
  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: 500;
  position: absolute;
  bottom: -23px;
  right: 0;
  background-color: transparent;
  text-shadow:
     0 0 2px black,
     0 0 3px black,
     0 0 4px black;
  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) {

  .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;
  }
}

@media (max-width: 600px) {

  .works-content {
    max-width: 95%;
  }

  .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: 1.0rem;
  }
}


@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;
  }
  .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;
  }
}