/* Native CSS fragmentation fills columns, including across old source-page boundaries. */
@media screen{
 body.book-flow{overflow:hidden;height:100svh}
 .book-flow #book-main{padding:12px 0;height:100%;overflow:hidden}
 .book-flow .book-spread,.book-flow .book-spread.single-spread{display:block!important;position:relative;width:min(2160px,calc(100% - 40px))!important;max-width:2160px;height:calc(100svh - 24px)!important;min-height:0!important;overflow:hidden;border:1px solid #a68c53;background:#f5e6bf url('assets/akte-papier-20261016/papier-naadloos.webp');border-radius:4px;touch-action:pan-x pinch-zoom}
 .book-flow .book-spread::before{display:none}.book-flow .book-spread::after{content:'';position:absolute;top:0;bottom:0;left:50%;width:30px;transform:translateX(-50%);background:linear-gradient(90deg,transparent,#79562824,transparent);pointer-events:none}
 .book-flow .book-flow-stream{position:absolute;left:28px;top:45px;width:var(--flow-column-width);height:var(--flow-column-height);column-width:var(--flow-column-width);column-count:1;column-gap:var(--flow-gap);column-fill:auto;overflow:visible;font:var(--reader-font)/1.6 Georgia,'Times New Roman',serif;transform:translateX(0);will-change:transform}
 .book-flow .book-flow-stream>.book-page:not(.is-cover),.book-flow .book-flow-stream .page-body{display:contents!important;font:inherit!important}
 .book-flow .book-flow-stream .page-running,.book-flow .book-flow-stream .page-folio{display:none!important}
 .book-flow .book-flow-stream :is(p,li,td){orphans:3;widows:3;overflow-wrap:anywhere}
 .book-flow .book-flow-stream :is(h1,h2,h3,h4){break-after:avoid;break-inside:avoid}
 .book-flow .book-flow-stream .book-heading-text{display:block;break-inside:avoid;break-inside:avoid-column;-webkit-column-break-inside:avoid;page-break-inside:avoid}
 .book-flow .book-flow-stream .book-heading-text>:last-child{margin-bottom:16px}
 .book-flow .book-flow-stream h2{font-size:30px;line-height:1.2;margin:10px 0 16px;color:#694320}
 .book-flow .book-flow-stream h3{font-size:23px;line-height:1.25;margin:18px 0 12px;color:#684e2b}
 .book-flow .book-flow-stream p{margin:0 0 16px}
 .book-flow .book-flow-stream figure{break-inside:avoid;margin:12px 0 18px;max-width:100%}
 .book-flow .book-flow-stream figure img{display:block;width:100%;height:auto!important;max-height:min(var(--book-fit-height,42svh),380px)!important;object-fit:contain;background:transparent}
 .book-flow .book-flow-stream figcaption{font:12px/1.5 Arial,sans-serif;margin-top:10px}
 .book-flow .book-flow-stream pre{white-space:pre-wrap;overflow-wrap:anywhere}
 .book-flow .book-flow-stream table{max-width:100%;font-size:13px;table-layout:fixed;overflow-wrap:anywhere}
 .book-flow .book-flow-stream tr{break-inside:avoid}
 .book-flow .book-flow-stream>.is-cover{display:flex!important;width:var(--flow-column-width)!important;height:var(--flow-column-height)!important;min-height:0!important;padding:20px;break-after:column;break-inside:avoid;overflow:hidden}
 .book-flow .book-flow-stream .book-cover{overflow:hidden;padding:0}.book-flow .book-cover img{height:min(23svh,200px);margin:12px auto}.book-flow .book-cover h1{font-size:34px;margin:16px 0}.book-flow .cover-subtitle{font-size:20px!important}.book-flow .cover-edition{font-size:10px!important;margin-top:12px!important}
 .book-flow-running,.book-flow-folio{position:absolute;left:28px;right:28px;z-index:2;font:10px/1.5 Arial,sans-serif;color:#75603e;letter-spacing:.5px;pointer-events:none;background:#f5e6bf}
 .book-flow-running{top:14px;border-bottom:1px solid #b49b6570;padding-bottom:8px;text-transform:uppercase;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
 .book-flow-folio{bottom:10px;border-top:1px solid #b49b6570;padding-top:8px;padding-right:50px;display:flex;justify-content:space-between;gap:20px}
 .book-flow #book-page-input{width:75px}
 .book-flow.book-continuous{overflow:auto;height:auto}.book-flow.book-continuous #book-main{height:auto;overflow:visible}.book-flow.book-continuous .book-spread{height:auto!important;overflow:visible;max-width:900px}.book-flow.book-continuous .book-flow-stream{position:static;width:auto!important;height:auto!important;columns:auto;transform:none!important;padding:28px}.book-flow.book-continuous :is(.book-flow-running,.book-flow-folio){display:none}.book-flow.book-continuous .book-spread::after{display:none}
}
@media screen and (max-width:600px),screen and (pointer:coarse) and (max-height:500px) and (max-width:950px){
 .book-flow #book-main{padding:8px 0}
 .book-flow .book-spread,.book-flow .book-spread.single-spread{width:calc(100% - 16px)!important;height:calc(100svh - 16px)!important}
 .book-flow .book-spread::after{display:none}
 .book-flow .book-flow-stream{left:18px;top:42px;font-size:17px;line-height:1.58}
 .book-flow.book-large .book-flow-stream{font-size:20px}
 .book-flow .book-flow-stream h2{font-size:26px}.book-flow .book-flow-stream h3{font-size:21px}
 .book-flow .book-flow-stream figure img{height:auto!important;max-height:min(var(--book-fit-height,36svh),300px)!important}
 .book-flow-running,.book-flow-folio{left:18px;right:18px;font-size:9px}.book-flow-running{top:12px}.book-flow-folio{bottom:9px}
 .book-flow .book-cover h1{font-size:28px}.book-flow .cover-subtitle{font-size:18px!important}.book-flow .book-cover img{height:min(20svh,160px)}
}
@media(prefers-reduced-motion:reduce){.book-flow-stream{transition:none!important}}
@media print{.book-flow-running,.book-flow-folio{display:none!important}.book-flow-stream{position:static!important;columns:auto!important;transform:none!important;width:auto!important;height:auto!important}.book-flow-stream>.book-page{display:flex!important}}

/* Printed leaves rotate around the spine; the spread itself never slides. */
@media screen{
 .flow-turn-layer{position:absolute;inset:0;z-index:8;perspective:2400px;pointer-events:none;transform-style:preserve-3d}
 .flow-turn-leaf{position:absolute;top:0;bottom:0;z-index:3;transform-style:preserve-3d;will-change:transform}
 .flow-turn-face{position:absolute;inset:0;overflow:hidden;background:#f5e6bf url('assets/akte-papier-20261016/papier-naadloos.webp');background-size:640px;backface-visibility:hidden;-webkit-backface-visibility:hidden}
 .flow-turn-back{transform:rotateY(180deg)}
 .flow-turn-face::after{content:'';position:absolute;inset:0;background:rgba(60,35,10,var(--turn-shade,0));pointer-events:none}
 .flow-turn-stationary{inset:0 auto 0 0;z-index:2}
 .book-flow .flow-turn-face .book-flow-stream{position:absolute;transition:none!important}
}
@media print{.flow-turn-layer{display:none!important}}

/* A closed desktop book shows only its cover. Inner spreads start after it. */
@media screen and (min-width:601px){
 .book-flow:not(.book-continuous) .book-spread.flow-cover-closed{clip-path:inset(-8px -8px -12px 50%)}
 .book-flow .flow-cover-closed::after,.book-flow .flow-cover-closed .book-flow-running,.book-flow .flow-cover-closed .book-flow-folio{visibility:hidden}
}
@media screen{
 /* Filters on the rotating parent flatten the two printed faces in WebKit. */
 .flow-turn-leaf{filter:none!important;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}
 .flow-turn-front{transform:rotateY(0deg);transform-origin:center center}
 .flow-turn-back{transform:rotateY(180deg);transform-origin:center center}
 .flow-turn-front,.flow-turn-back{backface-visibility:hidden;-webkit-backface-visibility:hidden}
}

/* Desktop: use the entire browser viewport; phone layout stays unchanged. */
@media screen and (min-width:981px){
 html:has(body.book-flow:not(.book-continuous)){scrollbar-gutter:auto;overflow:hidden;height:100%}
 body.book-flow:not(.book-continuous){width:100%;height:100vh;height:100dvh;margin:0}
 .book-flow:not(.book-continuous) #book-main{width:100%;height:100vh;height:100dvh;padding:0}
 .book-flow:not(.book-continuous) .book-spread,.book-flow:not(.book-continuous) .book-spread.single-spread{width:100%!important;max-width:none!important;height:100vh!important;height:100dvh!important;margin:0;border-radius:0}
}

/* Keep printed headings with their introduction as well. */
@media print{.book-heading-text{break-inside:avoid;page-break-inside:avoid}.book-heading-text>:is(h2,h3,h4){break-after:avoid;page-break-after:avoid}}
