/* 宣傳資料頁圖片燈箱（chi / eng / sim publicity.html） */

.publicity-lightbox {
  /* 固定稿面：遮罩 1440×1131（148+752+24+125+82）；主視圖 1250×752；縮略圖 226×125；內邊距 上148 右92 下82 左98 */
  --lb-max-w: 1440px;
  --lb-main-max-w: 1250px;
  --lb-main-max-h: 752px;
  --lb-thumb-w: 226px;
  --lb-thumb-h: 125px;
  --lb-pad-top: 148px;
  --lb-pad-right: 92px;
  --lb-pad-bottom: 82px;
  --lb-pad-left: 98px;
  --lb-main-thumb-gap: 24px;
  --lb-dialog-h: 1131px;
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

@media (max-width: 991px) {
  .publicity-lightbox {
    padding: 0;
  }
}

.publicity-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* 全屏透明層：攔截點擊；左右空白區點擊可關閉 */
.publicity-lightbox__underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
}

/* 鋪滿對話框（主圖列 + 縮略圖列），與內容同高 */
.publicity-lightbox__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  box-sizing: border-box;
  margin: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.publicity-lightbox__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: var(--lb-main-max-h) var(--lb-thumb-h);
  row-gap: var(--lb-main-thumb-gap);
  padding: var(--lb-pad-top) var(--lb-pad-right) var(--lb-pad-bottom) var(--lb-pad-left);
  width: var(--lb-max-w);
  height: var(--lb-dialog-h);
  max-width: none;
  max-height: none;
  min-height: var(--lb-dialog-h);
  margin: 0;
  transform: translate(-50%, -50%) scale(var(--lb-scale, 1));
  transform-origin: center center;
  pointer-events: none;
  overflow: hidden;
}

.publicity-lightbox__dialog > * {
  pointer-events: auto;
}

.publicity-lightbox__close {
  position: absolute;
  top: 59px;
  right: 36px;
  z-index: 3;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  box-shadow: none;
}

.publicity-lightbox__close:hover {
  opacity: 0.85;
}

.publicity-lightbox__close:focus {
  outline: none;
}

.publicity-lightbox__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.publicity-lightbox__close img {
  width: 42px;
  height: 42px;
  display: block;
}

.publicity-lightbox__stage-wrap {
  z-index: 1;
  grid-row: 1;
  grid-column: 1;
  width: var(--lb-main-max-w);
  height: var(--lb-main-max-h);
  max-width: var(--lb-main-max-w);
  max-height: var(--lb-main-max-h);
  justify-self: center;
  align-self: start;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.publicity-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 100px;
  height: 100px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publicity-lightbox__nav:hover {
  opacity: 0.85;
}

.publicity-lightbox__nav:focus {
  outline: none;
}

.publicity-lightbox__nav:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.publicity-lightbox__nav img {
  width: 100px;
  height: 100px;
  display: block;
}

.publicity-lightbox__nav--prev {
  left: 0;
}

.publicity-lightbox__nav--next {
  right: 0;
}

.publicity-lightbox__stage {
  width: 100%;
  height: 100%;
  max-width: var(--lb-main-max-w);
  max-height: var(--lb-main-max-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 112px;
  box-sizing: border-box;
  overflow: hidden;
}

.publicity-lightbox__main {
  max-width: var(--lb-main-max-w);
  max-height: var(--lb-main-max-h);
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}

.publicity-lightbox__thumbs {
  position: relative;
  z-index: 1;
  grid-row: 2;
  grid-column: 1;
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 30px;
  width: var(--lb-main-max-w);
  height: var(--lb-thumb-h);
  min-height: var(--lb-thumb-h);
  max-height: var(--lb-thumb-h);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  margin: 0;
  justify-self: center;
  align-self: start;
  justify-content: flex-start;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
}

.publicity-lightbox__thumbs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.publicity-lightbox__thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
}

.publicity-lightbox__thumbs.is-dragging {
  cursor: grabbing;
}

.publicity-lightbox__thumb {
  flex: 0 0 auto;
  width: var(--lb-thumb-w);
  height: var(--lb-thumb-h);
  padding: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  opacity: 1;
  transition: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publicity-lightbox__thumb:hover,
.publicity-lightbox__thumb:focus {
  outline: none;
}

.publicity-lightbox__thumb.is-active {
  opacity: 1;
}

.publicity-lightbox__thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

body.publicity-lightbox-open {
  overflow: hidden;
}
