/* 《漂染概論》立體書 —— 嵌入用樣式。只負責版面；canvas 疊在底層、不吃事件，
   上面是一張真的 <img> 當海報（沒有 WebGL 時的畫面），最上面是一個真的 <a> 連到購買頁。 */

.bleach-book {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* 預設高度；要改就在你的頁面覆蓋這個選擇器 */
  height: clamp(360px, 62vw, 560px);
  touch-action: pan-y;
}

.bleach-book__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 海報：WebGL 起來之後淡出，元素留著（alt 與無障礙靠它）。高度由程式依實際相機距離設定。 */
.bleach-book__poster {
  position: relative;
  z-index: 1;
  height: 82%;
  width: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 26px 64px rgba(3, 16, 32, 0.5);
  transition: opacity 0.5s ease; /* 要跟 book3d.js 的 POSTER_FADE_MS 對得上 */
}

.bleach-book__poster.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* 拖曳 ＋ 點擊購買的那一層。跟海報一樣大，疊在正中間。 */
.bleach-book__link {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  height: 82%;
  aspect-ratio: 1 / 1.4142;
  width: auto;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bleach-book__link:active {
  cursor: grabbing;
}

.bleach-book__link:focus-visible {
  outline: 2px solid #dceff2;
  outline-offset: 10px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .bleach-book__poster {
    transition: none;
  }
}
