/* ============================================
   首頁彈出視窗 (.modal-atuo) - 影片 / 圖片 共用
   ============================================ */

/* 鎖定背景捲動 */
body.modal-show {
  overflow: hidden;
}

.modal-atuo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* 避免行動裝置網址列造成的高度誤差 */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

/* 內容容器：包住影片/圖片 + 了解更多按鈕，子元素撐滿寬度後各自對齊 */
.modal-atuo .modal-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  max-width: 95vw;
  max-height: 90dvh;
}

/* ---------- 影片模式：維持 16:9，限制在視窗內 ---------- */
.modal-atuo .modal-video {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  max-height: 80dvh;
}

.modal-atuo .modal-video #videoPlayer,
.modal-atuo .modal-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 圖片模式：不論直式/橫式，等比縮放完整顯示於視窗內 ---------- */
.modal-atuo .modal-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-atuo .modal-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 75dvh;
  object-fit: contain; /* 依比例縮放，不裁切、不變形 */
}

/* ---------- 了解更多 + 關閉按鈕：一起位於內容下方最右側（與影片/圖片右邊界切齊） ---------- */
.modal-atuo .modal-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  width: 100%;
  gap: 12px;
}

.modal-atuo .modal-close {
  cursor: pointer;
}

.modal-atuo .modal-link {
  cursor: pointer;
}

/* ============================================
   RWD 斷點
   ============================================ */
@media (max-width: 991px) {
  .modal-atuo .modal-video {
    width: 92vw;
  }
}

@media (max-width: 576px) {
  .modal-atuo .modal-video {
    width: 95vw;
    max-height: 70dvh;
  }
}
