/* A compact comic book: one cover and four panels on every story page. */
.reader-page { --reader-width: 1920px; --reader-gutter: clamp(12px,2vw,48px); --leaf-paper: #f4eddb; }
.reader-page [hidden] { display: none !important; }
.reader-page #reader-shell { position: relative; z-index: 1; }
.reader-page .reading-progress { display: none; }
.reader-page .reader-masthead { position: relative; z-index: 5; width: min(var(--reader-width),calc(100% - 2 * var(--reader-gutter))); min-height: 56px; margin: 0 auto; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.reader-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.reader-issue-label { margin-left: auto; color: var(--muted); font-size: 13px; }
.reader-masthead #bookmark { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; font-size: 14px; }
.reader-page .reader-journal { width: min(var(--reader-width),calc(100% - 2 * var(--reader-gutter))); margin: 16px auto 0; }
.reader-header-placeholder { min-height: 56px; }
.reader-journal:not(:has(.reader-opening)) { padding-top: 48px; }
.reader-book { width: 100%; }
.reader-opening { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; position: relative; isolation: isolate; perspective: 1800px; border: 1px solid #756b55; box-shadow: 3px 5px 0 #25251f18; min-height: clamp(580px,calc(100svh - 190px),1050px); overflow: clip; touch-action: pan-y; }
.reader-opening::after { content: none; }
.opening-leaf { box-sizing: border-box; font-family: var(--text); font-size: var(--body-size); min-width: 0; padding: clamp(18px,1.8vw,36px); border: 0; background-color: var(--leaf-paper); background-image: linear-gradient(#f4eddbeb,#f4eddbeb),var(--paper-image); background-size: auto,1000px auto; color: var(--ink); }
.opening-title-page { display: flex; flex-direction: column; gap: 16px; }
.opening-running-head, .comic-running-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .6px; }
.reader-page .opening-title-page h1 { font-size: clamp(58px,5.8vw,112px); line-height: .94; letter-spacing: -.06em; font-weight: 900; margin: 4px 0 0; color: var(--red); }
.opening-title-page h1 span { color: var(--ink); }
.cover-deck { font: italic clamp(18px,1.25vw,25px)/1.35 Georgia,serif; margin: -4px 0 0; }
.reader-cover-art { position: relative; flex: none; aspect-ratio: 1.125; min-height: 0; border: 2px solid var(--ink); }
.cover-edition { position: absolute; bottom: 16px; left: 16px; background: var(--red); color: var(--paper); padding: 8px 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; transform: rotate(-3deg); }
.cover-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.5; }
#start-reading { min-height: 44px; padding: 6px 0 6px 18px; font-size: 16px; color: var(--red); font-weight: 700; }
#start-reading span { margin-left: 24px; }
.comic-leaf { display: flex; flex-direction: column; gap: 14px; }
.comic-running-head { text-transform: uppercase; min-height: 34px; }
.page-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(2,1fr); gap: 12px; flex: 1; }
.reader-page .page-panels .panel { margin: 0; transform: none; box-shadow: none; background: var(--leaf-paper); min-width: 0; align-self: start; }
.page-panels .panel-image { aspect-ratio: 1.125; flex-shrink: 0; }
.reader-page .page-panels .dialogues { font-size: clamp(15px,1vw,19px); line-height: 1.45; padding: 12px; min-height: 72px; }
.page-panels .dialogues p + p { margin-top: 6px; }
.page-panels .dialogues strong { font-size: 11px; letter-spacing: .4px; }
.reader-page .page-panels .panel-number { padding: 7px 9px; font-size: 12px; }
.reader-page .page-panels .panel .news-inset { position: absolute; top: 34px; left: 8px; right: 8px; max-width: none; margin: 0; padding: 8px; font-size: 10px; line-height: 1.3; background: #f6efdef5; }
.reader-page .page-panels .panel .news-inset b { font-size: 12px; line-height: 1.3; }
.reader-page .page-panels .panel .news-inset span, .reader-page .page-panels .panel .news-inset small { font-size: 8px; }

.page-folio { display: block; text-align: center; font: 12px/1 var(--text); color: var(--muted); }
.reader-pager { position: sticky; z-index: 10; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 10px 12px; margin: 0 auto; pointer-events: none; }
.reader-pager > button { pointer-events: auto; min-height: 48px; min-width: 120px; padding: 10px 18px; border: 1px solid var(--ink); background: var(--leaf-paper); box-shadow: 3px 3px 0 #20201c35; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 18px; transition: background .15s,box-shadow .15s; }
.reader-pager #next-page { background: var(--red); color: var(--paper); }
.reader-pager > button:hover:not(:disabled) { box-shadow: 4px 4px 0 #20201c55; }
.reader-pager > button:disabled { opacity: .3; cursor: default; box-shadow: none; }
.reader-pager .page-location { pointer-events: auto; background: var(--leaf-paper); border: 1px solid #756b5566; padding: 4px 12px; }
.page-location { display: flex; align-items: center; justify-content: center; gap: 20px; }
#page-position { color: var(--muted); font-size: 13px; }
#page-tabs { display: flex; gap: 4px; }
#page-tabs button { font-size: 13px; min-width: 34px; min-height: 38px; border-bottom: 2px solid transparent; }
#page-tabs button[aria-current="page"] { color: var(--red); border-color: var(--red); font-weight: 700; }
.reader-footnote { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.5; color: var(--muted); padding: 0 0 10px; }
.reader-page .reader-ending { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin: 10px 0 0; padding: 16px 0; border-top: 1px solid var(--line); }
.reader-ending .read-confirmation { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reader-ending .read-confirmation button { min-height: 44px; font-size: 14px; padding: 8px 12px; }
.reader-ending #read-status, .reader-ending .end-actions { font-size: 13px; }
.reader-ending .end-actions { gap: 20px; }
.reader-ending .status { margin: 0; min-height: 0; width: 100%; font-size: 12px; }
.reader-page footer { width: min(var(--reader-width),calc(100% - 2 * var(--reader-gutter))); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* The reader and the flip renderer share one opaque paper surface. */
/* The crease belongs to each leaf and travels with it; nothing floats over a turn. */
.opening-leaf { position: relative; }
.opening-leaf[data-side="left"]::after, .opening-leaf[data-side="right"]::after { content: ''; position: absolute; z-index: 3; top: 0; bottom: 0; width: 12px; pointer-events: none; }
.opening-leaf[data-side="left"]::after { right: 0; background: linear-gradient(to left,#20201c12,transparent); }
.opening-leaf[data-side="right"]::after { left: 0; background: linear-gradient(to right,#20201c12,transparent); }
.book-transition .book-crease { display: none; }
.reader-opening.is-sizing > .opening-leaf[hidden] { display: flex !important; position: absolute; top: 0; left: 0; width: 50%; visibility: hidden; }
.page-turn-layer { position: absolute !important; z-index: 6; inset: 0; pointer-events: none; }
.whole-page-turn .stf__wrapper, .whole-page-turn .stf__block { height: 100%; }
.flip-surface { overflow: hidden; background: var(--leaf-paper); }
.flip-surface > .opening-leaf { display: flex; flex-direction: column; }
@media (max-width: 1100px) {
  .reader-page { --reader-width: 860px; }
  .reader-opening { grid-template-columns: minmax(0,1fr); min-height: calc(100svh - 180px); }
  .reader-opening::after { display: none; }
  .opening-leaf { padding: 24px; }
  .opening-title-page { min-height: min(800px,calc(100svh - 180px)); }
  .reader-page .opening-title-page h1 { font-size: clamp(64px,10vw,104px); }
  .cover-deck { font-size: 22px; }
  .reader-page .page-panels .dialogues { font-size: 18px; }
  .reader-page .page-panels .panel .news-inset { padding: 10px; font-size: 12px; }
  .reader-page .page-panels .panel .news-inset b { font-size: 15px; }
}
@media (max-width: 600px) {
  .reader-page .reader-masthead { min-height: 52px; gap: 10px; font-size: 14px; }
  .reader-issue-label { font-size: 12px; }
  .reader-masthead #bookmark { padding: 4px; font-size: 20px; }
  .reader-masthead #bookmark span { display: none; }
  .reader-page .reader-journal { margin-top: 10px; }
  .opening-leaf { padding: 16px; }
  .opening-title-page { min-height: calc(100svh - 180px); gap: 12px; }
  .opening-running-head, .comic-running-head { font-size: 10px; padding-bottom: 10px; }
  .reader-page .opening-title-page h1 { font-size: 64px; }
  .cover-deck { font-size: 17px; }
  .cover-edition { left: 10px; bottom: 12px; font-size: 10px; padding: 6px 8px; }
  .cover-bottom { font-size: 11px; }
  .page-panels { grid-template-columns: minmax(0,1fr); grid-template-rows: auto; gap: 16px; }
  .reader-page .page-panels .dialogues { font-size: 18px; padding: 14px; min-height: 0; }
  .reader-page .page-panels .panel .news-inset b { font-size: clamp(14px,4.35vw,17px); }
  .reader-page .page-panels .news-inset .news-card + .news-card { margin-top: 8px; padding-top: 8px; }
  .reader-pager { bottom: max(8px,env(safe-area-inset-bottom)); min-height: 70px; padding: 8px 0; gap: 8px; }
  .reader-pager > button { padding: 8px 12px; min-width: 44px; font-size: 18px; }
  .reader-pager .page-location { padding: 2px 4px; flex: 1; min-width: 0; }
  #page-tabs { gap: 2px; }
  #page-tabs button { min-width: 28px; padding-inline: 2px; }
  .reader-pager > button span { display: none; }
  .page-location { flex-direction: column; gap: 0; }
  #page-position { font-size: 11px; }
  #page-tabs button { min-height: 34px; font-size: 12px; }
  .reader-footnote { font-size: 11px; padding-block: 8px; }
  .gesture-hint { display: none; }
  .reader-page .reader-ending { display: block; }
  .reader-ending .end-actions { margin-top: 12px; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .page-turn-layer { display: none; } }

/* Finished comic artwork is a page, not a grid of placeholder panels. */
.reader-page { --reader-width: 1680px; }
.reader-page .reader-book { width: min(100%,calc((100svh - 138px) * 1.44)); margin: auto; }
.reader-opening { min-height: 0; }
.full-art-leaf { padding: 0; gap: 0; }
.full-art-leaf .page-panels { display: block; flex: none; }
.comic-page-art { position: relative; margin: 0; width: 100%; cursor: zoom-in; }
.comic-page-art img { display: block; width: 100%; height: auto; }
.comic-page-art:focus-visible { outline: 3px solid var(--red); outline-offset: -4px; }
.page-completion-marker { position: absolute; bottom: 0; left: 0; width: 100%; height: 8px; }
.reader-cover-art { aspect-ratio: 1.2; overflow: hidden; }
.reader-cover-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.opening-title-page { gap: 12px; padding: clamp(16px,1.7vw,32px); }
.reader-page .opening-title-page h1 { font-size: clamp(44px,5vw,90px); }
.opening-title-page .cover-deck { font-size: clamp(17px,1.5vw,24px); }
.issue-description { width: 100%; max-width: 780px; white-space: pre-line; font-size: 16px; line-height: 1.7; }
#frame-dialog { width: min(98vw,1150px); max-width: 98vw; max-height: 96svh; padding: 12px; overflow: auto; }
#frame-dialog .dialog-top { position: sticky; top: -12px; z-index: 2; background: var(--paper); gap: 12px; }
#frame-dialog #frame-large { overflow: auto; max-height: 75svh; }
#frame-dialog .comic-page-art { max-width: 760px; margin: auto; cursor: default; }
#frame-dialog.is-zoomed .comic-page-art { width: 1520px; max-width: none; margin: 0; }
#zoom-page { margin-left: auto; min-height: 44px; padding: 8px; border: 1px solid var(--line); font-size: 14px; }
.page-transcript { padding: 16px 0; font-size: 15px; }
.page-transcript summary { cursor: pointer; min-height: 40px; }
.page-transcript p { white-space: pre-line; line-height: 1.7; }
@media(max-width:1100px) {
  .reader-page .reader-book { width: min(100%,760px); }
  .opening-title-page { min-height: 0; aspect-ratio: 2/3; }
  .full-art-leaf { padding: 0; }
  .reader-page .opening-title-page h1 { font-size: clamp(54px,12vw,100px); }
}
@media(max-width:600px) {
  .reader-page .reader-book { width: 100%; }
  .full-art-leaf { padding: 0; }
  #frame-dialog { padding: 8px; }
  #frame-dialog .dialog-top { top: -8px; font-size: 11px; }
  #frame-dialog.is-zoomed .comic-page-art { width: calc((100vw - 70px) * 2); }
  .reader-pager { gap: 6px; }
}
.reader-cover-art img { object-position: center top; }

/* Printed covers supply all their own lettering, just like the finished pages. */
.opening-title-page--illustrated { padding: 0; gap: 0; aspect-ratio: 2/3; min-height: 0; }
.opening-title-page--illustrated .opening-running-head,
.opening-title-page--illustrated .cover-deck,
.opening-title-page--illustrated .cover-bottom { display: none; }
.reader-page .opening-title-page--illustrated h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.opening-title-page--illustrated .reader-cover-art { width: 100%; height: 100%; aspect-ratio: 2/3; border: 0; }
.opening-title-page--illustrated .reader-cover-art img { display: block; object-fit: contain; }
@media(max-width:400px) {
  .reader-pager { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 6px; }
  .reader-pager .page-location { display: contents; }
  .reader-pager #previous-page { grid-area: 1 / 1; }
  .reader-pager #next-page { grid-area: 1 / 3; }
  .reader-pager #page-position { grid-area: 1 / 2; text-align: center; background: var(--leaf-paper); padding: 8px; border: 1px solid #756b5566; }
  .reader-pager #page-tabs { grid-area: 2 / 1 / 3 / -1; justify-content: center; background: var(--leaf-paper); border: 1px solid #756b5566; }
  .reader-pager #page-tabs button { min-width: 36px; min-height: 44px; }
}
#page-tabs { max-width:100%; overflow-x:auto; }
.reader-pager .page-location { min-width:0; max-width:70%; }
