/* =========================================================
   BABIČČIN RECEPTÁŘ – stará rodinná kuchařka
   Juana (názvy) · Brygada 1918 (text) · Engraving CC (kapitoly)
   Sweet Mavka Script (babiččiny poznámky perem)
   ========================================================= */
@font-face { font-family: "Juana"; src: url(fonty/juana-semibold.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Juana"; src: url(fonty/juana-semibold-it.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Juana"; src: url(fonty/juana-it.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Brygada"; src: url(fonty/brygada.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Brygada"; src: url(fonty/brygada-it.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Kresba"; src: url(fonty/rucni.woff2) format("woff2"); font-display: swap; size-adjust: 128%; }
@font-face { font-family: "Pero"; src: url(fonty/ruka.woff2) format("woff2"); font-display: swap; }

:root {
  --stul: #24180F;
  --papir: #F3EAD7;
  --orez: #D9C9A9;
  --inkoust: #2A1E15;
  --tlumene: #6A5848;
  --rumelka: #9A2B1A;        /* tisková červeň starých kuchařek */
  --rumelka-svetla: #E9CDBB;
  --pero: #24427A;           /* modrý inkoust */
  --tuzka: #A0352A;          /* červená pastelka na odškrtávání */
  --zlato: linear-gradient(100deg, #9E7130 0%, #E9CB82 30%, #B5873B 52%, #F3DFA2 74%, #94672A 100%);
  --zlato-plne: #CDA65C;
  --desky: #6B1D14;

  --zaklad: 1.3125rem;       /* 21 px; A+ zvětší */
  --juana: "Juana", "Iowan Old Style", Georgia, serif;
  --text: "Brygada", "Iowan Old Style", Georgia, serif;
  --rytina: "Kresba", "Juana", Georgia, serif;
  --ruka: "Pero", "Segoe Script", cursive;
  --ease: cubic-bezier(.22, .7, .2, 1);
  color-scheme: light;
}
html[data-velikost="1"] { --zaklad: 1.5rem; }
html[data-velikost="2"] { --zaklad: 1.75rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background-color: var(--stul);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgb(255 214 150 / .16), transparent 70%),
    url(textury/platno.png);
  background-blend-mode: normal, soft-light;
  color: var(--inkoust);
  font: 400 var(--zaklad)/1.62 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
main { flex: 1; outline: none; padding: 8px 0 28px; }
main:focus, main:focus-visible { outline: none; }
img, video, iframe, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--rumelka); text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--zlato-plne); outline-offset: 3px; border-radius: 6px; }
.strana :focus-visible { outline-color: var(--rumelka); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skok { position: absolute; left: 12px; top: -80px; z-index: 60; background: var(--papir); color: var(--inkoust);
  padding: 12px 18px; border-radius: 8px; text-decoration: none; }
.skok:focus { top: 12px; }

/* ---------- Horní ovládání na stole ---------- */
.ovladani { position: sticky; top: 0; z-index: 30; background: linear-gradient(var(--stul) 70%, rgb(36 24 15 / 0)); }
.ovladani__in { max-width: 1320px; margin: 0 auto; padding: 12px clamp(14px, 3vw, 32px) 14px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.ovladani__obsah { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 14px;
  border-radius: 999px; color: #F0DFC0; text-decoration: none; font: 600 1.05rem/1 var(--text); letter-spacing: .02em;
  border: 1px solid rgb(205 166 92 / .45); transition: background .2s, border-color .2s, transform .15s var(--ease); }
.ovladani__obsah svg { width: 22px; height: 22px; color: var(--zlato-plne); }
.ovladani__obsah:hover { background: rgb(205 166 92 / .12); border-color: var(--zlato-plne); }
.ovladani__obsah:active { transform: scale(.97); }
.ovladani__nazev { padding: .35em .1em .15em; font: 1.3rem/1 var(--rytina); letter-spacing: .03em;
  background: var(--zlato); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.pismo { justify-self: end; display: flex; gap: 8px; }
.pismo__btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgb(205 166 92 / .45); background: transparent; color: #F0DFC0;
  font: 600 1.05rem/1 var(--juana); cursor: pointer; transition: background .2s, border-color .2s, transform .15s var(--ease), opacity .2s; }
.pismo__btn--velke { font-size: 1.35rem; }
.pismo__btn span { font: 700 .8em/1 var(--text); margin-left: 1px; }
.pismo__btn:hover { background: rgb(205 166 92 / .12); border-color: var(--zlato-plne); }
.pismo__btn:active { transform: scale(.92); }
.pismo__btn:disabled { opacity: .35; cursor: default; background: transparent; }

/* ---------- Kniha (dvojstrana) ---------- */
.kniha { position: relative; width: min(1260px, calc(100% - 2 * clamp(10px, 3vw, 40px))); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; perspective: 2400px;
  filter: drop-shadow(0 30px 40px rgb(0 0 0 / .45)) drop-shadow(0 6px 10px rgb(0 0 0 / .3)); }
/* ořízka (vrstvy listů pod stránkami) */
.kniha::before { content: ""; position: absolute; inset: 8px -7px -9px -7px; z-index: -1; border-radius: 6px;
  background: repeating-linear-gradient(to bottom, #E2D5BB 0 1px, #CDBB98 1px 2px); }
.strana { position: relative; min-width: 0; padding: clamp(34px, 4.6vw, 68px) clamp(26px, 4.4vw, 66px) 84px;
  background-color: var(--papir); background-image: url(textury/papir.png); background-blend-mode: soft-light; }
.strana--leva { border-radius: 6px 2px 2px 6px;
  box-shadow: inset -42px 0 50px -30px rgb(80 50 20 / .30), inset -2px 0 0 rgb(80 50 20 / .12), inset 14px 0 22px -18px rgb(80 50 20 / .18); }
.strana--prava { border-radius: 2px 6px 6px 2px;
  box-shadow: inset 42px 0 50px -30px rgb(80 50 20 / .30), inset 2px 0 0 rgb(80 50 20 / .10), inset -14px 0 22px -18px rgb(80 50 20 / .18); }
.strana__cislo { position: absolute; bottom: 30px; font: italic 400 .95rem/1 var(--juana); color: var(--tlumene); }
.strana--leva .strana__cislo { left: clamp(26px, 4.4vw, 66px); }
.strana--prava .strana__cislo { right: clamp(26px, 4.4vw, 66px); }
.zahlavi { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 1rem/1.2 var(--rytina); letter-spacing: .03em;
  color: var(--tlumene); padding-bottom: 12px; margin-bottom: clamp(22px, 3vw, 38px); border-bottom: 1px solid var(--orez); }
.zahlavi > span { white-space: nowrap; }
.zahlavi__kurziva { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: italic 400 1rem/1.2 var(--juana); letter-spacing: 0; text-transform: none; }

/* ---------- Ozdoby ---------- */
.ozdoba { width: min(240px, 70%); height: auto; color: var(--rumelka); margin: 18px auto; }

/* ---------- Titulní strana ---------- */
.titul { text-align: center; display: flex; flex-direction: column; align-items: center; }
.titul__venec { width: min(230px, 60%); color: var(--rumelka); margin: 6px auto 6px; }
.titul__nad { font: 1.05rem/1.3 var(--rytina); letter-spacing: .03em; color: var(--tlumene); margin: 0; }
.titul__nadpis { margin: .18em 0 0; font: italic 600 clamp(3rem, 6.4vw, 5.6rem)/.92 var(--juana); letter-spacing: -.02em; color: var(--inkoust); }
.titul__nadpis span { display: block; color: var(--rumelka); }
.titul__venovani { font: 1.75em/1.1 var(--ruka); color: var(--pero); margin: .55em 0 0; transform: rotate(-3deg); }
.titul__text { max-width: 25em; margin: 1.2em auto 0; color: var(--tlumene); font-style: italic; }

.hledani { position: relative; width: 100%; max-width: 440px; margin: 1.6em auto 0; text-align: left; }
.hledani label { display: block; font: 600 .8rem/1.2 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--tlumene); margin-bottom: 6px; }
.hledani__pole { width: 100%; height: 58px; padding: 0 48px 0 40px; border: 0; border-bottom: 2px solid var(--inkoust); border-radius: 0;
  background: transparent; font: italic 400 1.15em/1 var(--juana); -webkit-appearance: none; appearance: none; transition: border-color .2s; }
.hledani__pole::-webkit-search-cancel-button { display: none; }
.hledani__pole::placeholder { color: #75624F; }
.hledani__pole:focus { outline: none; border-bottom-color: var(--rumelka); }
.hledani__ikona { position: absolute; left: 4px; bottom: 16px; width: 26px; height: 26px; color: var(--tlumene); pointer-events: none; }
.hledani__smazat { position: absolute; right: 0; bottom: 5px; width: 48px; height: 48px; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; color: var(--tlumene); display: none; place-items: center; }
.hledani__smazat:hover { color: var(--rumelka); background: var(--rumelka-svetla); }
.hledani.ma-text .hledani__smazat { display: grid; }

/* ---------- Obsah ---------- */
.obsah__nadpis { font: italic 600 clamp(2.4rem, 4.4vw, 3.4rem)/1 var(--juana); margin: 0; text-align: center; letter-spacing: -.01em; }
.kapitola { margin-top: 1.5em; }
.kapitola[hidden] { display: none; }
.kapitola__nadpis { display: flex; align-items: baseline; gap: .6em; margin: 0 0 .35em; font: 1.5rem/1.2 var(--rytina); letter-spacing: .03em;
  color: var(--rumelka); }
.kapitola__nadpis b { font: italic 600 1.35rem/1 var(--juana); letter-spacing: 0; }
.polozky { list-style: none; margin: 0; padding: 0; }
.polozka[hidden] { display: none; }
.polozka a { display: flex; align-items: center; gap: 8px; padding: 9px 0; min-height: 52px; text-decoration: none; color: var(--inkoust);
  border-radius: 4px; transition: color .2s; }
.polozka__foto { flex: none; align-self: center; width: 64px; height: 64px; object-fit: cover; padding: 3px; background: #FBF7EE;
  box-shadow: 0 1px 1px rgb(60 40 20 / .18), 0 4px 10px -4px rgb(60 40 20 / .45); transform: rotate(-2deg); margin-right: 6px; transition: transform .3s var(--ease); }
.polozka:nth-child(even) .polozka__foto { transform: rotate(1.8deg); }
.polozka a:hover .polozka__foto { transform: rotate(0) scale(1.04); }
.polozka__nazev { position: relative; flex: 0 1 auto; min-width: 0; font-size: 1.08em; line-height: 1.35; }
.polozka__nazev::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--rumelka);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.polozka a:hover { color: var(--rumelka); }
.polozka a:hover .polozka__nazev::after { transform: scaleX(1); }
.polozka__video { flex: none; align-self: center; width: 22px; height: 22px; color: var(--rumelka); }
.polozka__tecky { flex: 1 1 40px; min-width: 40px; align-self: flex-end; margin-bottom: .55em; border-bottom: 2px dotted #B6A385; }
.polozka__str { position: relative; flex: none; align-self: flex-end; margin-bottom: .3em; font: italic 400 1.05em/1 var(--juana); color: var(--tlumene); min-width: 1.6em; text-align: right; }
.nic { font: 1.6em/1.2 var(--ruka); color: var(--pero); text-align: center; margin: 1.4em 0 .6em; }
.nic[hidden] { display: none; }
.odkaz-vse { display: block; margin: 0 auto; min-height: 48px; padding: 0 18px; border: 1px solid var(--orez); border-radius: 999px; background: transparent; cursor: pointer;
  font: italic 400 1em/1 var(--juana); color: var(--rumelka); transition: border-color .2s, transform .15s var(--ease); }
.odkaz-vse:hover { border-color: var(--rumelka); }
.odkaz-vse:active { transform: scale(.97); }
.odkaz-vse[hidden] { display: none; }

/* ---------- Recept ---------- */
.recept__kat { margin: 0 0 .3em; font: 1.1rem/1.2 var(--rytina); letter-spacing: .03em; color: var(--rumelka); }
.recept__nazev { margin: 0; font: italic 600 clamp(2.5rem, 4.8vw, 4rem)/.98 var(--juana); letter-spacing: -.02em; text-wrap: balance; }
.fakta { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .9em; margin: .9em 0 0; padding: 0; list-style: none;
  font: italic 400 1.08em/1.3 var(--juana); color: var(--tlumene); }
.fakta li { display: inline-flex; align-items: center; gap: .4em; }
.fakta svg { width: 1.05em; height: 1.05em; color: var(--rumelka); }
.svetlo { margin: .8em 0 0; font: 1.15em/1.2 var(--ruka); color: var(--pero); }
.svetlo[hidden] { display: none; }

/* vlepená fotka / video s lepicí páskou */
.vlepene { position: relative; margin: clamp(26px, 3.4vw, 40px) 4px clamp(30px, 3.6vw, 44px); padding: 10px 10px 12px; background: #FBF7EE;
  box-shadow: 0 1px 1px rgb(60 40 20 / .15), 0 10px 24px -12px rgb(60 40 20 / .5); transform: rotate(-1.2deg); }
.vlepene--video { transform: rotate(.6deg); }
.vlepene::before, .vlepene::after { content: ""; position: absolute; top: -14px; width: 110px; height: 30px; z-index: 2;
  background: linear-gradient(rgb(238 226 196 / .78), rgb(226 212 178 / .78)); box-shadow: 0 1px 2px rgb(60 40 20 / .18);
  clip-path: polygon(3% 0, 97% 6%, 100% 50%, 96% 100%, 2% 94%, 0 45%); }
.vlepene::before { left: -20px; transform: rotate(-32deg); }
.vlepene::after { right: -20px; transform: rotate(30deg); }
.vlepene > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: sepia(.08) saturate(.95); }
.vlepene__video { position: relative; aspect-ratio: 16 / 9; background: #120c08; }
.vlepene__video--na-vysku { aspect-ratio: 9 / 16; max-height: 78vh; margin: 0 auto; }
.vlepene__video--foto { aspect-ratio: 4 / 3; }
.vlepene__video iframe, .vlepene__video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.spust { position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: #120c08; display: grid; place-items: center; overflow: hidden; }
.spust img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: opacity .3s, transform .7s var(--ease); }
.spust:hover img { opacity: .95; transform: scale(1.03); }
.spust__kolecko { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 14px 26px 14px 18px; border-radius: 999px;
  background: var(--papir); color: var(--inkoust); font: italic 600 1.1em/1 var(--juana); box-shadow: 0 8px 24px -8px rgb(0 0 0 / .55);
  transition: transform .25s var(--ease); }
.spust__kolecko svg { width: 30px; height: 30px; color: var(--rumelka); }
.spust:hover .spust__kolecko { transform: scale(1.05); }
.spust:active .spust__kolecko { transform: scale(.97); }

.blok { margin-top: clamp(26px, 3vw, 36px); }
.strana--prava .blok:first-of-type, .vlepene + .blok { margin-top: 0; }
.blok__hlava { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 0 0 .5em; }
.blok__nadpis { margin: 0; font: 2rem/1.15 var(--rytina); letter-spacing: .03em; color: var(--rumelka); }
.blok__nadpis::after { content: ""; display: block; width: 46px; height: 2px; margin-top: 10px; background: var(--rumelka); }
.znovu { min-height: 44px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; font: italic 400 1rem/1 var(--juana);
  color: var(--tlumene); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--orez); }
.znovu:hover { color: var(--rumelka); text-decoration-color: currentColor; }
.znovu[hidden] { display: none; }

.suroviny__seznam { list-style: none; margin: 0; padding: 0; }
.suroviny__skupina { margin: 1.1em 0 .15em; font: italic 600 1.15em/1.2 var(--juana); color: var(--inkoust); }
.suroviny__skupina:first-child { margin-top: .2em; }
.surovina label { display: flex; align-items: flex-start; gap: 14px; padding: 8px 0; min-height: 50px; cursor: pointer;
  border-bottom: 1px dashed #D3C3A4; }
.surovina:last-child label { border-bottom: 0; }
.surovina input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.policko { flex: none; width: 1.45em; height: 1.45em; margin-top: .02em; color: #7D6A57; transition: transform .15s var(--ease); }
.policko .ram { fill: none; stroke: currentColor; stroke-width: 1.6; }
.policko .fajfka { fill: none; stroke: var(--tuzka); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .35s var(--ease), opacity 0s .35s; }
.surovina label:active .policko { transform: scale(.9); }
.surovina input:checked + .policko .fajfka { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .35s var(--ease), opacity 0s; }
.surovina input:focus-visible + .policko { outline: 3px solid var(--rumelka); outline-offset: 2px; border-radius: 4px; }
.surovina__text { transition: color .25s, opacity .25s; }
.surovina__text strong { font-weight: 650; }
.surovina input:checked ~ .surovina__text { color: var(--tlumene); opacity: .6; }

.rada { font-style: italic; color: var(--tlumene); margin: 0 0 1em; font-size: .92em; }
.kroky { list-style: none; margin: 0; padding: 0; }
.krok + .krok { margin-top: 6px; }
.krok__btn { position: relative; width: 100%; display: grid; grid-template-columns: 2.1em 1fr; gap: .55em; padding: 12px 10px 14px 0; text-align: left;
  border: 0; background: transparent; cursor: pointer; border-radius: 6px; line-height: 1.62; transition: background .25s; }
.krok__btn:hover { background: rgb(154 43 26 / .05); }
.krok__cislo { position: relative; font: italic 600 2em/.9 var(--juana); color: var(--rumelka); text-align: right; transition: color .3s; }
.krok__c { position: relative; display: inline-block; }
.krok__cislo svg { position: absolute; left: 50%; top: 52%; width: 1.4em; height: 1.4em; max-width: none; transform: translate(-50%, -50%); overflow: visible; }
.krok__cislo path { fill: none; stroke: var(--tuzka); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset .5s var(--ease), opacity 0s .5s; }
.krok__text { padding-top: .05em; transition: color .3s, opacity .3s; }
.krok.je-hotovo .krok__cislo { color: #C08A7E; }
.krok.je-hotovo .krok__cislo path { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .5s var(--ease), opacity 0s; }
.krok.je-hotovo .krok__text { color: var(--tlumene); opacity: .62; }

/* babiččina poznámka perem na lístečku */
.poznamka { position: relative; margin: 2em 6px 0; padding: 26px 28px 24px; background-color: #FBF3D6; transform: rotate(1.3deg);
  box-shadow: 0 1px 1px rgb(60 40 20 / .12), 0 12px 22px -14px rgb(60 40 20 / .45);
  background-image: repeating-linear-gradient(transparent 0 1.9em, rgb(36 66 122 / .12) 1.9em calc(1.9em + 1px)); background-position: 0 1.35em; }
.poznamka::before { content: ""; position: absolute; top: -13px; left: 50%; width: 96px; height: 28px; translate: -50% 0; rotate: -3deg;
  background: rgb(232 220 190 / .82); box-shadow: 0 1px 2px rgb(60 40 20 / .15); clip-path: polygon(3% 0, 97% 6%, 100% 50%, 96% 100%, 2% 94%, 0 45%); }
.poznamka__nadpis { margin: 0 0 .15em; font: 1.45em/1.1 var(--ruka); color: var(--rumelka); }
.poznamka p { margin: 0; font: 1.3em/1.46 var(--ruka); color: var(--pero); }

.zdroj { margin: 1.6em 0 0; font-style: italic; color: var(--tlumene); font-size: .9em; }

/* listování pod knihou */
.pata { text-align: center; padding: 34px 16px 40px; font: 1.3rem/1 var(--ruka); color: rgb(240 223 192 / .75); }
.listovani-nav { width: min(1260px, calc(100% - 2 * clamp(10px, 3vw, 40px))); margin: 30px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.listuj { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; border-radius: 999px; text-decoration: none; color: #F0DFC0;
  border: 1px solid rgb(205 166 92 / .45); font: italic 400 1.05rem/1.2 var(--juana); transition: background .2s, border-color .2s, transform .15s var(--ease); max-width: 100%; }
.listuj small { display: block; font: 600 .72rem/1.2 var(--text); letter-spacing: .14em; text-transform: uppercase; font-style: normal; color: var(--zlato-plne); margin-bottom: 3px; }
.listuj svg { flex: none; width: 22px; height: 22px; color: var(--zlato-plne); transition: transform .25s var(--ease); }
.listuj:hover { background: rgb(205 166 92 / .12); border-color: var(--zlato-plne); }
.listuj:active { transform: scale(.97); }
.listuj--zpet { justify-self: start; }
.listuj--zpet:hover svg { transform: translateX(-3px); }
.listuj--dal { justify-self: end; text-align: right; }
.listuj--dal:hover svg { transform: translateX(3px); }
.listuj--obsah { justify-self: center; font: 1.3rem/1 var(--rytina); letter-spacing: .03em; }
.listuj span { min-width: 0; }
.listuj--prazdne { visibility: hidden; }


/* ---------- Otočení listu ---------- */
.list { position: absolute; top: 0; bottom: 0; z-index: 10; pointer-events: none;
  background-color: var(--papir); background-image: url(textury/papir.png); background-blend-mode: soft-light; }
.list--vpred { left: 50%; right: 0; transform-origin: left center; border-radius: 2px 6px 6px 2px; animation: listVpred .8s cubic-bezier(.45, .05, .3, 1) forwards; }
.list--vzad { left: 0; right: 50%; transform-origin: right center; border-radius: 6px 2px 2px 6px; animation: listVzad .8s cubic-bezier(.45, .05, .3, 1) forwards; }
.list::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgb(60 35 15 / .05), rgb(60 35 15 / .4));
  animation: stin .8s ease forwards; }
.list--vzad::after { background: linear-gradient(270deg, rgb(60 35 15 / .05), rgb(60 35 15 / .4)); }
@keyframes listVpred { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes listVzad { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes stin { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: .1; } }

/* ---------- Desky (úvodní otevření knihy) ---------- */
.desky { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 28px;
  background-color: var(--stul); background-image: radial-gradient(ellipse 80% 60% at 50% 30%, rgb(255 214 150 / .16), transparent 70%), url(textury/platno.png);
  background-blend-mode: normal, soft-light; perspective: 2200px; cursor: pointer; transition: opacity .55s ease .75s; }
.desky[hidden] { display: none; }
.desky__kniha { position: relative; width: min(420px, 74vw, 52vh); aspect-ratio: 3 / 4.1; transform-style: preserve-3d;
  animation: knihaPrijede .9s var(--ease) both; }
.desky__predek { position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; transform-origin: left center;
  background-color: var(--desky); background-image: url(textury/platno.png), linear-gradient(100deg, rgb(0 0 0 / .28), transparent 12%, transparent 85%, rgb(0 0 0 / .2));
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3), inset 10px 0 18px -10px rgb(0 0 0 / .6), 0 40px 60px -20px rgb(0 0 0 / .7), 0 10px 18px rgb(0 0 0 / .35);
  display: grid; padding: 7%; transition: transform 1.3s cubic-bezier(.55, .05, .25, 1); }
.desky__hrbet { position: absolute; left: -14px; top: 0; bottom: 0; width: 18px; border-radius: 8px 2px 2px 8px; background-color: #4E140D;
  background-image: url(textury/platno.png); background-blend-mode: soft-light; box-shadow: inset -4px 0 8px rgb(0 0 0 / .4); }
.desky__ram { position: relative; border: 2px solid var(--zlato-plne); outline: 1px solid rgb(205 166 92 / .6); outline-offset: -9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10% 6%; }
.desky__nad, .desky__titul, .desky__pod { background: var(--zlato); -webkit-background-clip: text; background-clip: text; color: transparent; }
.desky__nad { padding: .3em .1em .1em; font: clamp(.8rem, 2.4vw, 1.05rem)/1.3 var(--rytina); letter-spacing: .03em; }
.desky__venec { width: 50%; margin: 7% 0 4%; color: var(--zlato-plne); }
.desky__titul { padding-top: .12em; font: italic 600 clamp(2.3rem, 9vw, 4.1rem)/.98 var(--juana); letter-spacing: -.01em; padding: 0 .08em; }
.desky__pod { margin-top: 9%; padding: .3em .1em .1em; font: clamp(.8rem, 2.4vw, 1.05rem)/1 var(--rytina); letter-spacing: .03em; }
.desky__otevrit { min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid rgb(205 166 92 / .55); background: transparent; color: #F0DFC0;
  font: italic 400 1.15rem/1 var(--juana); cursor: pointer; animation: knihaPrijede .9s var(--ease) .25s both; transition: background .2s, transform .15s var(--ease), opacity .2s; }
.desky__otevrit:hover { background: rgb(205 166 92 / .14); }
.desky__otevrit:active { transform: scale(.96); }
.desky.je-otevrena .desky__predek { transform: rotateY(-165deg); }
.desky.je-otevrena { opacity: 0; pointer-events: none; }
.desky.je-otevrena .desky__otevrit { opacity: 0; }
@keyframes knihaPrijede { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Tablet a telefon: jedna stránka ---------- */
@media (max-width: 899px) {
  .ovladani__nazev { display: none; }
  .ovladani__in { grid-template-columns: 1fr auto; }
  .kniha { grid-template-columns: minmax(0, 1fr); width: calc(100% - 20px); }
  .kniha::before { inset: 6px -4px -7px -4px; }
  .strana { padding: 34px clamp(20px, 5vw, 44px) 70px; }
  .strana--leva, .strana--prava { box-shadow: inset 12px 0 22px -18px rgb(80 50 20 / .25), inset -12px 0 22px -18px rgb(80 50 20 / .25); }
  .strana--leva { border-radius: 4px 4px 0 0; padding-bottom: 40px; }
  .strana--prava { border-radius: 0 0 4px 4px; padding-top: 8px; }
  .strana--leva .strana__cislo { display: none; }
  .strana--prava .zahlavi { display: none; }
  .strana--leva .zahlavi span + span { display: none; }
  .strana--prava::before { content: ""; display: block; height: 1px; margin: 0 auto 34px; width: 60%; background: linear-gradient(90deg, transparent, var(--orez), transparent); }
  .strana--prava .strana__cislo { right: 50%; translate: 50% 0; }
  .list--vpred, .list--vzad { left: 0; right: 0; }
  .listovani-nav { grid-template-columns: 1fr 1fr; width: calc(100% - 20px); }
  .listuj--obsah { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: center; }
  .listuj { padding: 8px 14px; }
}
@media (max-width: 520px) {
  .strana { padding-inline: 18px; }
  .titul__nadpis { font-size: 3.3rem; }
  .titul__venovani { font-size: 1.45em; white-space: nowrap; }
  .vlepene { margin-inline: 0; }
  .vlepene::before, .vlepene::after { width: 80px; }
  .poznamka { margin-inline: 0; padding: 24px 20px 22px; }
  .krok__btn { grid-template-columns: 1.8em 1fr; gap: .45em; }
  .listuj small { font-size: .66rem; }
  .listuj { font-size: .98rem; }
}

/* ---------- Tisk ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .ovladani, .pata, .listovani-nav, .desky, .vlepene--video, .svetlo, .znovu, .rada, .hledani { display: none !important; }
  .kniha { filter: none; grid-template-columns: 1fr 1.4fr; width: 100%; }
  .kniha::before { display: none; }
  .strana { background: #fff; box-shadow: none !important; padding: 0 12px; }
  .strana__cislo { display: none; }
  .vlepene, .poznamka { box-shadow: none; transform: none; }
  .poznamka { border: 1px solid #ccc; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Nejmenší telefony (iPhone SE): menší náhled a kratší tečky, ať se číslo stránky vejde */
@media (max-width: 360px) {
  .polozka__foto { width: 52px; height: 52px; }
  .polozka a { gap: 6px; }
  .polozka__tecky { flex-basis: 6px; min-width: 6px; }
}
