@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Brandové tokeny shodné s akce.bicz.cz (EVENTS/public/css/styles.css) */
:root {
  --dark: #11190B; --dark-2: #1A2413; --gold: #BC9251; --gold-light: #FDE895; --beige: #EBDECB;
  --grad-gold: linear-gradient(90deg, #C8A05D 0%, #FDE895 100%);
  --line: rgba(235, 222, 203, .14);
  --text-dim: rgba(255, 255, 255, .64);
  --serif: "ivyora-text", Georgia, "Times New Roman", serif;
  --sans: "Inter Display", Inter, system-ui, -apple-system, sans-serif;
  --bar: 64px;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans); letter-spacing: -0.02em; color: #fff;
  background: radial-gradient(120% 90% at 50% 45%, #1C2814 0%, var(--dark) 70%) fixed, var(--dark);
  display: grid; grid-template-rows: var(--bar) 1fr var(--bar);
  height: 100vh; height: 100dvh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }

/* --- horní lišta -------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 36px; width: auto; }
.title { display: flex; align-items: baseline; gap: 14px; min-width: 0; flex: 1; }
.title h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.issue { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue-sub { color: var(--text-dim); font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 20px; font: 600 14px/1 var(--sans); letter-spacing: -0.02em; text-decoration: none; flex: none; }
.btn-primary { background: var(--grad-gold); color: var(--dark); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-size { font-weight: 500; opacity: .6; }

/* --- plocha s knihou ---------------------------------------------------- */
.stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 88px;
}
.book { opacity: 0; transition: opacity .3s ease; min-width: 0 !important; } /* knihovna dává inline min-width = minWidth */
.is-ready .book { opacity: 1; }
.book .stf__wrapper { width: 100%; height: 100%; }
.book .stf__parent { margin: 0 auto; }
.page { background: #fff; overflow: hidden; }
.page img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-select: none; pointer-events: none; }
.book .stf__block { filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); }

.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(235, 222, 203, .28); color: var(--beige);
  transition: background .2s, border-color .2s, opacity .2s;
}
.nav-arrow svg { width: 24px; height: 24px; }
.nav-arrow:hover:not(:disabled) { background: rgba(235, 222, 203, .08); border-color: var(--gold); }
.nav-arrow:disabled { opacity: 0; pointer-events: none; }
.nav-prev { left: 20px; }
.nav-next { right: 20px; }

.noscript { color: var(--beige); text-align: center; }

/* --- spodní lišta ------------------------------------------------------- */
.toolbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
}
.tool {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--beige); transition: background .2s, color .2s;
}
.tool svg { width: 22px; height: 22px; flex: none; }
.tool:hover:not(:disabled) { background: rgba(235, 222, 203, .08); color: #fff; }
.tool:disabled { opacity: .3; cursor: default; }
.tool-label { font-size: 14px; font-weight: 500; }
.toolbar > .tool { justify-self: start; }
.pager { display: flex; align-items: center; gap: 4px; }
.page-indicator { min-width: 76px; text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; color: #fff; }
.tools-right { justify-self: end; display: flex; gap: 4px; }

/* --- panel s obsahem ---------------------------------------------------- */
.panel { position: fixed; inset: 0; z-index: 20; background: rgba(8, 12, 5, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.panel[hidden], .zoom[hidden] { display: none; }
.panel-inner {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(440px, 100%);
  background: var(--dark); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 24px 40px;
  animation: slide-in .25s ease;
}
@keyframes slide-in { from { transform: translateX(-24px); opacity: 0; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.toc { list-style: none; padding: 0; margin: 0 0 32px; }
.toc a { display: flex; gap: 16px; padding: 14px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.toc a:hover .toc-text { color: var(--gold-light); }
.toc-num { font-family: var(--serif); font-size: 22px; line-height: 1.1; color: var(--gold); min-width: 30px; }
.toc-text { font-size: 15px; line-height: 1.35; transition: color .2s; }
.toc-rubric { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; }
.thumb img { width: 100%; aspect-ratio: 595 / 842; object-fit: cover; background: rgba(255, 255, 255, .06); outline: 1px solid transparent; transition: outline-color .2s; }
.thumb span { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.thumb:hover img { outline-color: rgba(235, 222, 203, .5); }
.thumb.is-current img { outline: 2px solid var(--gold); }
.thumb.is-current span { color: var(--gold-light); }

/* --- lupa --------------------------------------------------------------- */
.zoom { position: fixed; inset: 0; z-index: 30; background: var(--dark); display: grid; grid-template-rows: var(--bar) 1fr; }
.zoom-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 24px; border-bottom: 1px solid var(--line); }
.zoom-title { font-size: 14px; font-weight: 500; color: var(--beige); }
.zoom-scroll { overflow: auto; overscroll-behavior: contain; cursor: zoom-in; -webkit-overflow-scrolling: touch; }
.zoom-pages { display: flex; justify-content: center; gap: 0; width: 100%; padding: 24px; }
.zoom-pages img { display: block; width: 50%; max-width: 1100px; height: auto; background: #fff; }
.zoom-pages img:only-child { width: 100%; }
.zoom-scroll.is-actual { cursor: zoom-out; }
.zoom-scroll.is-actual .zoom-pages { width: max-content; }
.zoom-scroll.is-actual .zoom-pages img { width: auto; max-width: none; height: 2000px; }

/* --- mobil -------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --bar: 56px; }
  .stage { padding: 12px 16px; }
  .nav-arrow { display: none; }
  .title { flex-direction: column; gap: 3px; }
  .title h1 { font-size: 21px; }
  .issue-sub { display: none; }
  .btn-download { padding: 10px 14px; }
  .btn-label, .btn-size { display: none; }
  .tool-label { display: none; }
  .zoom-pages { flex-direction: column; align-items: center; padding: 12px; gap: 12px; }
  .zoom-pages img { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .book, .panel-inner { transition: none; animation: none; }
}

/* --- 404 ---------------------------------------------------------------- */
.notfound { display: grid; place-items: center; grid-template-rows: 1fr; padding: 24px; }
.notfound-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.notfound h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.1; }
