/* btn */
.parallax .ButtonGroup,
.parallaxVideo .ButtonGroup {
  margin: 2% 0;
}

/* JS 圖片視差 KV (.parallax) */
.parallax {
  width: 100vw;
  height: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.parallax .parallax__img {
  position: relative;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
}

.parallax__content {
  position: relative;
  display: block;
  padding: 0;
  text-align: center;
}

.parallax__content-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  text-align: center;
}

.parallax__title {
  position: absolute;
  top: -200px;
  left: 0;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.parallax__subtitle {
  position: relative;
  display: block;
  padding: 20px 5% 15px 5%;
  color: #151515;
  text-shadow: none;
  margin: 0;
}

@media (min-width: 513px) {
  .parallax .parallax__img {
    height: 300px;
  }

  .parallax__title {
    top: -300px;
    height: 300px;
  }

  .parallax.has-content::after {
    height: 300px;
  }
}

/* 手機版 (768px 以下)：標題與副標題統一排在圖片下方 */
@media (max-width: 768px) {
  .parallax .parallax__img {
    transform: none !important;
  }

  .parallax__content {
    transform: none !important;
    opacity: 1 !important;
  }

  .parallax__title {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    display: block;
    color: #151515;
    text-shadow: none;
    padding: 20px 5% 0 5%;
  }

  .parallax__subtitle {
    padding: 8px 5% 15px 5%;
  }
}

@media (min-width: 769px) {
  .parallax {
    height: 300px;
    display: block;
  }

  .parallax .parallax__img {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .parallax__content {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    padding: 5% 10%;
  }

  /*
   * 後台可在 parallax__content 加上以下任一 class 控制桌機版內容位置：
   * top-left / top-center / top-right
   * center-left / center / center-right
   * bottom-left / bottom-center / bottom-right
   */
  .parallax__content--top-left,
  .parallax__content--center-left,
  .parallax__content--bottom-left {
    justify-content: start;
    justify-items: start;
  }

  .parallax__content--top-left .parallax__content-inner,
  .parallax__content--center-left .parallax__content-inner,
  .parallax__content--bottom-left .parallax__content-inner {
    align-items: flex-start;
    text-align: left;
  }

  .parallax__content--top-left .ButtonGroup,
  .parallax__content--center-left .ButtonGroup,
  .parallax__content--bottom-left .ButtonGroup {
    justify-content: flex-start;
  }

  .parallax__content--top-center,
  .parallax__content--center,
  .parallax__content--bottom-center {
    justify-content: center;
    justify-items: center;
    text-align: center;
  }

  .parallax__content--top-right,
  .parallax__content--center-right,
  .parallax__content--bottom-right {
    justify-content: end;
    justify-items: end;
  }

  .parallax__content--top-right .parallax__content-inner,
  .parallax__content--center-right .parallax__content-inner,
  .parallax__content--bottom-right .parallax__content-inner {
    align-items: flex-end;
    text-align: right;
  }

  .parallax__content--top-right .ButtonGroup,
  .parallax__content--center-right .ButtonGroup,
  .parallax__content--bottom-right .ButtonGroup {
    justify-content: flex-end;
  }

  .parallax__content--top-left,
  .parallax__content--top-center,
  .parallax__content--top-right {
    align-content: start;
  }

  .parallax__content--center-left,
  .parallax__content--center,
  .parallax__content--center-right {
    align-content: center;
  }

  .parallax__content--bottom-left,
  .parallax__content--bottom-center,
  .parallax__content--bottom-right {
    align-content: end;
  }

  .parallax__title {
    position: static;
    width: auto;
    height: auto;
    display: block;
  }

  .parallax__subtitle {
    position: static;
    display: block;
    padding: 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  .parallax.has-content::after {
    height: 100%;
    inset: 0;
  }
}

@media (min-width: 1024px) {
  .parallax {
    height: 410px;
  }
}

@media (min-width: 1300px) {
  .parallax {
    height: 700px;
  }
}

@media (min-width: 2000px) {
  .parallax {
    height: 70vh;
  }
}


/* JS 影片視差 KV (.parallaxVideo) - 桌機 90vh / 手機 16:9 */
.parallaxVideo {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* 手機版：16:9 等比例影片 */
.parallaxVideo .parallaxVideo__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: center;
  opacity: 0.85;
  will-change: transform;
  z-index: 0;
}

/* 2px 數碼網格遮罩 */
.parallaxVideo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 1px, transparent 1px);
  background-size: 2px 2px;
  pointer-events: none;
  z-index: 1;
}

/* 手機版內容容器 */
.parallaxVideo__content {
  position: static;
  display: block;
  padding: 0;
  text-align: center;
}

.parallaxVideo__content-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  text-align: center;
}

