/**
 * MDD 圖片燈箱樣式（搭配 assets/js/lightbox.js）
 * 只在單篇文章／頁面載入。命名空間 .mds-lb，與站內其他樣式隔離。
 */

/* 開啟燈箱時鎖住背景捲動 */
html.mds-lb-lock { overflow: hidden; }

/* 可點擊放大的圖片 */
.mds-zoomable { cursor: zoom-in; }

.mds-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  background: rgba(20, 16, 10, .93);
  -webkit-user-select: none;
  user-select: none;
}
.mds-lb.is-on { display: block; }

.mds-lb__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.mds-lb__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .55);
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
  cursor: zoom-in;
  -webkit-user-drag: none;
}

/* 控制鈕 */
.mds-lb__btn {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  border: 1.5px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.mds-lb__btn:hover,
.mds-lb__btn:focus-visible { background: rgba(0, 0, 0, .72); border-color: #fff; outline: none; }
.mds-lb__close { top: 16px; right: 16px; }

/* 底部資訊列：張數 + 圖說 */
.mds-lb__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 18px 18px;
  text-align: center;
  pointer-events: none;
}
.mds-lb__cap {
  display: inline-block;
  max-width: 90%;
  padding: 8px 14px;
  color: #f3ead7;
  font-family: 'LXGW WenKai TC', 'Noto Serif TC', serif;
  font-size: 14px;
  line-height: 1.5;
  background: rgba(0, 0, 0, .5);
  border-radius: 8px;
}
.mds-lb__cap:empty { display: none; }

/* 載入中轉圈 */
.mds-lb__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: mds-lb-spin .8s linear infinite;
}
.mds-lb__spinner.is-on { display: block; }
@keyframes mds-lb-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .mds-lb__btn { width: 40px; height: 40px; font-size: 22px; }
  .mds-lb__img { max-width: 96vw; max-height: 84vh; }
}
@media (prefers-reduced-motion: reduce) {
  .mds-lb__spinner { animation: none; }
}
