/* 文章頁「點圖放大」：圖片右下角的放大鏡提示 + 全螢幕檢視層。
   腳本：article-image-zoom.js。檢視層本身是深色底，亮／暗模式下外觀一致。 */

/* 包在圖片外的容器：只負責當定位基準，不改變版面（尺寸與外距由腳本從原圖複製） */
.rl-zoomable {
  position: relative;
  display: block;
  max-width: 100%;
}

.rl-zoomable--inline {
  display: inline-block;
  vertical-align: top;
}

.rl-zoomable > img.rl-zoom-src {
  margin: 0 !important;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.rl-zoomable > img.rl-zoom-src:focus-visible {
  outline: 3px solid #ec633e;
  outline-offset: 2px;
}

.rl-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 20, 24, 0.58);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transition: opacity 160ms ease;
}

.rl-zoom-hint svg {
  width: 17px;
  height: 17px;
  display: block;
}

@media (hover: hover) {
  .rl-zoomable:hover .rl-zoom-hint {
    background: rgba(20, 20, 24, 0.78);
  }
}

html.rl-zoom-lock {
  overflow: hidden;
  padding-right: var(--rl-sbw, 0px);
}

.rl-zoom {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(8, 8, 10, 0.94);
  color: #fff;
  overscroll-behavior: contain;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  animation: rl-zoom-in 160ms ease-out;
}

.rl-zoom[hidden] {
  display: none;
}

.rl-zoom-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: default;
}

.rl-zoom-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 6px;
  background: #fff;
  transform-origin: 0 0;
  will-change: transform;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
}

.rl-zoom.is-zoomed .rl-zoom-img {
  cursor: zoom-out;
}

.rl-zoom.is-dragging .rl-zoom-img {
  cursor: grabbing;
}

.rl-zoom-img.is-animating {
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.rl-zoom-close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rl-zoom-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.rl-zoom-close:focus-visible {
  outline: 3px solid #ec633e;
  outline-offset: 2px;
}

.rl-zoom-close svg {
  width: 22px;
  height: 22px;
  display: block;
}

.rl-zoom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  max-height: 26vh;
  overflow: auto;
  padding: 10px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(to top, rgba(8, 8, 10, 0.88), rgba(8, 8, 10, 0));
  pointer-events: none;
}

.rl-zoom-caption[hidden] {
  display: none;
}

@keyframes rl-zoom-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .rl-zoom { animation: none; }
  .rl-zoom-img.is-animating { transition: none; }
}
