/* =========================================================================
   Dự án — Popup chi tiết
   ========================================================================= */

.proj-pop {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.proj-pop[hidden] {
  display: none;
}

.proj-pop__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 36, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Fixed dialog — cách màn hình 40px tất cả phía */
.proj-pop__dialog {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  background: #FFFFFF;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scroll bên trong white box */
.proj-pop__box {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 72px;
  box-sizing: border-box;
}

/* --- Close button (absolute trên dialog, không scroll) ------------------- */
.proj-pop__close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  cursor: pointer;
  line-height: 0;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.proj-pop__close:hover {
  background: #F2F2F2;
}

/* --- Scroll hint mouse icon (khuyen khich scroll) -------------------------- */
.proj-pop__scroll {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(41, 57, 72, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 1;
  animation: proj-pop-scroll-bob 2.2s ease-in-out infinite;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.proj-pop__scroll svg {
  display: block;
}

.proj-pop__scroll-dot {
  transform-origin: center;
  animation: proj-pop-scroll-dot 1.6s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.proj-pop__dialog.is-scrolled .proj-pop__scroll {
  opacity: 0;
  transform: translate(-50%, 16px);
}

@keyframes proj-pop-scroll-dot {
  0%   { transform: translateY(0);   opacity: 1; }
  60%  { transform: translateY(10px); opacity: 0; }
  61%  { transform: translateY(0);   opacity: 0; }
  100% { transform: translateY(0);   opacity: 1; }
}

@keyframes proj-pop-scroll-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -4px); }
}

@media (prefers-reduced-motion: reduce) {
  .proj-pop__scroll,
  .proj-pop__scroll-dot {
    animation: none;
  }
}

/* --- Title --------------------------------------------------------------- */
.proj-pop__title {
  margin: 0 0 40px 0;
  color: #000000;
  font-family: var(--font-hn);
  font-weight: 700;
  font-size: 30px;
  line-height: 136%;
  letter-spacing: 0.01em;
  text-align: center;
}

/* =========================================================================
   1. Gallery — 5 khung (masonry: 2 cột + banner)
   ========================================================================= */
.proj-pop__gallery {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
}

.proj-pop__gallery-cols {
  display: flex;
  gap: 0;
}

.proj-pop__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proj-pop__frame {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #EEEEEE;
}

.proj-pop__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Khung lớn 573×429.75 = 4:3 */
.proj-pop__frame--tall {
  aspect-ratio: 4 / 3;
}

/* Khung ngang 573×287 ≈ 2:1 */
.proj-pop__frame--wide {
  aspect-ratio: 573 / 287;
}

/* Banner 1146×229.2 = 5:1 */
.proj-pop__frame--banner {
  aspect-ratio: 5 / 1;
}

.proj-pop__frame.is-empty {
  display: none;
}

/* =========================================================================
   Media (poster + play) — dùng chung tour & highlight
   ========================================================================= */
.proj-pop__media {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.proj-pop__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proj-pop__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  line-height: 0;
  transition: transform 0.25s ease;
}

.proj-pop__play svg {
  width: 100%;
  height: 100%;
}

.proj-pop__play:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.proj-pop__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 3;
}

/* =========================================================================
   2. Video tham quan — 3 cột + button
   ========================================================================= */
.proj-pop__tour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  margin-top: 56px;
}

.proj-pop__tour-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
}

.proj-pop__tour-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proj-pop__media--tour {
  aspect-ratio: 16 / 10;
}

.proj-pop__tour-caption {
  margin: 0;
  color: #293948;
  font-family: var(--font-hn);
  font-weight: 500;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.01em;
  text-align: center;
}

/* --- Button (pill dark) -------------------------------------------------- */
.proj-pop__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 40px;
  background: #293948;
  color: #FFFFFF;
  font-family: var(--font-hn);
  font-weight: 500;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.proj-pop__btn:hover,
.proj-pop__btn:focus {
  background: #D85401;
  color: #FFFFFF;
}

/* =========================================================================
   3. Tính năng nổi bật — xen kẽ ảnh/chữ
   ========================================================================= */
.proj-pop__features {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 56px;
}

.proj-pop__feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.proj-pop__feature--reverse .proj-pop__feature-media {
  order: 2;
}

.proj-pop__feature-media {
  border-radius: 20px;
  overflow: hidden;
  background: #EEEEEE;
  aspect-ratio: 4 / 3;
}

.proj-pop__feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-pop__feature-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proj-pop__feature-title {
  margin: 0;
  color: #293948;
  font-family: var(--font-hn);
  font-weight: 700;
  font-size: 24px;
  line-height: 132%;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.proj-pop__feature-desc {
  margin: 0;
  color: #616161;
  font-family: var(--font-hn);
  font-weight: 300;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.01em;
}

/* =========================================================================
   4. Điểm nhấn — media lớn + caption + button
   ========================================================================= */
.proj-pop__highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 56px;
}

.proj-pop__media--highlight {
  width: 100%;
  aspect-ratio: 1146 / 430;
  border-radius: 20px;
}

.proj-pop__highlight-caption {
  margin: 0;
  color: #293948;
  font-family: var(--font-hn);
  font-weight: 700;
  font-size: 20px;
  line-height: 138%;
  letter-spacing: 0.01em;
  text-align: center;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media screen and (max-width: 1024px) {
  .proj-pop__box {
    padding: 48px;
  }

  .proj-pop__title {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .proj-pop__feature {
    gap: 32px;
  }

  .proj-pop__feature-title {
    font-size: 20px;
  }
}

@media screen and (max-width: 767px) {
  .proj-pop__dialog {
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .proj-pop__box {
    padding: 48px 20px 32px;
  }

  .proj-pop__close {
    top: 16px;
    right: 16px;
  }

  .proj-pop__title {
    font-size: 22px;
    margin-bottom: 24px;
  }

  .proj-pop__tour {
    gap: 24px;
    margin-top: 40px;
  }

  .proj-pop__tour-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .proj-pop__features {
    gap: 40px;
    margin-top: 40px;
  }

  .proj-pop__feature {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Trên mobile luôn để ảnh trên, chữ dưới */
  .proj-pop__feature--reverse .proj-pop__feature-media {
    order: 0;
  }

  .proj-pop__feature-title {
    font-size: 18px;
  }

  .proj-pop__highlight {
    margin-top: 40px;
    gap: 16px;
  }

  .proj-pop__media--highlight {
    aspect-ratio: 4 / 3;
  }

  .proj-pop__highlight-caption {
    font-size: 17px;
  }

  .proj-pop__btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .proj-pop__play {
    width: 44px;
    height: 44px;
  }
}
