/*
 * ThinkPPT Book Exhibition
 *
 * A presentation layer for the existing IP series and proposal reader.
 * Load after ratio-reader.css. Uses the existing archive assets and reader markup.
 */

:root {
  --paper: #ffffff;
  --ink: #11110f;
  --muted: #6d6d68;
  --line: rgba(17, 17, 15, 0.14);
}

.series-browser,
.proposal-reader {
  --exhibition-paper: #f8f8f6;
  --exhibition-paper-light: #ffffff;
  --exhibition-wall: #fbfbfa;
  --exhibition-ink: #11110f;
  --exhibition-muted: #6d6d68;
  --exhibition-rule: rgba(17, 17, 15, 0.13);
  --exhibition-rule-strong: rgba(17, 17, 15, 0.3);
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--exhibition-ink);
  background: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}

.proposal-reader {
  --exhibition-paper: #ffffff;
  --exhibition-wall: #ffffff;
}

.series-browser::backdrop,
.proposal-reader::backdrop {
  background: rgba(22, 20, 16, 0.52);
  backdrop-filter: none;
}

.series-shell,
.reader-shell {
  width: 100%;
  height: 100%;
  border: 0;
  color: var(--exhibition-ink);
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  isolation: isolate;
}

.series-shell,
.reader-shell {
  grid-template-rows: 64px minmax(0, 1fr);
}

.series-browser[open] .series-shell,
.proposal-reader[open] .reader-shell {
  animation: exhibitionPageEnter 420ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
}

.series-browser.is-book-transitioning .series-shell,
.proposal-reader.is-book-transitioning .reader-shell {
  animation: none;
}

/* Keep the IP page stable after the shared-cover proxy hands off. Without
   this persistent state the normal page-enter animation restarted when the
   temporary `is-book-transitioning` class was removed. */
.series-browser.has-shared-transition[open] .series-shell {
  animation: none;
}

@keyframes exhibitionPageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shared cover proxy: one sharp image, no fake page block or drop shadow. */
.book-transition-clone {
  position: fixed;
  z-index: 30;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
  transform: none;
  transform-origin: top left;
  opacity: 1;
  will-change: transform, opacity;
}

.book-transition-cover {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  object-fit: cover;
  background: transparent;
}

.series-header,
.reader-header {
  position: relative;
  z-index: 5;
  min-width: 0;
  min-height: 64px;
  padding: 0 clamp(20px, 2.7vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--exhibition-rule);
  background: rgba(255, 255, 255, 0.98);
}