.parallaxVideo__title {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 2;
  box-sizing: border-box;
}

.parallaxVideo__subtitle {
  position: relative;
  display: block;
  padding: 20px 5% 15px 5%;
  color: #151515;
  text-shadow: none;
  margin: 0;
}

/* 📱 手機版 (768px 以下)：影片標題與副標題統一排在影片下方 */
@media (max-width: 768px) {
  .parallaxVideo .parallaxVideo__video {
    transform: none !important;
  }

  .parallaxVideo__content {
    transform: none !important;
    opacity: 1 !important;
  }

  .parallaxVideo__title {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    display: block;
    color: #151515;
    text-shadow: none;
    padding: 20px 5% 0 5%;
  }

  .parallaxVideo__subtitle {
    padding: 8px 5% 15px 5%;
  }
}

/* 桌機版 (769px 以上)：高度 90vh */
@media (min-width: 769px) {
  .parallaxVideo {
    height: 90vh;
    aspect-ratio: auto;
    display: block;
  }

  .parallaxVideo .parallaxVideo__video {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .parallaxVideo__content {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    padding: 5% 10%;
    z-index: 2;
  }

  /* 影片版後台九宮格內容位置 */
  .parallaxVideo__content--top-left,
  .parallaxVideo__content--center-left,
  .parallaxVideo__content--bottom-left {
    justify-content: start;
    justify-items: start;
  }

  .parallaxVideo__content--top-left .parallaxVideo__content-inner,
  .parallaxVideo__content--center-left .parallaxVideo__content-inner,
  .parallaxVideo__content--bottom-left .parallaxVideo__content-inner {
    align-items: flex-start;
    text-align: left;
  }

  .parallaxVideo__content--top-left .ButtonGroup,
  .parallaxVideo__content--center-left .ButtonGroup,
  .parallaxVideo__content--bottom-left .ButtonGroup {
    justify-content: flex-start;
  }

  .parallaxVideo__content--top-center,
  .parallaxVideo__content--center,
  .parallaxVideo__content--bottom-center {
    justify-content: center;
    justify-items: center;
  }

  .parallaxVideo__content--top-right,
  .parallaxVideo__content--center-right,
  .parallaxVideo__content--bottom-right {
    justify-content: end;
    justify-items: end;
  }

  .parallaxVideo__content--top-right .parallaxVideo__content-inner,
  .parallaxVideo__content--center-right .parallaxVideo__content-inner,
  .parallaxVideo__content--bottom-right .parallaxVideo__content-inner {
    align-items: flex-end;
    text-align: right;
  }

  .parallaxVideo__content--top-right .ButtonGroup,
  .parallaxVideo__content--center-right .ButtonGroup,
  .parallaxVideo__content--bottom-right .ButtonGroup {
    justify-content: flex-end;
  }

  .parallaxVideo__content--top-left,
  .parallaxVideo__content--top-center,
  .parallaxVideo__content--top-right {
    align-content: start;
  }

  .parallaxVideo__content--center-left,
  .parallaxVideo__content--center,
  .parallaxVideo__content--center-right {
    align-content: center;
  }

  .parallaxVideo__content--bottom-left,
  .parallaxVideo__content--bottom-center,
  .parallaxVideo__content--bottom-right {
    align-content: end;
  }

  .parallaxVideo__title {
    position: static;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    display: block;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  .parallaxVideo__subtitle {
    position: static;
    display: block;
    padding: 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  .parallaxVideo::before,
  .parallaxVideo.has-content::after {
    height: 100%;
    aspect-ratio: auto;
    inset: 0;
  }
}
