/* the page dialog: one book page, lit by the lamp. Opacity only (a modal, not anchored). */
.pagebox { border: 0; padding: 0; background: transparent; color: var(--ivory); max-width: none; max-height: none; width: 100vw; height: 100dvh; overflow: auto; }
.pagebox:not([open]) { display: none; }
.pagebox::backdrop { background: rgba(7, 8, 6, 0.95); }
.pagebox-in { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4); padding: var(--s-5) var(--gutter); background: radial-gradient(ellipse 60% 50% at 50% 42%, rgba(242, 199, 122, 0.16), transparent 70%); }
.pagebox figure { margin: 0; display: grid; gap: var(--s-4); justify-items: center; }
.pagebox img { width: auto; max-width: min(100%, 460px); max-height: calc(100dvh - 190px); border: 1px solid var(--brass); background: var(--ivory); }
.pagebox figcaption { max-width: 30em; text-align: center; font: italic 400 1rem/1.5 var(--f-body); color: var(--ivory); outline: none; }
.pagebox-ctl { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }
.pagebox-ctl .pg-step { background: var(--night); padding: 0 var(--s-3); letter-spacing: 0.04em; font-size: 0.875rem; }

.pagebox, .pagebox::backdrop { opacity: 1; transition: opacity 240ms var(--ease-candle), display 240ms allow-discrete, overlay 240ms allow-discrete; }
@starting-style { .pagebox[open], .pagebox[open]::backdrop { opacity: 0; } }
.pagebox:not([open]), .pagebox:not([open])::backdrop { opacity: 0; transition-duration: 160ms; }
