/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */

/* --- Hero 區塊 --- */

.project-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--navbar-height, 4rem) + 2rem) 2rem 2rem;
}


.project-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0rem 0rem 2rem;
  background-color: var(--hero-bg-color, var(--text-3));
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.4);
}

.project-hero img {
  width: 100%;
  max-width: 100%;
  max-height: calc((100vh - var(--navbar-height))*0.8);
  aspect-ratio: 16/10;
  object-fit: cover;
}

.intro-header {
  width: var(--hero-img-width);
  max-width: 100%;
  box-sizing: border-box;
  height: auto;
  padding: clamp(0.8rem, 1.6%, 1.6%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.intro-header h1 {
  color: var(--text-1-white);
  font-weight: 600;
  font-size: clamp(1.6rem, calc(var(--hero-img-height) * 0.04), calc(var(--hero-img-height) * 0.04));
  line-height: 1;
}

.intro-header .meta {
  font-weight: 500;
  font-size: clamp(0.8rem, calc(var(--hero-img-height) * 0.022), calc(var(--hero-img-height) * 0.022));
  line-height: 1;
  color: var(--text-1-white);
}

.intro-header .line {
  width: 100%;
  border-bottom: 2px solid var(--text-1-white);
}

/* --- 專案簡介 --- */
.project-intro {
  width: 100%;
  max-width: var(--hero-img-width);
  margin: 0 auto;
  padding: 2rem;
}

.intro-text p {
  font-size: 1.2rem;
  line-height: 2;
  color: var(--text-1);
  text-align: justify;
  margin-bottom: 1.2rem;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

/* --- Gallery 瀑布流 (Macy.js) --- */
/* wrapper 負責置中與左右留白；padding 由 wrapper 控制，Macy.js 才能正確計算欄寬 */
.project-gallery-wrapper {
  width: 100%;
  max-width: var(--hero-img-width);
  margin: 0 auto;
  padding: 2rem 0 0;
}

.project-gallery {
  width: 100%;
  position: relative;
}

.project-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-gallery img:hover {
  transform: scale(1.01);
}

/* --- PhotoSwipe 自訂樣式 --- */
.pswp__button--arrow .pswp__icn-shadow {
  display: none !important;
}

.pswp__button--arrow .pswp__icn {
  fill: #f5f5dc !important;
  filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.8)) !important;
}


/* 平板與手機 */
@media (max-width: 880px) {

  .project-detail {
    padding: calc(var(--navbar-height, 4rem) + 1.2rem) 1.2rem 1.2rem;
  }

  .project-hero {
    margin: 0rem 0rem 1.2rem;
  }

  .project-hero img {
    max-height: none;
  }

  .project-intro {
    padding: 1.2rem 0.8rem;
  }

  .intro-header .line {
    width: 100%;
    border-bottom: 1px solid var(--text-1-white);
  }

  .project-gallery-wrapper {
    padding: 1.2rem 0rem;
  }

  .project-gallery img:hover {
    transform: none;
  }
}