.reader-breadcrumb {
  min-width: 0;
  gap: 12px;
  color: var(--exhibition-muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.reader-breadcrumb i {
  flex-basis: 22px;
  background: var(--exhibition-rule-strong);
}

.reader-header-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.reader-back {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 clamp(12px, 1.7vw, 24px) 0 0;
  border: 0;
  border-right: 1px solid var(--exhibition-rule);
  color: var(--exhibition-ink);
  background: transparent;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.15em;
  cursor: pointer;
}

.reader-back:hover,
.reader-back:focus-visible {
  color: var(--exhibition-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  outline: 0;
}

.reader-close,
.series-close {
  min-height: 36px;
  padding: 0 0 0 18px;
  color: var(--exhibition-ink);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--exhibition-rule);
  border-radius: 0;
  font-size: 7px;
  letter-spacing: 0.18em;
}

.reader-close span,
.series-close span {
  font-size: 20px;
}

.reader-close:hover,
.series-close:hover,
.reader-close:focus-visible,
.series-close:focus-visible {
  color: var(--exhibition-paper-light);
  background: var(--exhibition-ink);
  outline: 0;
  box-shadow: 12px 0 0 var(--exhibition-ink);
}

/* IP exhibition index ------------------------------------------------ */

.series-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  /* Keep the information rail editorial and compact; the six-character title
     fits through optical sizing rather than consuming the gallery width. */
  grid-template-columns: clamp(300px, 21vw, 440px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: #fff;
}

.series-overview {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(38px, 5vh, 66px) clamp(32px, 2.6vw, 48px) clamp(32px, 4.2vh, 52px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 34px;
  border-right: 1px solid var(--exhibition-rule);
  border-bottom: 0;
  color: var(--exhibition-ink);
  background: #f8f8f6;
}

.series-overview::before {
  content: "";
  position: absolute;
  top: clamp(42px, 5.6vh, 72px);
  left: 0;
  bottom: auto;
  width: 3px;
  height: clamp(72px, 11vh, 112px);
  background: var(--series-accent);
}

.series-hero-copy {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.series-hero-copy > span,
.series-hero-copy > div {
  color: var(--series-accent);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.series-hero-copy h2 {
  width: 6.15em;
  max-width: 100%;
  margin: 14px 0 20px;
  font-family: "Songti SC", Georgia, serif;
  font-size: clamp(38px, 2.6vw, 54px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  word-break: break-all;
  overflow-wrap: normal;
}

.series-hero-copy h2.is-six-character-title {
  width: auto;
  max-width: none;
  white-space: nowrap;
  font-size: clamp(38px, 2.6vw, 54px);
  letter-spacing: -0.055em;
}

.series-hero-copy > div {
  gap: 10px;
}

.series-hero-copy > div i {
  width: 36px;
  background: currentColor;
}

.series-overview > p,
.series-curatorial-note > p {
  flex: 0 0 auto;
  max-width: 24em;
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--exhibition-rule);
  color: var(--exhibition-muted);
  font-family: "Songti SC", Georgia, serif;
  font-size: 12px;
  line-height: 1.9;
  text-align: left;
}

.series-overview > p {
  margin-top: auto;
}

.series-curatorial-note {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  display: grid;
  gap: 24px;
}

.series-curatorial-note dl {
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--exhibition-rule);
}

.series-curatorial-note dl > div {
  min-height: 34px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--exhibition-rule);
}

.series-curatorial-note dt,
.series-curatorial-note dd {
  margin: 0;
}

.series-curatorial-note dt {
  color: var(--exhibition-muted);
  text-transform: uppercase;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.series-curatorial-note dd {
  overflow: hidden;
  color: var(--exhibition-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
}

.series-index-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(28px, 3.8vh, 44px) clamp(28px, 4vw, 68px) clamp(22px, 3vh, 34px);
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) 64px;
  background: #fff;
  overflow: hidden;
}

.series-index-panel > header {
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--exhibition-rule);
  color: var(--exhibition-muted);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.series-index-panel > header > span:first-child {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.series-index-panel > header b,
.series-index-panel > header em {
  font: inherit;
  font-style: normal;
}

.series-index-panel > header em {
  padding-left: 10px;
  border-left: 1px solid var(--exhibition-rule-strong);
  color: var(--exhibition-ink);
}

.series-volume-stage {
  width: 100%;
  height: 100%;
  max-height: min(52dvh, 540px);
  min-width: 0;
  min-height: 0;
  position: relative;
  align-self: center;
  justify-self: center;
  isolation: isolate;
  overflow: hidden;
  perspective: none;
  transform: none !important;
  background: transparent;
  box-shadow: inset 0 -1px 0 var(--exhibition-rule);
}

.series-volume-stage canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  perspective: none;
  transform: none !important;
  transform-style: flat;
}

.series-volume-caption {
  /* The edition rail below is the only visible title/year layer. */
  display: none;
}

.series-volume-caption em {
  color: var(--exhibition-ink);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.series-volume-caption span,
.series-volume-caption small {
  color: var(--exhibition-muted);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.series-volume-caption strong {
  font-family: "Songti SC", Georgia, serif;
  font-size: 13px;
  font-weight: 600;
}

.series-deck-list {
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  gap: 12px;
  padding: 8px 0 0;
  border-top: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.series-deck {
  flex: 0 0 clamp(300px, 31%, 370px);
  max-width: 370px;
  height: 50px;
  min-width: 0;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 78px;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  border: 0;
  border-top: 1px solid var(--exhibition-rule-strong);
  border-right: 0;
  border-radius: 0;
  color: var(--exhibition-muted);
  background: transparent;
  scroll-snap-align: start;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.series-deck:first-child {
  border-left: 0;
}

.series-deck span {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.series-deck strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Songti SC", Georgia, serif;
  font-size: 11px;
  font-weight: 600;
}

.series-deck small {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  overflow: hidden;
  color: var(--exhibition-muted);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.series-deck:hover,
.series-deck:focus-visible {
  border-color: var(--exhibition-rule-strong);
  color: var(--exhibition-ink);
  background: #f7f7f5;
  outline: 0;
  box-shadow: inset 0 2px 0 var(--exhibition-ink);
}

.series-deck.is-active {
  border-color: var(--exhibition-rule-strong);
  color: var(--exhibition-ink);
  background: #f7f7f5;
  box-shadow: inset 0 2px 0 var(--exhibition-ink);
}

/* One object: a left-weighted acquisition with honest space for future years. */
.series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-stage {
  width: min(64%, 900px);
  max-height: min(60dvh, 620px);
  justify-self: start;
}

.series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-caption {
  left: 14px;
  width: min(84%, 620px);
  transform: none;
}

.series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-deck-list {
  width: min(64%, 680px);
  justify-self: start;
}

.series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-deck {
  flex: 1 1 100%;
  max-width: none;
}

.series-single-note {
  display: none;
}

.series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-single-note {
  position: absolute;
  top: 50%;
  right: clamp(30px, 5.2vw, 82px);
  width: min(18vw, 220px);
  padding-top: 14px;
  display: block;
  border-top: 1px solid var(--exhibition-rule-strong);
  color: var(--exhibition-muted);
  transform: translateY(-42%);
}

.series-single-note span {
  display: block;
  margin-bottom: 11px;
  color: var(--exhibition-ink);
  text-transform: uppercase;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.series-single-note p {
  margin: 0;
  font-family: "Songti SC", Georgia, serif;
  font-size: 10px;
  line-height: 1.8;
}

/* Two objects: a balanced pair with one shared year rail. */
.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-volume-stage {
  width: min(96%, 1240px);
  max-height: min(49dvh, 510px);
}

.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-volume-caption {
  left: 50%;
  width: min(90%, 820px);
  transform: translateX(-50%);
}

.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-deck-list {
  width: min(88%, 860px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: center;
}

.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-deck {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: none;
}

/* Three covers and their edition labels share one centre grid. */
.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(3)) .series-deck-list {
  width: 92%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-self: center;
}

.series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(3)) .series-deck {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: none;
}

/* Three or more objects: a panoramic, scrollable exhibition run. */
.series-index-panel:has(.series-deck-list > .series-deck:nth-child(3)) .series-volume-stage {
  width: 100%;
  max-height: min(51dvh, 530px);
}

/* Proposal gallery --------------------------------------------------- */

.reader-content {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: clamp(300px, 23vw, 388px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  background: #fff;
  overflow: hidden;
}

.reader-book-column {
  min-width: 0;
  min-height: 0;
  padding: clamp(34px, 5vh, 66px) clamp(36px, 5vw, 84px) clamp(30px, 4.4vh, 60px);
  display: grid;
  place-items: center;
  border-left: 1px solid var(--exhibition-rule);
  background: #fff;
  overflow: hidden;
}

.reader-presentation {
  width: min(100%, 1220px);
  min-width: 0;
  display: grid;
  gap: 14px;
}

.reader-book {
  --reader-aspect: 16 / 9;
  --reader-accent: #25241f;
  width: 100%;
  max-width: none;
  min-width: 0;
  display: grid;
  grid-template-columns: clamp(38px, 3.3vw, 52px) minmax(0, 1fr);
  align-items: stretch;
  perspective: none;
  transform: none !important;
  transform-style: flat;
  filter: none;
}

.reader-spine {
  min-height: 0;
  height: 100%;
  padding: 14px 0;
  border: 0;
  border-radius: 1px 0 0 1px;
  box-shadow:
    inset -4px 0 7px rgba(0, 0, 0, 0.13),
    inset 1px 0 2px rgba(255, 255, 255, 0.12);
}

.reader-stage {
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: var(--reader-aspect);
  position: relative;
  padding: 0;
  display: block;
  border: 0;
  overflow: hidden;
  perspective: none;
  transform: none !important;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 15, 0.07);
}

.reader-stage iframe,
.reader-cover-preview,
.reader-page-viewer,
.reader-page-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reader-stage iframe,
.reader-cover-preview {
  transform: none !important;
}

.reader-cover-preview {
  object-fit: cover;
}

.reader-page-edge-right {
  display: none;
}

.reader-page-edge-bottom {
  display: none;
}

.reader-binding-crease {
  left: 0;
  width: clamp(12px, 1.8%, 24px);
  background: linear-gradient(90deg, rgba(17, 17, 15, 0.18), rgba(17, 17, 15, 0.045) 42%, transparent);
  opacity: 0.5;
  pointer-events: none;
}

.reader-loading {
  z-index: 5;
  background: #fff;
}

.reader-page-viewer {
  z-index: 3;
  overflow: hidden;
  background: #fff;
  transform-style: preserve-3d;
}

#readerPageViewer .proposal-page-reader {
  width: 100%;
  height: 100%;
  gap: 0;
}

#readerPageViewer .proposal-page-reader__stage {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  box-shadow: none;
}

#readerPageViewer .proposal-page-reader__controls {
  display: none;
}

#readerPageViewer .proposal-page-reader__unavailable {
  border: 0;
}

.reader-page-viewer[hidden],
.reader-page-canvas[hidden],
.reader-frame-fallback[hidden] {
  display: none !important;
}

.reader-page-canvas {
  z-index: 2;
  display: block;
  object-fit: contain;
  background: #fff;
  transform-origin: left center !important;
  backface-visibility: hidden;
}

.reader-page-canvas-next {
  z-index: 1;
}

.reader-page-zone {
  position: absolute;
  z-index: 6;
  top: 0;
  bottom: 0;
  width: 20%;
  padding: 0;
  border: 0;
  color: var(--exhibition-ink);
  background: transparent;
  cursor: pointer;
}

.reader-page-zone-prev {
  left: 0;
}

.reader-page-zone-next {
  right: 0;
}

.reader-page-zone span {
  position: absolute;
  bottom: 14px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  text-transform: uppercase;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.reader-page-zone-prev span {
  left: 14px;
}

.reader-page-zone-next span {
  right: 14px;
}

.reader-page-zone:hover span,
.reader-page-zone:focus-visible span {
  opacity: 1;
}

.reader-page-zone:focus-visible {
  outline: 1px solid rgba(17, 17, 15, 0.3);
  outline-offset: -3px;
}

.reader-page-toolbar {
  min-height: 28px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--exhibition-rule);
  color: var(--exhibition-muted);
}

.reader-page-toolbar button,
.reader-page-toolbar span {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-transform: uppercase;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.reader-page-toolbar button {
  min-height: 28px;
  cursor: pointer;
}

.reader-page-toolbar button:hover,
.reader-page-toolbar button:focus-visible {
  color: var(--exhibition-ink);
  outline: 0;
}

.reader-page-toolbar button:disabled {
  opacity: 0.28;
  cursor: default;
}

#readerPagePosition {
  color: var(--exhibition-ink);
  font-family: Georgia, serif;
  font-style: italic;
  letter-spacing: 0.04em;
}

#readerPageStatus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-details {
  min-width: 0;
  max-height: 100%;
  margin: 0;
  padding: clamp(38px, 5vh, 66px) clamp(28px, 3.1vw, 48px) clamp(32px, 4.2vh, 52px);
  align-self: center;
  display: flex;
  flex-direction: column;
  border: 0;
  color: var(--exhibition-ink);
  background: #fff;
  box-shadow: none;
  overflow: auto;
}

.reader-kicker {
  color: var(--exhibition-muted);
  font-size: 7px;
  letter-spacing: 0.2em;
}

.reader-accession {
  margin-top: 8px;
  color: var(--exhibition-ink);
  font-family: Georgia, serif;
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.reader-details h2 {
  margin: clamp(18px, 2.8vh, 30px) 0 16px;
  font-family: "Songti SC", Georgia, serif;
  font-size: clamp(29px, 2.6vw, 44px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* Desktop titles use a deliberate six-character measure. `balance` was
   redistributing ten-character Chinese titles into two five-character lines,
   even though the column had enough physical width for six. */
@media (min-width: 821px) {
  .reader-details h2 {
    inline-size: 6em;
    max-inline-size: 100%;
    text-wrap: wrap;
    word-break: break-all;
    overflow-wrap: normal;
  }
}

.reader-details > p {
  margin: 0 0 clamp(24px, 3.6vh, 38px);
  color: var(--exhibition-muted);
  font-family: "Songti SC", Georgia, serif;
  font-size: 11px;
  line-height: 1.85;
}

.reader-details dl {
  border-top: 1px solid var(--exhibition-rule);
}

.reader-details dl > div {
  min-height: 41px;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(24, 23, 19, 0.085);
}

.reader-details dt {
  color: var(--exhibition-muted);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.reader-details dd {
  color: var(--exhibition-ink);
  font-size: 10px;
  font-weight: 700;
}

.reader-edition-nav {
  min-height: 40px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid var(--exhibition-rule);
  border-bottom: 0;
}

.reader-edition-nav button,
.reader-edition-nav span {
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--exhibition-muted);
  background: transparent;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.reader-edition-nav button {
  min-height: 38px;
  cursor: pointer;
}

.reader-edition-nav button:first-child {
  text-align: left;
}

.reader-edition-nav button:last-child {
  text-align: right;
}

.reader-edition-nav button:hover,
.reader-edition-nav button:focus-visible {
  color: var(--exhibition-ink);
  outline: 0;
}

.reader-edition-nav button:disabled {
  opacity: 0.32;
  cursor: default;
}

.reader-edition-nav span {
  padding-inline: 12px;
  color: var(--exhibition-ink);
  font-family: Georgia, serif;
  font-style: italic;
  letter-spacing: 0.02em;
}

.reader-details > a {
  min-height: 46px;
  margin-top: clamp(18px, 2.6vh, 30px);
  padding: 0 15px;
  border: 1px solid var(--exhibition-ink);
  color: var(--exhibition-paper-light);
  background: var(--exhibition-ink);
  font-size: 7px;
  letter-spacing: 0.17em;
}

.reader-details > a:hover,
.reader-details > a:focus-visible {
  color: var(--exhibition-ink);
  background: transparent;
  outline: 0;
}

.reader-details > small {
  margin-top: 12px;
  color: var(--exhibition-muted);
  font-size: 8px;
  line-height: 1.65;
}

/* Compact desktop and short exhibition rooms ------------------------ */

@media (max-width: 1100px) and (min-width: 821px) {
  .series-content {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .series-overview {
    padding-inline: 26px;
  }

  .series-hero-copy h2 {
    font-size: clamp(40px, 4.2vw, 46px);
  }

  .series-index-panel {
    padding-inline: 28px;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-stage,
  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-deck-list {
    width: 76%;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-single-note {
    display: none;
  }

  .reader-content {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .reader-book-column {
    padding-inline: 34px;
  }

  .reader-details {
    margin-inline: 0;
    padding-inline: 24px;
  }
}

@media (max-height: 700px) and (min-width: 821px) {
  .series-shell,
  .reader-shell {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .series-header,
  .reader-header {
    min-height: 54px;
  }

  .series-overview {
    padding-block: 28px;
  }

  .series-hero-copy h2 {
    margin-block: 10px 14px;
    font-size: clamp(36px, 4.6vw, 54px);
  }

  .series-overview > p {
    padding-top: 18px;
    font-size: 11px;
  }

  .series-index-panel {
    padding-block: 20px;
    grid-template-rows: 34px minmax(0, 1fr) 56px;
  }

  .reader-book-column {
    padding-block: 24px 30px;
  }

  .reader-details {
    max-height: 100%;
    margin-block: 0;
    padding-block: 22px;
  }

  .reader-details h2 {
    margin-block: 15px 10px;
    font-size: clamp(25px, 2.4vw, 34px);
  }

  .reader-details > p {
    margin-bottom: 18px;
  }

  .reader-details dl > div {
    min-height: 34px;
  }

  .reader-details > a {
    min-height: 40px;
    margin-top: 20px;
  }
}

/* Mobile exhibition ------------------------------------------------- */

@media (max-width: 820px) {
  .series-browser,
  .proposal-reader {
    width: 100vw;
    height: 100svh;
  }

  .series-shell,
  .reader-shell {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .series-header,
  .reader-header {
    min-height: 54px;
    padding: 0 16px;
  }

  .reader-breadcrumb {
    gap: 8px;
    font-size: 6px;
    letter-spacing: 0.14em;
  }

  .reader-breadcrumb i {
    flex-basis: 12px;
  }

  .reader-close,
  .series-close {
    min-height: 34px;
    padding-left: 13px;
    gap: 8px;
  }

  .series-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(126px, auto) minmax(0, 1fr);
    overflow: hidden;
  }

  .series-overview {
    min-height: 126px;
    padding: 18px 18px 16px;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--exhibition-rule);
  }

  .series-overview::before {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 18px;
    width: 68px;
    height: 2px;
  }

  .series-hero-copy h2 {
    max-width: 100%;
    margin: 8px 0 10px;
    font-size: clamp(34px, 10.5vw, 48px);
    line-height: 0.96;
  }

  .series-hero-copy > span,
  .series-hero-copy > div {
    font-size: 6px;
  }

  .series-overview > p {
    display: none;
  }

  .series-curatorial-note {
    display: none;
  }

  .series-index-panel {
    padding: 15px 16px max(14px, env(safe-area-inset-bottom));
    grid-template-rows: 29px minmax(0, 1fr) 58px;
  }

  .series-index-panel > header {
    padding-bottom: 9px;
  }

  .series-index-panel > header span:last-child {
    display: none;
  }

  .series-volume-stage,
  .series-index-panel:has(.series-deck-list > .series-deck:nth-child(3)) .series-volume-stage {
    width: 100%;
    max-height: min(34svh, 300px);
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-stage {
    width: 100%;
    max-height: min(40svh, 340px);
  }

  .series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-volume-stage {
    width: 100%;
    max-height: min(22svh, 186px);
  }

  .series-volume-caption {
    left: 4px;
    bottom: 5px;
    width: calc(100% - 8px);
    padding: 7px 9px 6px;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 8px;
    border-left-width: 1px;
  }

  .series-volume-caption small {
    display: none;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-caption {
    left: 50%;
    width: min(92%, 520px);
    transform: translateX(-50%);
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-single-note {
    display: none;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-volume-caption {
    display: none;
  }

  .series-deck-list,
  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-deck-list,
  .series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-deck-list {
    width: 100%;
  }

  .series-deck {
    flex: 0 0 min(236px, 75vw);
    max-width: 236px;
    height: 50px;
    padding-inline: 11px;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .series-deck span {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .series-deck strong {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .series-deck small {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: start;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-deck {
    flex-basis: 100%;
    max-width: none;
  }

  .series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-deck {
    flex: 1 1 50%;
    max-width: none;
  }

  .reader-content {
    min-width: 0;
    min-height: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    gap: 0;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .reader-header-nav {
    gap: 8px;
    overflow: hidden;
  }

  .reader-back {
    max-width: min(46vw, 150px);
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 6px;
    letter-spacing: 0.12em;
  }

  .reader-header .reader-breadcrumb {
    display: none;
  }

  .reader-book-column {
    min-height: 0;
    padding: clamp(24px, 5.2vh, 38px) 16px clamp(30px, 6vh, 46px);
    border-left: 0;
    border-top: 1px solid var(--exhibition-rule);
    border-bottom: 0;
    overflow: visible;
  }

  .reader-book {
    width: 100%;
    max-width: 680px;
    grid-template-columns: 28px minmax(0, 1fr);
    filter: none;
  }

  .reader-spine {
    padding-block: 9px;
  }

  .reader-spine span {
    display: none;
  }

  .reader-spine strong {
    max-height: 92px;
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .reader-page-edge-right {
    right: -6px;
    width: 5px;
  }

  .reader-page-edge-bottom {
    right: -6px;
    bottom: -4px;
    height: 3px;
  }

  .reader-details {
    max-height: none;
    margin: 0;
    padding: 28px 21px 22px;
    align-self: auto;
    border: 0;
    background: #fff;
    box-shadow: none;
    overflow: visible;
  }

  .reader-details h2 {
    margin: 18px 0 13px;
    font-size: clamp(27px, 8.2vw, 38px);
    line-height: 1.08;
  }

  .reader-details > p {
    margin-bottom: 24px;
    font-size: 11px;
  }

  .reader-details dl > div {
    min-height: 40px;
  }

  .reader-details > a {
    margin-top: 26px;
  }

  .reader-edition-nav {
    margin-top: 18px;
  }
}

@media (max-width: 420px) {
  .series-shell,
  .reader-shell {
    grid-template-rows: 50px minmax(0, 1fr);
  }

  .series-header,
  .reader-header {
    min-height: 50px;
    padding-inline: 13px;
  }

  .series-content {
    grid-template-rows: minmax(122px, auto) minmax(0, 1fr);
  }

  .series-overview {
    min-height: 122px;
    padding-inline: 16px;
  }

  .series-overview::before {
    left: 16px;
  }

  .series-index-panel {
    padding-inline: 13px;
  }

  .series-hero-copy h2 {
    width: 100%;
    font-size: clamp(32px, 10vw, 42px);
  }

  .reader-book-column {
    padding-inline: 13px;
  }

  .reader-book {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .reader-details {
    margin-inline: 13px;
    padding-inline: 18px;
  }

  .reader-back {
    max-width: 52vw;
  }
}

@media (max-width: 820px) and (orientation: landscape) and (max-height: 520px) {
  .series-shell,
  .reader-shell {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .series-header,
  .reader-header {
    min-height: 48px;
  }

  .series-content {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .series-overview {
    min-height: 0;
    padding: 22px 20px;
    border-right: 1px solid var(--exhibition-rule);
    border-bottom: 0;
  }

  .series-curatorial-note {
    display: none;
  }

  .series-overview::before {
    top: 24px;
    bottom: auto;
    left: 0;
    width: 2px;
    height: 62px;
  }

  .series-hero-copy h2 {
    margin-block: 8px 12px;
    font-size: 34px;
  }

  .series-index-panel {
    padding: 12px 16px 10px;
    grid-template-rows: 26px minmax(0, 1fr) 48px;
  }

  .series-volume-stage,
  .series-index-panel:has(.series-deck-list > .series-deck:only-child) .series-volume-stage,
  .series-index-panel:has(.series-deck-list > .series-deck:first-child:nth-last-child(2)) .series-volume-stage,
  .series-index-panel:has(.series-deck-list > .series-deck:nth-child(3)) .series-volume-stage {
    width: 100%;
    max-height: none;
  }

  .series-deck {
    height: 42px;
  }

  .reader-content {
    grid-template-columns: 248px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .reader-book-column {
    padding: 16px 22px 20px;
    border-left: 1px solid var(--exhibition-rule);
    border-top: 0;
    border-bottom: 0;
    overflow: hidden;
  }

  .reader-details {
    max-height: 100%;
    margin: 0;
    padding: 16px;
    overflow: auto;
  }

  .reader-details h2 {
    margin-block: 10px 8px;
    font-size: 22px;
  }

  .reader-details > p {
    display: none;
  }

  .reader-edition-nav {
    margin-top: 10px;
  }

  .reader-details dl > div {
    min-height: 30px;
  }

  .reader-details > a {
    min-height: 36px;
    margin-top: 14px;
  }

  .reader-details > small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .series-browser[open] .series-shell,
  .proposal-reader[open] .reader-shell {
    animation: none;
  }

  .series-deck,
  .reader-close,
  .series-close {
    transition: none;
  }
}

/* A near-white warm paper field gives white proposal covers a visible edge
   without bringing back artificial borders or drop-shadow cards. Keep every
   hand-off surface on the same colour so the shared-cover transition never
   flashes pure white between the shelf, series gallery and page reader. */
:root {
  --paper: #f7f4ec;
  --cover-field: #f7f4ec;
}

.shelf-viewport,
.three-shelf-stage,
.three-shelf-stage canvas,
.three-shelf-loading,
.series-index-panel,
.series-volume-stage,
.series-volume-stage canvas,
.reader-book-column,
.reader-stage,
.reader-stage iframe,
.reader-cover-preview,
.reader-loading,
.reader-page-viewer,
.reader-page-canvas,
.book-transition-clone,
.book-transition-cover,
#readerPageViewer .proposal-page-reader__stage,
#readerPageViewer .proposal-page-reader__canvas,
#readerPageViewer .proposal-page-reader__unavailable {
  background-color: var(--cover-field);
}

.reader-stage {
  box-shadow: none;
}
