/* V27 — lightbox for GHS visual books, preserving each book's page composition. */
.sheet img.ghs-zoomable{cursor:zoom-in}
.sheet img.ghs-zoomable:focus-visible{outline:3px solid #d6b47e;outline-offset:3px}
.ghs-image-dialog{inset:0;position:fixed;box-sizing:border-box;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgba(13,16,20,.97);color:#fff;overflow:auto;z-index:100000}
.ghs-image-dialog::backdrop{background:rgba(13,16,20,.92)}
.ghs-image-dialog[open]{display:flex;flex-direction:column}
.ghs-image-dialog-header{flex:0 0 auto;display:flex;justify-content:flex-end;align-items:center;padding:12px max(16px,env(safe-area-inset-right));min-height:56px}
.ghs-image-dialog-close{font:600 15px/1.2 system-ui,sans-serif;color:#fff;background:#34383e;border:1px solid #858a91;border-radius:999px;padding:10px 16px;cursor:pointer}
.ghs-image-dialog-close:hover,.ghs-image-dialog-close:focus-visible{background:#4f555e;outline:2px solid #fff;outline-offset:2px}
.ghs-image-dialog-figure{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0;margin:0;padding:0 max(12px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom));align-items:center;justify-content:center}
.ghs-image-dialog-figure img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100dvh - 134px);object-fit:contain;border-radius:3px;box-shadow:0 12px 60px rgba(0,0,0,.4)}
.ghs-image-dialog-caption{font:400 13px/1.45 system-ui,sans-serif;color:#e7e7e7;text-align:center;max-width:900px;max-height:3.3em;overflow:auto}
.ghs-book-next{width:min(920px,calc(100% - 32px));box-sizing:border-box;margin:22px auto 110px;padding:30px clamp(18px,5vw,38px);border:1px solid rgba(120,99,70,.25);border-radius:14px;background:#fffaf2;color:#3f3429;text-align:center;font:400 15px/1.6 system-ui,sans-serif;box-shadow:0 8px 28px rgba(42,31,18,.08)}
.ghs-book-next h2{font:600 clamp(20px,2.5vw,29px)/1.25 Georgia,serif;margin:0 0 9px;color:#51432f}
.ghs-book-next p{margin:0 auto 22px;max-width:680px}
.ghs-book-next-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:11px}
.ghs-book-next-actions a{border:1px solid #6b5234;border-radius:999px;padding:11px 17px;color:#4e3b22;text-decoration:none;background:transparent;font:600 13px/1.4 system-ui,sans-serif}
.ghs-book-next-actions a:first-child{background:#59432e;color:#fff}
.ghs-book-next-actions a:hover,.ghs-book-next-actions a:focus-visible{outline:2px solid #8b6e48;outline-offset:2px}
@media (max-width:560px){.ghs-image-dialog-caption{font-size:12px}.ghs-book-next{margin-bottom:120px}.ghs-book-next-actions a{width:100%;max-width:310px}}
@media print{.sheet img.ghs-zoomable{cursor:auto}.ghs-image-dialog,.ghs-book-next{display:none!important}}


/* V33 — Genuine touch-readable books. Desktop lightbox stays unchanged. */
.ghs-image-dialog-viewport{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;width:100%;overflow:hidden}
.ghs-image-dialog-stage{display:flex;align-items:center;justify-content:center;min-height:0;min-width:0}
.ghs-mobile-zoom-controls,.ghs-mobile-page-action,.ghs-page-dialog{display:none}
@media screen and (max-width:760px){
 .ghs-image-dialog{background:#241b15;color:#fff;overscroll-behavior:contain;overflow:hidden}
 .ghs-image-dialog[open]{display:flex;flex-direction:column}
 .ghs-image-dialog-header{min-height:52px;gap:8px;padding:8px 12px;justify-content:space-between;border-bottom:1px solid #ffffff24}
 .ghs-image-dialog-close{padding:10px 14px;background:#5a4030;color:white;border-color:#aa8861;font-size:14px}
 .ghs-mobile-zoom-controls{display:flex;gap:6px;align-items:center}
 .ghs-mobile-zoom-controls button,.ghs-page-controls button{border:1px solid #b99469;background:#4a3425;color:#fff5e9;border-radius:7px;min-height:40px;min-width:39px;padding:6px 10px;font:600 14px/1.2 system-ui,sans-serif;cursor:pointer}
 .ghs-mobile-zoom-controls .ghs-zoom-fit{min-width:50px}
 .ghs-image-dialog-figure{padding:0;margin:0;display:flex;flex-direction:column;flex:1;min-height:0;width:100%;gap:0;justify-content:flex-start}
 .ghs-image-dialog-viewport{display:block;flex:1;min-height:0;width:100%;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;background:#20170f}
 .ghs-image-dialog-stage{display:flex;align-items:center;justify-content:center;min-height:100%;min-width:100%;width:max-content}
 .ghs-image-dialog-figure img{display:block;flex:none;width:auto;height:auto;max-width:none;max-height:none;object-fit:contain;box-shadow:none;border-radius:0;user-select:none;-webkit-user-drag:none}
 .ghs-image-dialog-caption{flex:none;max-height:60px;max-width:none;width:100%;background:#342519;color:#fff8ed;padding:8px 12px;box-sizing:border-box;font:400 12px/1.4 system-ui,sans-serif}
 .ghs-mobile-page-action{display:block;position:relative;z-index:1;width:calc(100% - 32px);max-width:520px;margin:4px auto 25px;padding:12px 14px;min-height:45px;border:1px solid #b89a76;border-radius:8px;background:#f3e7d8;color:#453326;font:700 13px/1.3 system-ui,sans-serif;text-align:center;cursor:pointer}
 .ghs-mobile-page-action:focus-visible{outline:3px solid #8a5a3a;outline-offset:2px}
 .ghs-page-dialog{position:fixed;inset:0;z-index:100001;box-sizing:border-box;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:hidden;background:#211811;color:#fff}
 .ghs-page-dialog[open]{display:flex;flex-direction:column}
 .ghs-page-dialog::backdrop{background:#211811f2}
 .ghs-page-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:6px;min-height:54px;padding:6px 10px;border-bottom:1px solid #ffffff35;background:#34271f}
 .ghs-page-controls{display:flex;align-items:center;gap:5px}
 .ghs-page-header .ghs-page-close{background:#5a4030;border:1px solid #b99469;border-radius:7px;color:white;min-height:40px;padding:8px 11px;font:600 13px system-ui,sans-serif}
 .ghs-page-viewport{display:block;flex:1;min-height:0;overflow:auto;touch-action:pan-x pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#e9d9c8}
 .ghs-page-stage{position:relative;display:block;min-width:0;min-height:0;margin:0}
 .ghs-page-stage>.sheet{position:absolute;left:0;top:0;margin:0!important;box-shadow:none!important;transform:none!important;max-width:none!important;max-height:none!important}
 .ghs-page-hint{flex:none;margin:0;padding:7px 12px;background:#34271f;color:#f2e4d0;text-align:center;font:400 12px/1.4 system-ui,sans-serif}
}
@media print{.ghs-mobile-page-action,.ghs-page-dialog{display:none!important}}


/* V34 — Consistent full-screen illustration reader for desktop and mobile.
   Explicit geometry overrides the older shrink-to-fit flex layout. */
.ghs-image-dialog[open]{position:fixed;inset:0;box-sizing:border-box;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;display:flex;flex-direction:column;overflow:hidden;background:#241b15}
.ghs-image-dialog-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;min-height:54px;padding:8px 12px;background:#34271f;border-bottom:1px solid #ffffff29}
.ghs-mobile-zoom-controls{display:flex;flex:0 1 auto;align-items:center;gap:7px}
.ghs-mobile-zoom-controls button{min-height:39px;min-width:40px;padding:6px 10px;cursor:pointer;border:1px solid #b99469;border-radius:7px;background:#4a3425;color:#fff5e9;font:600 14px/1.2 system-ui,sans-serif}
.ghs-mobile-zoom-controls button:hover,.ghs-mobile-zoom-controls button:focus-visible{background:#675038}
.ghs-image-dialog-figure{display:flex;flex:1;flex-direction:column;align-items:stretch;justify-content:flex-start;min-height:0;width:100%;margin:0;padding:0;gap:0}
.ghs-image-dialog-viewport{display:block;flex:1;min-height:0;width:100%;height:100%;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;cursor:grab;background:#241b15}
.ghs-image-dialog-viewport:active{cursor:grabbing}
.ghs-image-dialog-stage{display:flex;align-items:center;justify-content:center;flex:none;min-width:100%;min-height:100%;box-sizing:border-box}
.ghs-image-dialog-figure img{display:block;flex:none;max-width:none!important;max-height:none!important;width:auto;height:auto;object-fit:contain;border:0;border-radius:0;box-shadow:none;user-select:none;-webkit-user-drag:none}
.ghs-image-dialog-caption{flex:none;box-sizing:border-box;max-width:none;width:100%;max-height:62px;overflow:auto;padding:8px 12px;margin:0;background:#34271f;color:#fff5e9;text-align:center;font:400 12px/1.4 system-ui,sans-serif}
@media(max-width:760px){
 .ghs-image-dialog[open]{width:100vw;height:100dvh;max-width:none}
 .ghs-image-dialog-header{gap:6px;min-height:50px;padding:6px 8px}
 .ghs-image-dialog-close{font-size:12px;padding:8px 10px;white-space:nowrap}
 .ghs-mobile-zoom-controls{gap:4px}
 .ghs-mobile-zoom-controls button{min-width:34px;min-height:36px;padding:5px 8px;font-size:12px}
 .ghs-mobile-zoom-controls .ghs-zoom-fit{min-width:50px}
}

/* V35: Image zoom now opens the independent /image-viewer.html.
   The original mobile full-page book reader remains available. */
.sheet img.ghs-zoomable{cursor:zoom-in;touch-action:manipulation}
