/*--------------------------------------------------------------
# Slide ảnh dùng chung (dự án, blog, khóa học, dịch vụ, tuyển dụng)
# Ảnh lớn + dải thumbnail + bấm để phóng to (GLightbox)
--------------------------------------------------------------*/
.project-gallery {
  margin-bottom: 10px;
}

.project-gallery .pg-main {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0d1b26;
  box-shadow: 0 18px 40px -18px rgba(13, 27, 38, 0.45);
}

.project-gallery .pg-main .swiper-slide {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Nền mờ lấy từ chính ảnh để ảnh dọc/ảnh bản vẽ không bị viền đen trống */
.project-gallery .pg-main .swiper-slide::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image: var(--pg-bg);
  background-size: cover;
  background-position: center;
  /* Bản phóng to, làm mờ của chính ảnh: giữ màu tươi, chỉ tối nhẹ để ảnh chính nổi lên */
  filter: blur(36px) saturate(1.25) brightness(0.85);
  transform: scale(1.35);
}

/* Viền tối rất nhẹ quanh mép để ảnh chính tách khỏi nền mờ */
.project-gallery .pg-main .swiper-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(13, 27, 38, 0) 55%, rgba(13, 27, 38, 0.35) 100%);
  pointer-events: none;
}

.project-gallery .pg-main img {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.project-gallery .pg-main a {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.project-gallery .pg-main img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.6s ease;
}

.project-gallery .pg-main .swiper-slide-active a:hover img {
  transform: scale(1.015);
}

/* Nút chuyển ảnh */
.project-gallery .pg-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background 0.3s;
}

.project-gallery .pg-prev {
  left: 18px;
}

.project-gallery .pg-next {
  right: 18px;
}

.project-gallery .pg-main:hover .pg-nav,
.project-gallery .pg-nav:focus-visible {
  opacity: 1;
}

.project-gallery .pg-nav:hover {
  background: var(--color-primary, #154D7C);
}

.project-gallery .pg-nav.swiper-button-disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* Bộ đếm ảnh và biểu tượng phóng to */
.project-gallery .pg-counter,
.project-gallery .pg-zoom-hint {
  position: absolute;
  z-index: 5;
  bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.project-gallery .pg-counter {
  left: 16px;
}

.project-gallery .pg-zoom-hint {
  right: 16px;
}

/* Dải thumbnail */
.project-gallery .pg-thumbs {
  margin-top: 12px;
  padding: 2px;
}

.project-gallery .pg-thumbs .swiper-slide {
  width: 120px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition: opacity 0.3s, outline-color 0.3s;
}

.project-gallery .pg-thumbs .swiper-slide:hover {
  opacity: 0.85;
}

.project-gallery .pg-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  outline-color: var(--color-primary, #154D7C);
}

.project-gallery .pg-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Chỉ có 1 ảnh: ẩn các điều khiển không cần thiết */
.project-gallery.is-single .pg-nav,
.project-gallery.is-single .pg-counter,
.project-gallery.is-single .pg-thumbs {
  display: none;
}

@media (max-width: 767px) {
  .project-gallery .pg-main {
    border-radius: 10px;
  }

  .project-gallery .pg-main .swiper-slide {
    aspect-ratio: 4 / 3;
  }

  .project-gallery .pg-nav {
    display: none;
  }

  .project-gallery .pg-thumbs .swiper-slide {
    width: 84px;
    height: 56px;
  }
}


/* Nền màu tự động lấy từ mép ảnh (gallery.js): tắt lớp nền mờ, ảnh liền với nền */
.project-gallery .pg-main .swiper-slide.pg-tinted::before,
.project-gallery .pg-main .swiper-slide.pg-tinted::after {
  display: none;
}

.project-gallery .pg-main .swiper-slide.pg-tinted img {
  box-shadow: none;
}

.project-gallery .pg-main .swiper-slide {
  transition: background 0.4s ease;
}
