.book-detail-main {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 74px 70px 104px;
}

.book-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(260px, .92fr);
  align-items: start;
  gap: clamp(44px, 5.2vw, 82px);
}

.book-preview h2 {
  margin: 0 0 20px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 400;
}

.spread-stage,
.dialog-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 888 / 693;
  background: #f6f5f3;
  box-shadow: -9px 12px 18px rgba(0, 0, 0, .12);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y pinch-zoom;
}

.spread-stage.cover-page,
.dialog-stage.cover-page {
  box-shadow: none;
}

.spread-canvas,
.spread-reveal,
.dialog-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spread-canvas,
.dialog-canvas {
  position: relative;
  z-index: 0;
  outline: none;
}

.spread-canvas:focus-visible {
  outline: 2px solid #777;
  outline-offset: 3px;
}

.spread-reveal {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.spread-reveal canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.spread-reveal.turn-next,
.spread-reveal.turn-prev {
  opacity: 1;
}

.spread-reveal::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 16px;
  opacity: .52;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .17), rgba(255, 255, 255, .48) 43%, rgba(0, 0, 0, .05));
  filter: blur(1.2px);
}

.spread-reveal.turn-next {
  animation: reveal-from-right .34s cubic-bezier(.22, .68, .22, 1) both;
}

.spread-reveal.turn-next::after {
  animation: edge-from-right .34s cubic-bezier(.22, .68, .22, 1) both;
}

.spread-reveal.turn-prev {
  animation: reveal-from-left .34s cubic-bezier(.22, .68, .22, 1) both;
}

.spread-reveal.turn-prev::after {
  animation: edge-from-left .34s cubic-bezier(.22, .68, .22, 1) both;
}

@keyframes reveal-from-right {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes edge-from-right {
  from { left: calc(100% - 16px); }
  to { left: 0; }
}

@keyframes reveal-from-left {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes edge-from-left {
  from { left: 0; }
  to { left: calc(100% - 16px); }
}

.preview-controls,
.dialog-controls {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 17px;
}

.spread-arrow,
.enlarge-button,
.dialog-close {
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.spread-arrow {
  min-width: 28px;
  font-size: 23px;
  line-height: 1;
}

.spread-arrow:disabled {
  opacity: .28;
  cursor: default;
}

.spread-count,
.dialog-count {
  min-width: 36px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.enlarge-button,
.dialog-close {
  margin-left: auto;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.reader-hint {
  margin: 0;
  color: #565656;
  font-size: 13px;
  line-height: 1.45;
}

.book-information {
  position: sticky;
  top: 48px;
  align-self: start;
  padding-top: 47px;
}

.book-information-inner {
  max-width: 390px;
}

.book-information h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 400;
}

.book-information-author {
  margin: 10px 0 29px;
  font-size: 17px;
  line-height: 1.35;
}

.book-facts {
  margin: 0;
  border-top: 1px solid #d5d5d5;
  font-size: 14px;
  line-height: 1.42;
}

.book-facts > div {
  display: grid;
  grid-template-columns: minmax(96px, .82fr) minmax(0, 1.25fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #dedede;
}

.book-facts dt {
  color: #555;
}

.book-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.preorder-action {
  display: inline-block;
  min-width: 164px;
  margin-top: 26px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  text-align: center;
  font-size: 15px;
  line-height: 1.2;
}

.preorder-action:hover,
.preorder-action:focus-visible {
  text-decoration: none;
  background: #f6f6f6;
}

.spread-dialog {
  position: fixed;
  width: min(96vw, 1740px);
  max-width: none;
  max-height: none;
  height: 100dvh;
  margin: auto;
  padding: 20px clamp(12px, 3vw, 44px) 14px;
  inset: 0;
  border: 0;
  background: #fff;
  color: #111;
  overflow: auto;
}

.spread-dialog::backdrop {
  background: rgba(0, 0, 0, .78);
}

.dialog-toolbar {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 12px;
}

.dialog-count {
  text-align: left;
}

.dialog-zoom {
  appearance: none;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}

.dialog-stage {
  width: min(100%, calc((100dvh - 112px) * 1.28125));
  margin: 0 auto;
}

.dialog-canvas {
  width: 100%;
  height: 100%;
}

.dialog-controls {
  justify-content: center;
  width: min(100%, calc((100dvh - 112px) * 1.28125));
  margin: 0 auto;
}

.dialog-controls .spread-arrow:last-child {
  margin-right: auto;
}

.spread-dialog.is-zoomed .dialog-stage,
.spread-dialog.is-zoomed .dialog-controls {
  width: min(100%, 1600px);
}

.dialog-controls .spread-arrow:first-child {
  margin-left: auto;
}

@media (max-width: 900px) {
  .book-detail-main {
    padding: 58px 36px 80px;
  }

  .book-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .book-information {
    position: static;
    padding-top: 0;
  }

  .book-information-inner {
    max-width: 650px;
  }

  .book-information h1 {
    max-width: 620px;
  }

  .book-facts > div {
    grid-template-columns: minmax(130px, .5fr) minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .book-detail-main {
    padding: 47px 22px 68px;
  }

  .book-detail-grid {
    gap: 33px;
  }

  .book-preview h2 {
    margin-bottom: 14px;
  }

  .spread-stage {
    box-shadow: -6px 8px 13px rgba(0, 0, 0, .12);
  }

  .preview-controls {
    gap: 13px;
    min-height: 44px;
  }

  .reader-hint {
    font-size: 12px;
  }

  .book-information h1 {
    max-width: 450px;
  }

  .book-information-author {
    margin-bottom: 21px;
  }

  .book-facts {
    font-size: 13px;
  }

  .book-facts > div {
    grid-template-columns: minmax(112px, .85fr) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
  }

  .preorder-action {
    margin-top: 21px;
  }

  .spread-dialog {
    padding: 12px 10px 8px;
  }

  .dialog-stage {
    width: min(100%, calc((100dvh - 92px) * 1.28125));
  }

  .dialog-controls {
    width: min(100%, calc((100dvh - 92px) * 1.28125));
  }

  .spread-dialog.is-zoomed .dialog-stage,
  .spread-dialog.is-zoomed .dialog-controls {
    width: max(100%, 620px);
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 760px) {
  .book-preview h2,
  .book-information h1 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spread-reveal.turn-next,
  .spread-reveal.turn-next::after,
  .spread-reveal.turn-prev,
  .spread-reveal.turn-prev::after {
    animation-duration: 1ms;
  }
}
