/* SFU PDF Katalog – prohlížeč */
:root {
	--sfu-accent: #cc7921;
	--sfu-accent-dark: #a95f12;
	--sfu-ink: #111;
	--sfu-text: #4a4a4a;
	--sfu-muted: #8a8a8a;
	--sfu-bg: #efedea;
	--sfu-panel: #fff;
	--sfu-line: rgba(0, 0, 0, .08);
	--sfu-radius: 14px;
	--sfu-font: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background: var(--sfu-bg);
	color: var(--sfu-text);
	font: 15px/1.5 var(--sfu-font);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.sfu-v {
	display: grid;
	grid-template-rows: auto 1fr auto;
	height: 100%;
	height: 100dvh;
	background:
		radial-gradient(1200px 600px at 50% 40%, #faf9f7 0%, rgba(250, 249, 247, 0) 70%),
		var(--sfu-bg);
}

/* Horní lišta */
.sfu-v__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px 10px 18px;
	background: var(--sfu-panel);
	border-bottom: 1px solid var(--sfu-line);
	box-shadow: 0 2px 14px rgba(0, 0, 0, .04);
	z-index: 5;
}
.sfu-v__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sfu-v__logo { display: inline-flex; flex: none; }
.sfu-v__logo--custom img { display: block; height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.sfu-v__title h1 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--sfu-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sfu-v__tools { display: flex; gap: 6px; flex: none; }
.sfu-v__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: #f4f3f1;
	color: var(--sfu-ink);
	cursor: pointer;
	transition: background .15s, color .15s, transform .15s;
	text-decoration: none;
}
.sfu-v__btn[hidden] { display: none; }
.sfu-v__btn:hover { background: var(--sfu-accent); color: #fff; }
.sfu-v__btn:active { transform: scale(.95); }
.sfu-v__btn:focus-visible, .sfu-v__arrow:focus-visible { outline: 3px solid rgba(204, 121, 33, .45); outline-offset: 2px; }
.sfu-v__btn svg, .sfu-v__arrow svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.sfu-v__btn--close { background: var(--sfu-ink); color: #fff; }

/* Plocha s knihou */
.sfu-v__stage {
	position: relative;
	min-height: 0;
	padding: 28px 76px;
	outline: none;
}
.sfu-v__book {
	position: relative;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity .4s ease;
}
.is-ready .sfu-v__book { opacity: 1; }

.sfu-page {
	background: #fff;
	overflow: hidden;
}
.sfu-v__book .stf__block { filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .16)); }
/* Jemný stín u hřbetu knihy */
.sfu-page.--left .sfu-page__inner::after,
.sfu-page.--right .sfu-page__inner::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 7%;
	pointer-events: none;
	z-index: 2;
}
.sfu-page.--left .sfu-page__inner::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)); }
.sfu-page.--right .sfu-page__inner::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0)); }
.sfu-page.--hard .sfu-page__inner::after { display: none; }
.stf__wrapper.--portrait .sfu-page__inner::after { display: none; }
.sfu-page__inner {
	position: relative;
	width: 100%;
	height: 100%;
	background: #fff;
}
.sfu-page__inner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	opacity: 0;
	transition: opacity .25s;
}
.sfu-page__inner img.is-in { opacity: 1; }
.sfu-page__ph {
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #f6f5f3 30%, #ecebe8 50%, #f6f5f3 70%) 0 0 / 300% 100%;
	animation: sfu-shimmer 1.4s linear infinite;
}
@keyframes sfu-shimmer { to { background-position: -150% 0; } }

