/* ===== Společný vzhled stránek knihy (shodný s hlavním webem) ===== */
:root{
  --grad:linear-gradient(160deg,#120514 0%,#1d0a20 55%,#0d030f 100%);
  --card:rgba(255,255,255,.035); --card-hover:rgba(181,126,220,.07);
  --ink:#f2ecf4; --muted:#b3a4b8;
  --violet:#b57edc; --violet2:#7a3b8f;
  --grad-text:linear-gradient(90deg,#b57edc,#e3c1ff);
  --line:rgba(181,126,220,.22);
  --nav-bg:rgba(18,5,20,.88); --menu-bg:#160718;
  --book-shadow:0 24px 48px rgba(0,0,0,.5);
  --btn-ink:#ffffff; --glow:rgba(181,126,220,.16);
  color-scheme:dark;
}
:root[data-theme="light"]{
  --grad:linear-gradient(160deg,#faf6fc 0%,#f3eaf8 55%,#ece0f2 100%);
  --card:#ffffff; --card-hover:#f7effc;
  --ink:#241528; --muted:#5f4c67;
  --violet:#700096; --violet2:#8d43ab;
  --grad-text:linear-gradient(90deg,#700096,#a53ec9);
  --line:rgba(112,0,150,.22);
  --nav-bg:rgba(250,246,252,.9); --menu-bg:#faf6fc;
  --book-shadow:0 20px 44px rgba(112,0,150,.14);
  --btn-ink:#ffffff; --glow:rgba(112,0,150,.1);
  color-scheme:light;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
img{max-width:100%;height:auto;display:block}
body{background:var(--grad);background-attachment:fixed;color:var(--ink);font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-weight:400;line-height:1.7;font-size:16px;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
a{color:inherit;text-decoration:none}
h1,h2,h3{font-family:'Space Grotesk',sans-serif}
.skip{position:absolute;left:-999px;top:8px;background:var(--violet2);color:#fff;padding:10px 16px;border-radius:8px;z-index:300}
.skip:focus{left:8px}
:focus-visible{outline:2px solid var(--violet);outline-offset:3px;border-radius:4px}

/* ===== ukazatel čtení ===== */
.progress{position:fixed;top:0;left:0;height:3px;width:0;background:var(--grad-text);z-index:200}

/* ===== NAV (stejný jako na hlavním webu) ===== */
body>nav{position:fixed;top:0;width:100%;z-index:100;display:flex;justify-content:space-between;align-items:center;
  padding:16px 48px;background:var(--nav-bg);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);transition:background .35s}
.logo{font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:1.15rem;letter-spacing:.05em}
.logo span{color:var(--violet)}
.nav-right{display:flex;align-items:center;gap:24px}
.nav-links{display:flex;gap:24px;align-items:center}
.nav-links a{font-size:.78rem;letter-spacing:.15em;text-transform:uppercase;color:var(--muted);transition:color .3s}
.nav-links a:hover,.nav-links a.active{color:var(--violet)}
.nav-cta{border:1px solid var(--violet2);padding:9px 20px;border-radius:100px;color:var(--ink)!important;transition:background .3s}
.nav-cta:hover{background:var(--violet2);color:var(--btn-ink)!important}
.theme-btn{background:none;border:1px solid var(--line);color:var(--violet);width:38px;height:38px;border-radius:50%;
  cursor:pointer;font-size:1rem;display:flex;align-items:center;justify-content:center;transition:background .3s}
.theme-btn:hover{background:var(--card-hover)}
.hamburger{display:none;background:none;border:none;color:var(--ink);font-size:1.5rem;cursor:pointer;line-height:1}

footer{text-align:center;padding:32px 24px;color:var(--muted);font-size:.7rem;letter-spacing:.25em;text-transform:uppercase}

/* ===== rozložení ===== */
.wrap{max-width:820px;margin:0 auto;padding:116px 24px 48px}
.wrap.wide{max-width:1080px}
.read{max-width:42rem;margin:0 auto}
.crumbs{font-size:.78rem;color:var(--muted);margin-bottom:30px;letter-spacing:.03em;line-height:1.9}
.crumbs a{border-bottom:1px solid transparent;transition:color .3s,border-color .3s}
.crumbs a:hover{color:var(--violet);border-color:var(--violet)}
.crumbs .sep{margin:0 .55em;opacity:.55}
.eyebrow{color:var(--violet);font-size:.75rem;letter-spacing:.26em;text-transform:uppercase;margin-bottom:16px;font-weight:500}
h1.ch-title{font-size:clamp(1.85rem,4.4vw,2.8rem);line-height:1.16;font-weight:700;letter-spacing:-.01em;margin-bottom:16px;overflow-wrap:break-word}
.ch-sub{color:var(--muted);font-size:1.08rem;margin-bottom:8px}

/* ===== úvod kapitoly ===== */
.lead{font-style:italic;font-size:1.1rem;line-height:1.78;color:var(--muted);border-left:3px solid var(--violet2);padding:4px 0 4px 20px;margin:30px 0 34px}
.lead p+p{margin-top:1em}
.toc-box{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px 24px 22px;margin:0 0 44px}
.toc-box h2{font-size:.72rem;letter-spacing:.22em;text-transform:uppercase;color:var(--violet);margin-bottom:12px;font-weight:500}
.toc-box ol{list-style:none;display:grid;gap:6px}
.toc-box a{display:block;padding:5px 0;color:var(--ink);font-size:.98rem;line-height:1.45;border-bottom:1px solid transparent;transition:color .25s}
.toc-box a:hover{color:var(--violet)}

/* ===== text kapitoly ===== */
.prose p{font-size:1.08rem;line-height:1.84;margin:0 0 1.2em;overflow-wrap:break-word}
.prose h2{font-size:clamp(1.35rem,2.8vw,1.7rem);font-weight:600;line-height:1.25;margin:2.5em 0 .85em;scroll-margin-top:92px;letter-spacing:-.005em}
.prose h2:first-child{margin-top:.4em}
.prose em{font-style:italic}
.prose a,.notes a,.refs a{color:var(--violet);border-bottom:1px solid var(--line);overflow-wrap:anywhere;transition:border-color .25s}
.prose a:hover,.notes a:hover,.refs a:hover{border-color:var(--violet)}
sup.fn{font-size:.68em;line-height:0;margin-left:1px;font-family:'Space Grotesk',sans-serif;font-weight:600}
sup.fn a{border:none;padding:0 1px}
.prose blockquote{margin:1.6em 0 .6em;padding:6px 0 6px 22px;border-left:3px solid var(--violet);font-style:italic;font-size:1.12rem}
.prose blockquote p{margin:0}
.prose .quote-source{color:var(--muted);font-size:.95rem;margin:0 0 1.6em 25px}
.prose .principle{background:var(--card);border:1px solid var(--line);border-left:3px solid var(--violet);border-radius:16px;padding:8px 26px 10px;margin:52px 0 12px}
.prose .principle h2{margin-top:.9em}
.prose .principle p:last-child{margin-bottom:.6em}
.closing{margin:2em 0 0;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:1.2rem}
.closing a{color:var(--violet)}

/* ===== poznámky pod čarou a reference ===== */
.notes{margin-top:60px;padding-top:26px;border-top:1px solid var(--line)}
.notes h2{font-size:.78rem;letter-spacing:.22em;text-transform:uppercase;color:var(--violet);font-weight:500;margin-bottom:16px}
.notes ol{padding-left:2.2em}
.notes li{font-size:.86rem;color:var(--muted);line-height:1.6;margin-bottom:11px;overflow-wrap:anywhere;padding-left:.3em;scroll-margin-top:100px}
.notes li::marker{color:var(--violet2);font-weight:600}
.notes li:target{color:var(--ink);background:var(--card-hover);border-radius:8px}
.notes .back{border:none;margin-left:.3em;font-size:1rem}
.refs{list-style:none;margin-top:30px;display:grid;gap:14px}
.refs li{font-size:.95rem;line-height:1.6;padding-left:1.5em;text-indent:-1.5em;color:var(--ink);overflow-wrap:anywhere}

/* ===== předchozí / další ===== */
.pager{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:60px 0 28px}
.pager a{display:block;border:1px solid var(--line);border-radius:16px;padding:16px 20px;background:var(--card);transition:transform .3s,border-color .3s,background .3s}
.pager a:hover{transform:translateY(-4px);border-color:var(--violet);background:var(--card-hover)}
.pager small{display:block;font-size:.68rem;letter-spacing:.2em;text-transform:uppercase;color:var(--violet);margin-bottom:6px}
.pager span{font-family:'Space Grotesk',sans-serif;font-weight:600;font-size:.98rem;line-height:1.35;display:block}
.pager .next{text-align:right;grid-column:2}
.pager .prev{grid-column:1}

/* ===== výzva k akci a tlačítka ===== */
.cta{border:1px solid var(--line);border-radius:18px;background:var(--card);padding:28px 28px 30px;text-align:center;margin:0 0 20px}
.cta h2{font-size:1.4rem;margin-bottom:6px}
.cta p{color:var(--muted);margin-bottom:20px;font-size:.98rem}
.cta-row{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}
.btn{display:inline-block;border:1px solid var(--violet2);background:var(--violet2);color:var(--btn-ink);border-radius:100px;padding:12px 26px;
  font-size:.76rem;letter-spacing:.18em;text-transform:uppercase;font-weight:500;transition:background .3s,color .3s,border-color .3s}
.btn:hover{background:transparent;color:var(--ink);border-color:var(--violet)}
.btn.ghost{background:transparent;color:var(--ink)}
.btn.ghost:hover{background:var(--violet2);color:var(--btn-ink)}

/* ===== úvodní stránka knihy ===== */
.book-hero{display:grid;grid-template-columns:260px 1fr;gap:56px;align-items:center;margin-bottom:72px}
.book-hero img{width:100%;border-radius:10px;box-shadow:var(--book-shadow)}
.by{font-family:'Space Grotesk',sans-serif;font-weight:600;color:var(--violet);margin-bottom:18px;font-size:1.05rem}
.book-hero .cta-row{justify-content:flex-start}
.blurb{max-width:38rem;margin-bottom:26px;font-size:1.02rem;line-height:1.75}
.note{color:var(--muted);font-size:.85rem;margin-top:16px}
.sec-h{font-size:clamp(1.5rem,3vw,1.9rem);margin-bottom:24px}
.chapters{list-style:none;display:grid;gap:14px;margin-bottom:72px}
.chapter-card{display:grid;grid-template-columns:78px 1fr;gap:18px;align-items:start;border:1px solid var(--line);border-radius:16px;background:var(--card);padding:20px 24px;transition:transform .3s,border-color .3s,background .3s}
.chapter-card:hover{transform:translateY(-3px);border-color:var(--violet);background:var(--card-hover)}
.chapter-card .num{font-family:'Space Grotesk',sans-serif;font-weight:700;color:var(--violet);font-size:1.05rem;padding-top:2px}
.chapter-card .ct b{display:block;font-family:'Space Grotesk',sans-serif;font-size:1.12rem;line-height:1.3;font-weight:600}
.chapter-card .ct i{display:block;font-style:normal;color:var(--violet);font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;margin-top:6px}
.chapter-card .ct em{display:block;font-style:normal;color:var(--muted);font-size:.92rem;margin-top:8px;line-height:1.55}
.chapter-card.small{padding:16px 24px}
.imprint dl{display:grid;grid-template-columns:130px 1fr;gap:10px 24px;font-size:.95rem}
.imprint dt{color:var(--muted)}
.imprint dd{overflow-wrap:anywhere}

/* ===== rozcestník knih ===== */
.books-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin-top:44px}
.book-card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:24px;display:flex;flex-direction:column;transition:transform .3s,border-color .3s}
.book-card:hover{transform:translateY(-6px);border-color:var(--violet)}
.book-card img{width:100%;aspect-ratio:400/566;object-fit:cover;border-radius:10px;box-shadow:var(--book-shadow)}
.book-card h2{margin-top:22px;font-size:1.25rem;font-weight:600}
.book-card .meta{color:var(--violet);font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;margin-top:6px}
.book-card p{color:var(--muted);font-size:.92rem;margin:12px 0 22px}
.book-card .btns{margin-top:auto;display:flex;gap:10px;flex-wrap:wrap}
.book-card .btn{padding:11px 20px;flex:1 1 auto;text-align:center}

/* ===== responzivita ===== */
@media(max-width:900px){
  body>nav{padding:12px 20px}
  .nav-right{gap:14px}
  .hamburger{display:block}
  .nav-links{display:none;position:absolute;top:100%;left:0;width:100%;flex-direction:column;gap:0;background:var(--menu-bg);border-bottom:1px solid var(--line)}
  .nav-links.active{display:flex}
  .nav-links a{padding:16px 24px;width:100%;text-align:center;border-top:1px solid var(--line)}
  .nav-cta{border:none;border-radius:0}
  .wrap{padding:92px 20px 40px}
  .book-hero{grid-template-columns:1fr;gap:32px;text-align:center;margin-bottom:56px}
  .book-hero img{max-width:240px;margin:0 auto}
  .blurb{margin-left:auto;margin-right:auto}
  .book-hero .cta-row{justify-content:center}
  .books-grid{grid-template-columns:1fr;max-width:380px;margin-left:auto;margin-right:auto}
  .chapter-card{grid-template-columns:1fr;gap:6px}
  .imprint dl{grid-template-columns:1fr;gap:2px}
  .imprint dd{margin-bottom:12px}
}
@media(max-width:560px){
  .prose p{font-size:1.04rem;line-height:1.8}
  .pager{grid-template-columns:1fr}
  .pager .next,.pager .prev{grid-column:1;text-align:left}
  .cta{padding:24px 20px}
  .prose .principle{padding:6px 18px 8px}
}
/* ===== kniha 2: obrázky, tabulky, rámečky ===== */
.scene-time{font-family:'Space Grotesk',sans-serif;font-size:.8rem;letter-spacing:.2em;text-transform:uppercase;color:var(--violet);margin:2.2em 0 .2em;font-weight:500}
.scene-time:first-child{margin-top:0}
.fig{margin:1.8em 0}
.fig-box{background:#fbf9f6;border:1px solid var(--line);border-radius:14px;padding:16px 18px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.fig-box img{margin:0 auto;max-width:none;width:100%;height:auto}
.fig.hw .fig-box{padding:12px 18px}
.fig.hw img{max-width:100%;width:auto;max-height:260px}
.fig.hw.tall img{max-height:none}
.fig.crop img{width:100%}
.callout{margin:1.8em 0;border:1px solid var(--line);border-radius:14px;background:var(--card);padding:20px 24px}
.callout p{font-size:.98rem;line-height:1.7;margin-bottom:.9em}
.callout p:last-child{margin-bottom:0}
.callout.cols{display:grid;grid-template-columns:1fr 1fr;gap:6px 36px}
.callout .co h3{font-size:1rem;margin:.9em 0 .5em;color:var(--violet)}
.callout .co:first-child h3:first-child,.callout .co:nth-child(2) h3:first-child{margin-top:0}
.callout ul{padding-left:1.2em}
.callout li{font-size:.95rem;line-height:1.6;margin-bottom:.4em}
.callout li::marker{color:var(--violet2)}
.tbl-wrap{margin:1.8em 0;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:14px;background:var(--card)}
table.data{border-collapse:collapse;width:100%;min-width:560px;font-size:.92rem;line-height:1.5}
table.data th,table.data td{padding:10px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
table.data thead th{font-size:.78rem;letter-spacing:.04em;color:var(--violet);font-weight:600}
table.data tbody th,table.data tfoot th{font-weight:500}
table.data td:nth-child(n+3){text-align:center;white-space:nowrap}
table.data tfoot td,table.data tfoot th{font-weight:700;border-bottom:none}
@media(max-width:700px){.callout.cols{grid-template-columns:1fr}.callout{padding:16px 18px}.fig-box{padding:10px 12px}}

@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}
@media print{
  nav,.progress,.pager,.cta,.skip,footer,.theme-btn{display:none!important}
  body{background:#fff;color:#000}
  .wrap{padding:0}
  .prose p{font-size:11pt;color:#000}
  a{color:#000!important;border:none!important}
}

/* ===== kniha 3: seznamy, podnadpisy, dotazy, upozornění, vzorce, tabulky ===== */
.prose h3{font-size:clamp(1.15rem,2.3vw,1.4rem);font-weight:600;line-height:1.3;margin:2em 0 .7em;scroll-margin-top:96px}
.prose h4{font-size:1.08rem;font-weight:600;line-height:1.35;margin:1.8em 0 .6em;color:var(--violet);font-family:'Space Grotesk',sans-serif;scroll-margin-top:96px}
.prose h5,.prose h6{font-size:.98rem;font-weight:600;line-height:1.4;margin:1.5em 0 .5em;font-family:'Space Grotesk',sans-serif;scroll-margin-top:96px}
.prose .subhead{font-family:'Space Grotesk',sans-serif;font-weight:600;font-size:1rem;margin:1.5em 0 .5em}
.prose strong{font-weight:600}
.prose ul,.prose ol{margin:0 0 1.3em;padding-left:1.6em}
.prose li{font-size:1.08rem;line-height:1.78;margin-bottom:.55em;overflow-wrap:break-word}
.prose li::marker{color:var(--violet2);font-weight:600}
.prose li ul,.prose li ol{margin:.55em 0 .2em}
.prose li>p{margin:0 0 .7em;font-size:inherit}
.prose li>p:last-child{margin-bottom:0}
.prose li>p+p,.prose li>.formula{margin-top:.7em}
.prose ol.refs{display:block;margin-top:.8em;padding-left:2.6em;gap:0}
.prose ol.refs li{font-size:.95rem;line-height:1.65;padding-left:.2em;text-indent:0;margin-bottom:.8em}
.query{margin:0 0 1.2em}
.prose .query code,.prose td code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88rem;line-height:1.6;overflow-wrap:anywhere;word-break:break-word}
.prose .query code{display:block;background:var(--card);border:1px solid var(--line);border-left:3px solid var(--violet);border-radius:10px;padding:10px 14px;white-space:pre-wrap;-webkit-user-select:all;user-select:all}
.notice{margin:0 0 2em;padding:14px 18px 15px;background:var(--card);border:1px solid var(--line);border-left:3px solid var(--violet);border-radius:12px}
.notice b{display:block;font-family:'Space Grotesk',sans-serif;font-size:.74rem;letter-spacing:.2em;text-transform:uppercase;color:var(--violet);font-weight:600;margin-bottom:6px}
.notice p{font-size:.93rem;line-height:1.65;color:var(--muted);margin:0}
.book-hero~.notice{max-width:48rem}
.prose .formula{font-size:1.08rem;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.5em 1.4em;margin:1.2em 0;text-align:center}
.prose li>.formula{justify-content:flex-start}
.formula .frac{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;margin:0 .3em}
.formula .frac span{padding:0 .5em;line-height:1.5}
.formula .frac span:first-child{border-bottom:1px solid currentColor}
.fig figcaption{font-size:.9rem;line-height:1.55;color:var(--muted);margin-top:10px;text-align:left}
.fig .cap-label{color:var(--violet);font-weight:600}
.fig img{margin:0 auto}
.toc-page .grp,.toc-main .grp{font-family:'Space Grotesk',sans-serif;font-size:.78rem;letter-spacing:.2em;text-transform:uppercase;color:var(--violet);margin:2em 0 14px;font-weight:600}
.toc-main .chapters{margin-bottom:28px}
.imprint{margin-bottom:48px}
.tbl-fig{margin:1.8em 0}
.tbl-fig .tbl-wrap{margin:.7em 0 0}
.tbl-fig figcaption{font-size:.9rem;line-height:1.55;color:var(--muted)}
.tbl-fig .cap-label{color:var(--violet);font-weight:600}
table.data.b3 td:nth-child(n+3){text-align:left;white-space:normal}
table.data.b3{min-width:0}
table.data.b3.num td{white-space:nowrap}
table.data.b3.num td,table.data.b3.num thead th:not(:first-child){text-align:center}
table.data.b3 tbody th[scope=row]{white-space:normal;min-width:9em}
table.data.b3 th[scope=rowgroup]{background:var(--card-hover);vertical-align:top;min-width:7em}
table.data.b3 td code,table.data.b3 th code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.82rem;overflow-wrap:anywhere}
table.data.b3.code td:nth-child(n+2){white-space:normal}
@media(max-width:560px){
  table.data.b3 th,table.data.b3 td{padding:8px 9px;font-size:.84rem}
  .prose li{font-size:1.02rem}
  .prose ul,.prose ol{padding-left:1.3em}
  .prose ol.refs{padding-left:2.3em}
}
