*{box-sizing:border-box}
:root{
  --paper:#f4f0e7;
  --paper2:#eee7da;
  --ink:#1a1713;
  --gold:#aa8341;
  --rule:#b99a60;
}
html,body{margin:0;min-height:100%;background:#d8d2c6;color:var(--ink);font-family:'Cormorant Garamond','EB Garamond',Garamond,'Times New Roman',serif}
body{padding:30px 0}
.book-page{position:relative;width:min(1240px,calc(100vw - 150px));aspect-ratio:16/10;margin:0 auto;background:var(--paper);box-shadow:0 14px 40px #0005;padding:42px 54px 48px;overflow:visible}
.spine-fold{position:absolute;left:0;top:0;bottom:0;width:30px;pointer-events:none;background:linear-gradient(90deg,#6f675b33 0,#fff9 28%,#0000000c 61%,transparent 100%);mix-blend-mode:multiply}
.page-edges{position:absolute;left:100%;top:8px;bottom:8px;width:16px;z-index:1;pointer-events:none}
.page-edges i{position:absolute;inset:0 auto 0 0;width:100%;background:#eee8dc;border-right:1px solid #cfc4b2;box-shadow:2px 0 0 #f8f4ec}
.page-edges i:nth-child(1){transform:translateX(2px);opacity:.96}.page-edges i:nth-child(2){transform:translateX(5px);opacity:.84}.page-edges i:nth-child(3){transform:translateX(8px);opacity:.70}.page-edges i:nth-child(4){transform:translateX(11px);opacity:.55}
.crumbs{position:absolute;left:54px;right:54px;top:31px;font-size:12px;letter-spacing:.045em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crumbs a{color:inherit;text-decoration:none}.crumbs a:hover{text-decoration:underline}.crumbs span{margin:0 8px;color:var(--gold)}.crumbs strong{font-weight:400;color:#5f513c}
.top-rule{position:absolute;left:54px;right:54px;top:62px;height:1px;background:var(--rule)}

/* STRANA 1 — O AUTOROVI */
.author-copy{position:absolute;left:54px;top:87px;bottom:45px;width:41.5%;padding-right:32px;display:flex;flex-direction:column}
.author-copy h1{font-size:39px;font-weight:400;line-height:1;margin:0 0 20px;letter-spacing:.012em}
.bio-text{font-size:15.2px;line-height:1.31}
.bio-text p{margin:0 0 13px}
.credit-block{margin-top:1px}
.credit-rule{width:43%;height:1px;background:var(--rule);margin-bottom:6px}
.credit-block p{font-size:15.2px;line-height:1.2;font-style:italic;margin:0 0 8px}
.author-note{margin-top:auto}
.note-rule{width:100%;height:1px;background:var(--rule);margin-bottom:8px}
.author-note h2{font-size:17px;font-weight:400;font-style:italic;color:var(--gold);margin:0 0 6px}
.author-note p{font-size:14.5px;line-height:1.31;font-style:italic;margin:0}
.author-photo{position:absolute;left:46.5%;right:54px;top:86px;bottom:42px;overflow:hidden;background:#111}
.author-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 50%}

.tabs{position:absolute;left:100%;top:0;bottom:0;width:76px;display:grid;grid-template-rows:repeat(6,1fr);gap:2px;z-index:4}
.tabs a{min-height:0;background:#eee8dc;border-radius:0 12px 12px 0;box-shadow:4px 4px 10px #0002;display:grid;place-items:center;font-size:14px;line-height:1.05;letter-spacing:.02em;writing-mode:vertical-rl;text-orientation:mixed;text-align:center;padding:12px 0;text-decoration:none;color:inherit}
.tabs .active{background:#b88b35;color:#17120b}
.page-number{position:absolute;left:50%;bottom:11px;transform:translateX(-50%);font-size:16px;color:#8c6c34;z-index:6}
.page-arrow{position:absolute;bottom:7px;width:44px;height:34px;display:flex;align-items:center;justify-content:center;text-decoration:none;color:#8c6c34;font-size:30px;line-height:1;font-family:Georgia,serif;z-index:8;transition:transform .15s ease,opacity .15s ease;opacity:.86}
.page-arrow-prev{left:18px}.page-arrow-next{right:18px}.page-arrow:hover{opacity:1}.page-arrow-prev:hover{transform:translateX(-4px)}.page-arrow-next:hover{transform:translateX(4px)}
@media(max-width:900px){.book-page{width:calc(100vw - 105px)}.tabs{width:62px}.tabs a{font-size:11px}.crumbs{font-size:10px}.author-copy{width:44%;padding-right:20px}.author-copy h1{font-size:28px}.bio-text{font-size:11px}.bio-text p{margin-bottom:8px}.author-note h2{font-size:13px}.author-note p,.credit-block p{font-size:10.5px}.author-photo{left:48%}}

/* BUILD KOMPLET: celá knižní stránka v dostupné výšce okna.
   Zachovává poměr 16:10, rozvržení, záložky i spodní navigaci. */
@media screen {
  body { padding-top: 12px; padding-bottom: 12px; }
  .book-page {
    width: min(1240px, calc(100vw - 150px), calc((100vh - 24px) * 1.6));
    width: min(1240px, calc(100vw - 150px), calc((100dvh - 24px) * 1.6));
  }
}
@media screen and (max-width: 900px) {
  .book-page {
    width: min(calc(100vw - 105px), calc((100vh - 24px) * 1.6));
    width: min(calc(100vw - 105px), calc((100dvh - 24px) * 1.6));
  }
}

/* BUILD: bezpečná výšková rezerva, bez svislého posuvníku na desktopu. */
@media screen and (min-width: 901px) {
  html { height: 100%; }
  body { min-height: 100vh; min-height: 100dvh; padding-top: 6px; padding-bottom: 6px; }
  .book-page {
    width: min(1240px, calc(100vw - 150px), calc((100vh - 32px) * 1.6));
    width: min(1240px, calc(100vw - 150px), calc((100dvh - 32px) * 1.6));
  }
}
@media screen and (max-width: 900px) {
  body { padding-top: 6px; padding-bottom: 6px; }
  .book-page {
    width: min(calc(100vw - 105px), calc((100vh - 32px) * 1.6));
    width: min(calc(100vw - 105px), calc((100dvh - 32px) * 1.6));
  }
}


/* OPRAVA POPISKŮ ZVĚTŠENÝCH OBRAZŮ – CZ / EN / DE */
body.image-page{box-sizing:border-box;min-height:100dvh;height:100dvh;overflow:hidden;grid-template-rows:minmax(0,auto) minmax(0,1fr) auto;}
body.image-page .image-stage{min-height:0;min-width:0;overflow:hidden;padding:12px 8px;}
body.image-page .image-stage img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;}
body.image-page .image-meta{position:relative;z-index:2;min-height:fit-content;padding:8px 4px 2px;overflow-wrap:anywhere;}
body.image-page .image-title-top{max-width:65%;text-align:right;overflow-wrap:anywhere;}
@media(max-width:700px){body.image-page{padding:12px;}.image-page .image-top{gap:10px}.image-page .image-title-top{font-size:11px;max-width:55%;}.image-page .image-meta strong{font-size:19px;}}
.lightbox:not([hidden]){display:grid!important;grid-template-rows:minmax(0,1fr) auto;justify-items:center;align-items:center;gap:10px;overflow:hidden;padding:52px 20px 22px;box-sizing:border-box;}
.lightbox:not([hidden]) img{display:block;min-width:0;min-height:0;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;align-self:center;}
.lightbox:not([hidden]) #detail{position:relative;z-index:2;margin:0;max-width:95vw;text-align:center;overflow-wrap:anywhere;line-height:1.3;max-height:20dvh;overflow-y:auto;}

/* TEST: celé dílo při zvětšení, bez ořezu. Oprava předchozího grid overflow. */
html:has(body.image-page){height:100%;}
body.image-page{display:flex!important;flex-direction:column!important;height:100dvh!important;min-height:0!important;overflow:hidden!important;box-sizing:border-box!important;}
body.image-page .image-top,body.image-page .image-meta{flex:0 0 auto!important;}
body.image-page .image-stage{display:flex!important;flex:1 1 0!important;min-height:0!important;min-width:0!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;box-sizing:border-box!important;}
body.image-page .image-stage img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;min-width:0!important;min-height:0!important;object-fit:contain!important;object-position:center!important;flex-shrink:1!important;}
.lightbox:not([hidden]){display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;box-sizing:border-box!important;}
.lightbox:not([hidden]) img{display:block!important;flex:0 1 auto!important;width:auto!important;height:auto!important;max-width:calc(100vw - 40px)!important;max-height:calc(100dvh - 170px)!important;min-height:0!important;min-width:0!important;object-fit:contain!important;object-position:center!important;}
.lightbox:not([hidden]) #detail{flex:0 0 auto!important;max-height:110px!important;overflow-y:auto!important;position:relative!important;z-index:3!important;}
@media(max-height:520px){.lightbox:not([hidden]) img{max-height:calc(100dvh - 105px)!important}.lightbox:not([hidden]) #detail{max-height:55px!important}}

/* WEBKNIHA – MOBILNI TEST: zachovani pevne knizni sazby. */
@media screen and (max-width: 900px) {
  html:has(.book-page) { overflow-x: hidden !important; }
  body:has(.book-page) { padding: 0 !important; overflow-x: hidden !important; min-height: 100dvh !important; }
  body .book-page {
    width: 1240px !important; height: 775px !important; aspect-ratio: auto !important;
    max-width: none !important; min-width: 1240px !important;
    position: relative !important; left: 50% !important; margin: 0 0 0 -620px !important;
    transform-origin: center top !important; transform: scale(var(--wk-mobile-scale, .5)) !important;
  }
  body .book-page .heading h1 { font-size: 41px !important; }
  body .book-page .tabs { width: 76px !important; }
  body .book-page .tabs a { font-size: 14px !important; }
  body .book-page .footnote p { font-size: 16px !important; }
  body .book-page .crumbs { font-size: 12px !important; }
  body .book-page .gallery { gap: 16px 20px !important; }
  body .book-page.page-two .welcome-text p { font-size: 20px !important; margin-bottom: 22px !important; }
  body .book-page.page-two .author-signature { margin-top: 38px !important; }
  body .book-page.page-two .author-signature strong { font-size: 24px !important; }
  body .book-page.page-two .hero-art { padding-left: 18px !important; }
  body .book-page .language-switch { top: 17px !important; right: 54px !important; gap: 7px !important; }
  body .book-page .language-switch .language-choice { width: 45px !important; height: 34px !important; font-size: 19px !important; }
}