/* Šipky */
.sfu-v__arrow {
	position: absolute;
	top: 50%;
	width: 52px;
	height: 52px;
	margin-top: -26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--sfu-panel);
	color: var(--sfu-ink);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
	cursor: pointer;
	z-index: 4;
	transition: background .15s, color .15s, opacity .2s, transform .15s;
}
.sfu-v__arrow svg { width: 24px; height: 24px; stroke-width: 2.4; }
.sfu-v__arrow:hover { background: var(--sfu-accent); color: #fff; transform: scale(1.05); }
.sfu-v__arrow--prev { left: 14px; }
.sfu-v__arrow--next { right: 14px; }
.is-first .sfu-v__arrow--prev, .is-last .sfu-v__arrow--next { opacity: .25; pointer-events: none; }
.sfu-v:not(.is-ready) .sfu-v__arrow { display: none; }

/* Načítání */
.sfu-v__loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: var(--sfu-muted);
	font-size: 14px;
}
.sfu-v__loader[hidden] { display: none; }
.sfu-v__loader.is-error .sfu-v__spinner { display: none; }
.sfu-v__loader a { color: var(--sfu-accent); font-weight: 600; }
.sfu-v__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(204, 121, 33, .2);
	border-top-color: var(--sfu-accent);
	border-radius: 50%;
	animation: sfu-spin .8s linear infinite;
}
@keyframes sfu-spin { to { transform: rotate(360deg); } }

/* Spodní navigace */
.sfu-v__nav {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
	background: var(--sfu-panel);
	border-top: 1px solid var(--sfu-line);
}
.sfu-v__count {
	flex: none;
	min-width: 76px;
	text-align: right;
	font-weight: 600;
	color: var(--sfu-ink);
	font-variant-numeric: tabular-nums;
	font-size: 14px;
}
#sfu-range {
	flex: 1;
	appearance: none;
	-webkit-appearance: none;
	height: 6px;
	border-radius: 6px;
	background: #ebe9e6;
	outline: none;
	cursor: pointer;
}
#sfu-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--sfu-accent);
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
#sfu-range::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--sfu-accent);
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
#sfu-range:focus-visible { box-shadow: 0 0 0 3px rgba(204, 121, 33, .35); }

/* Přiblížení */
.sfu-v__zoom {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: #161616;
	z-index: 20;
}
.sfu-v__zoom[hidden] { display: none; }
.sfu-v__zoom-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 10px 20px;
	color: #fff;
	font-weight: 500;
}
.sfu-v__zoom-bar .sfu-v__btn { background: rgba(255, 255, 255, .12); color: #fff; }
.sfu-v__zoom-bar .sfu-v__btn:hover { background: var(--sfu-accent); }
.sfu-v__zoom-scroll {
	flex: 1;
	overflow: auto;
	padding: 0 16px 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-content: flex-start;
	gap: 16px;
	-webkit-overflow-scrolling: touch;
}
.sfu-v__zoom-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	min-width: 200px;
}
.sfu-v__zoom-page img {
	display: block;
	max-width: min(100%, 1100px);
	height: auto;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
	cursor: zoom-in;
}
.sfu-v__zoom-scroll.is-large { display: block; text-align: center; }
.sfu-v__zoom-scroll.is-large .sfu-v__zoom-page { display: block; margin: 0 auto 16px; }
.sfu-v__zoom-scroll.is-large .sfu-v__zoom-page img { max-width: none; width: 200%; max-width: 2400px; cursor: zoom-out; margin: 0 auto; }

/* Mobil */
@media (max-width: 640px) {
	.sfu-v__bar { padding: 8px 10px 8px 14px; }
	.sfu-v__title h1 { font-size: 14px; }
	.sfu-v__logo { display: none; }
	.sfu-v__logo--custom { display: inline-flex; }
	.sfu-v__logo--custom img { height: 26px; max-width: 110px; }
	.sfu-v__btn { width: 36px; height: 36px; }
	.sfu-v__stage { padding: 14px 12px 14px; }
	.sfu-v__arrow { width: 40px; height: 40px; margin-top: -20px; background: rgba(255, 255, 255, .92); }
	.sfu-v__arrow--prev { left: 6px; }
	.sfu-v__arrow--next { right: 6px; }
	.sfu-v__nav { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.sfu-page__ph { animation: none; }
}
