/* Sách 3D (js/features/book3d.js). Chỉ áp dụng khi JS gắn lớp .book3d-active cho #hoi-uc */
#hoi-uc.book3d-active .book-stage { padding: 0 clamp(8px, 2vw, 32px); }
#hoi-uc.book3d-active .book-wrap { width: min(1500px, 92vw); flex: none; }
#hoi-uc.book3d-active .book-wrap::after { display: none; }
#hoi-uc.book3d-active .book-arrow { position: absolute; top: 50%; z-index: 3; translate: 0 -50%; transition: opacity .4s, background .3s, color .3s, transform .3s; }
#hoi-uc.book3d-active .book-arrow--prev { left: max(8px, calc(50% - min(750px, 46vw) - 26px)); }
#hoi-uc.book3d-active .book-arrow--next { right: max(8px, calc(50% - min(750px, 46vw) - 26px)); }

#hoi-uc .book.book3d {
  position: relative;
  width: 100%;
  height: min(90vh, 64vw);
  min-height: 300px;
  margin: 0 auto;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
#hoi-uc .book.book3d:focus-visible { outline: 3px solid #fff; outline-offset: 6px; border-radius: 12px; }
#hoi-uc .book3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }

#hoi-uc .book3d-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

#hoi-uc .book3d-loading {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  color: #fff; font-weight: 600; letter-spacing: .02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

@media (max-width: 899px) {
  #hoi-uc.book3d-active .book-stage { padding: 0; }
  #hoi-uc.book3d-active .book-wrap { width: 100%; }
  #hoi-uc .book.book3d { height: clamp(260px, 78vw, 72vh); min-height: 0; }
  #hoi-uc.book3d-active .book-arrow { top: auto; bottom: -62px; translate: none; width: 46px; height: 46px; }
  #hoi-uc.book3d-active .book-arrow--prev { left: calc(50% - 64px); }
  #hoi-uc.book3d-active .book-arrow--next { right: calc(50% - 64px); }
  #hoi-uc.book3d-active .book-controls { margin-top: 92px; }
}
