/* Luma Čítačka – vzhľad čítačky a knižnice. */

:root,
[data-lc-theme="light"] {
	--lc-bg: #FDF9F3;
	--lc-fg: #4A423A;
	--lc-soft: #6E655B;
	--lc-faint: #A9946F;
	--lc-line: #EADDC9;
	--lc-panel: #FFFDF9;
	--lc-hover: rgba(190, 154, 99, .10);
	--lc-accent: #BE9A63;
	--lc-tint: rgba(190, 154, 99, .13);
	--lc-on-accent: #ffffff;
}

[data-lc-theme="cream"] {
	--lc-bg: #FBF5EB;
	--lc-fg: #574C3E;
	--lc-soft: #6E655B;
	--lc-faint: #B08A55;
	--lc-line: #E7D8C0;
	--lc-panel: #FDF9F3;
	--lc-hover: rgba(190, 154, 99, .12);
	--lc-accent: #A9834E;
	--lc-tint: rgba(190, 154, 99, .13);
	--lc-on-accent: #ffffff;
}

[data-lc-theme="dark"] {
	--lc-bg: #191712;
	--lc-fg: #E4DBCB;
	--lc-soft: #BFB2A0;
	--lc-faint: #9A8A6E;
	--lc-line: rgba(220, 199, 166, .16);
	--lc-panel: #221F19;
	--lc-hover: rgba(220, 199, 166, .08);
	--lc-accent: #DCC7A6;
	--lc-tint: rgba(220, 199, 166, .14);
	--lc-on-accent: #191712;
}

.lc-html,
.lc-body {
	margin: 0;
	padding: 0;
	height: 100%;
}

.lc-body {
	background: var(--lc-bg);
	color: var(--lc-fg);
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	transition: background .45s ease, color .45s ease;
}

.lc-body * {
	box-sizing: border-box;
}

.lc-body ::selection {
	background: rgba(190, 154, 99, .22);
}

.lc-body a {
	color: inherit;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@keyframes lcFadeUp {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

/* ---------- rámec aplikácie ---------- */

.lc-app {
	position: relative;
	height: 100vh;
	height: 100dvh;
	width: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--lc-bg);
	color: var(--lc-fg);
}

.lc-topline {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	z-index: 40;
}

.lc-topline span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--lc-accent);
	opacity: .55;
	transition: width .2s linear;
}

/* ---------- horná lišta ---------- */

.lc-top {
	flex: none;
	height: 58px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 14px;
	padding-top: env(safe-area-inset-top);
	box-sizing: content-box;
	z-index: 30;
	transition: opacity .35s ease;
}

.lc-icon {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	color: var(--lc-soft);
	cursor: pointer;
	border-radius: 50%;
	padding: 0;
	text-decoration: none;
	transition: background .2s, color .25s;
}

.lc-icon:hover,
.lc-icon:focus-visible {
	background: var(--lc-hover);
}

.lc-aa {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 17px;
	letter-spacing: -.02em;
}

.lc-icon[aria-pressed="true"] {
	color: var(--lc-accent);
}

.lc-icon[aria-pressed="true"] svg {
	fill: var(--lc-accent);
}

.lc-booktitle {
	font-size: 11.5px;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--lc-faint);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 8px;
}

.lc-top-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* ---------- text knihy ---------- */

.lc-scroll {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.lc-scroll::-webkit-scrollbar {
	width: 0;
}

.lc-col {
	max-width: 680px;
	margin: 0 auto;
	padding: 44px 26px 120px;
}

.lc-chapter {
	animation: lcFadeUp .5s ease both;
}

.lc-chaplabel {
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--lc-faint);
	margin-bottom: 14px;
}

.lc-chaptitle {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 300;
	font-size: 2.1em;
	line-height: 1.18;
	letter-spacing: .02em;
	margin: 0 0 44px;
	color: var(--lc-fg);
}

.lc-prose {
	font-family: 'EB Garamond', Georgia, serif;
	font-weight: 400;
	font-size: 1em;
	line-height: var(--lc-line-height, 1.75);
	letter-spacing: .002em;
}

.lc-prose p {
	margin: 0 0 1.35em;
}

.lc-prose h2 {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 400;
	font-size: 1.34em;
	line-height: 1.3;
	letter-spacing: .03em;
	margin: 2em 0 .7em;
}

.lc-prose ul,
.lc-prose ol {
	margin: 0 0 1.35em;
	padding-left: 1.4em;
}

.lc-prose li {
	margin-bottom: .5em;
}

.lc-prose img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 1.6em auto;
	border-radius: 3px;
}

.lc-prose blockquote {
	margin: 1.6em 0;
	padding-left: 1.2em;
	border-left: 1px solid var(--lc-line);
	color: var(--lc-soft);
	font-style: italic;
}

.lc-prose a {
	color: var(--lc-accent);
	text-underline-offset: 3px;
}

.lc-chapnav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 72px;
	padding-top: 26px;
	border-top: 1px solid var(--lc-line);
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
}

.lc-chapnav button {
	font-family: inherit;
	font-size: 12.5px;
	letter-spacing: .03em;
	padding: 10px 0;
	border: none;
	background: transparent;
	cursor: pointer;
	transition: opacity .2s;
}

.lc-chapnav button:hover {
	opacity: .6;
}

.lc-chapprev {
	color: var(--lc-soft);
	text-align: left;
}

.lc-chapnext {
	color: var(--lc-accent);
	text-align: right;
}

.lc-chapend {
	font-size: 12.5px;
	letter-spacing: .03em;
	color: var(--lc-faint);
}

.lc-footpct {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	letter-spacing: .08em;
	color: var(--lc-faint);
	pointer-events: none;
	transition: opacity .35s ease;
	padding-bottom: env(safe-area-inset-bottom);
}

.lc-chrome-dim {
	opacity: .45;
}

/* ---------- panely ---------- */

.lc-scrim {
	position: absolute;
	inset: 0;
	background: rgba(20, 18, 16, .28);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	z-index: 50;
	opacity: 0;
	pointer-events: none;
	transition: opacity .32s ease;
	border: 0;
	padding: 0;
}

.lc-scrim.is-open {
	opacity: 1;
	pointer-events: auto;
}

.lc-toc {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(340px, 86vw);
	z-index: 60;
	background: var(--lc-panel);
	border-right: 1px solid var(--lc-line);
	transform: translateX(-102%);
	transition: transform .38s cubic-bezier(.22, .8, .28, 1);
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 40px rgba(0, 0, 0, .10);
}

.lc-toc.is-open {
	transform: none;
}

.lc-eyebrow {
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--lc-faint);
}

.lc-toc-head {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px 14px;
	padding-top: calc(20px + env(safe-area-inset-top));
}

.lc-x {
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	color: var(--lc-faint);
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 0;
}

.lc-toc-list {
	flex: 1;
	overflow-y: auto;
	padding: 6px 12px 24px;
	scrollbar-width: none;
}

.lc-toc-list::-webkit-scrollbar {
	width: 0;
}

.lc-toc-item {
	display: flex;
	align-items: baseline;
	gap: 12px;
	width: 100%;
	padding: 13px 10px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--lc-soft);
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 17px;
	letter-spacing: .05em;
	cursor: pointer;
	text-align: left;
	transition: background .2s, color .2s;
}

.lc-toc-item:hover {
	opacity: .75;
}

.lc-toc-item.is-current {
	background: var(--lc-hover);
	color: var(--lc-fg);
}

.lc-toc-num {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 10.5px;
	letter-spacing: .04em;
	color: var(--lc-faint);
	flex: none;
}

.lc-toc-item.is-current .lc-toc-num {
	color: var(--lc-accent);
}

.lc-toc-title {
	flex: 1;
	text-align: left;
}

.lc-toc-mark {
	font-size: 10.5px;
	letter-spacing: .04em;
	opacity: .5;
	flex: none;
}

.lc-toc-foot {
	flex: none;
	border-top: 1px solid var(--lc-line);
	padding: 14px 22px 18px;
	padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.lc-bm-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 10px;
	max-height: 26vh;
	overflow-y: auto;
	scrollbar-width: none;
}

.lc-bm-list::-webkit-scrollbar {
	width: 0;
}

.lc-bm-item {
	display: flex;
	align-items: baseline;
	gap: 9px;
	width: 100%;
	padding: 8px 0;
	border: none;
	background: transparent;
	color: var(--lc-fg);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	text-align: left;
	transition: opacity .2s;
}

.lc-bm-item:hover {
	opacity: .6;
}

.lc-bm-dot {
	color: var(--lc-accent);
	font-size: 11px;
	flex: none;
}

.lc-bm-name {
	flex: 1;
}

.lc-bm-pct {
	font-size: 11px;
	color: var(--lc-faint);
	flex: none;
	white-space: nowrap;
}

.lc-bm-empty {
	font-size: 12.5px;
	color: var(--lc-faint);
	padding: 6px 0;
	margin-top: 10px;
}

/* ---------- nastavenia čítania ---------- */

.lc-set {
	position: absolute;
	top: 56px;
	top: calc(56px + env(safe-area-inset-top));
	right: 12px;
	width: min(288px, 88vw);
	z-index: 60;
	background: var(--lc-panel);
	border: 1px solid var(--lc-line);
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, .14);
	padding: 18px 18px 16px;
	transform-origin: top right;
	transform: scale(.96) translateY(-6px);
	opacity: 0;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	gap: 18px;
	transition: opacity .24s ease, transform .28s cubic-bezier(.22, .8, .28, 1);
}

.lc-set.is-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.lc-set-group {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.lc-set-group .lc-eyebrow {
	font-size: 10.5px;
}

.lc-set-size {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lc-size-btn {
	flex: 1;
	height: 40px;
	border: 1px solid var(--lc-line);
	border-radius: 9px;
	background: transparent;
	color: var(--lc-fg);
	font-family: 'Cormorant Garamond', Georgia, serif;
	cursor: pointer;
	transition: background .2s;
}

.lc-size-btn:hover {
	background: var(--lc-hover);
}

.lc-size-sm { font-size: 14px; }
.lc-size-lg { font-size: 22px; }

.lc-size-val {
	font-size: 12px;
	color: var(--lc-faint);
	min-width: 34px;
	text-align: center;
}

.lc-set-row {
	display: flex;
	gap: 8px;
}

.lc-opt {
	flex: 1;
	height: 38px;
	border-radius: 9px;
	border: 1px solid var(--lc-line);
	background: transparent;
	color: var(--lc-fg);
	font-family: inherit;
	font-size: 10.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 4px;
	transition: border-color .2s, background .2s;
}

.lc-opt.is-active {
	border-color: var(--lc-accent);
	background: var(--lc-tint);
}

.lc-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1px solid var(--lc-line);
	display: inline-block;
	flex: none;
}

.lc-dot-light { background: #FDF9F3; }
.lc-dot-cream { background: #FBF5EB; }
.lc-dot-dark { background: #191712; }

/* ---------- pokračovať v čítaní ---------- */

.lc-resume {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 44px;
	bottom: calc(44px + env(safe-area-inset-bottom));
	z-index: 45;
	animation: lcFadeUp .5s ease both;
}

.lc-resume-card {
	max-width: 420px;
	margin: 0 auto;
	background: var(--lc-panel);
	border: 1px solid var(--lc-line);
	border-radius: 14px;
	box-shadow: 0 14px 40px rgba(0, 0, 0, .13);
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
}

.lc-resume-text {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.lc-resume-title {
	font-size: 13px;
}

.lc-resume-sub {
	font-size: 11.5px;
	color: var(--lc-faint);
	letter-spacing: .03em;
}

.lc-resume-restart {
	border: none;
	background: transparent;
	color: var(--lc-faint);
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
	padding: 8px;
	flex: none;
}

.lc-resume-go {
	border: 1px solid var(--lc-accent);
	background: var(--lc-accent);
	color: var(--lc-on-accent);
	font-family: inherit;
	font-size: 10.5px;
	letter-spacing: .18em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 11px 18px;
	cursor: pointer;
	flex: none;
	transition: opacity .2s;
}

.lc-resume-go:hover {
	opacity: .85;
}

/* ---------- prázdna kniha ---------- */

.lc-blank {
	margin: auto;
	text-align: center;
	color: var(--lc-soft);
	padding: 40px 24px;
}

/* ---------- knižnica ---------- */

.lc-library {
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	color: var(--lc-fg);
	max-width: 720px;
	margin: 0 auto;
	padding: 0 24px 80px;
	box-sizing: border-box;
}

.lc-library *,
.lc-library *::before,
.lc-library *::after {
	box-sizing: border-box;
}

.lc-lib-head {
	padding: 64px 0 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
	animation: lcFadeUp .6s ease both;
}

.lc-lib-logo {
	height: auto;
	object-fit: contain;
	display: block;
	max-width: 100%;
}

.lc-lib-titles {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lc-lib-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 30px;
	font-weight: 300;
	letter-spacing: .18em;
	text-transform: uppercase;
	line-height: 1.2;
}

.lc-lib-sub {
	font-size: 11px;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--lc-faint);
}

.lc-lib-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.lc-lib-item {
	display: flex;
	gap: 22px;
	padding: 26px 4px;
	border-top: 1px solid var(--lc-line);
	align-items: flex-start;
}

.lc-lib-cover {
	flex: none;
	width: 84px;
	height: 118px;
	border-radius: 3px;
	overflow: hidden;
	background: repeating-linear-gradient(135deg, #F4EADA 0 6px, #EADDC9 6px 12px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	text-decoration: none;
}

.lc-lib-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lc-lib-ph {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 9px;
	letter-spacing: .06em;
	color: #C9AF87;
	padding: 8px;
	text-align: center;
}

.lc-lib-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.lc-lib-name {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 23px;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: .06em;
	margin: 0;
	padding: 0;
}

.lc-lib-name a {
	text-decoration: none;
	color: inherit;
}

.lc-lib-author {
	font-size: 10.5px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--lc-faint);
	margin-top: -6px;
}

.lc-lib-desc {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--lc-soft);
	max-width: 44ch;
}

.lc-lib-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 6px;
	flex-wrap: wrap;
}

.lc-btn {
	display: inline-block;
	font-family: inherit;
	font-size: 11px;
	letter-spacing: .2em;
	text-transform: uppercase;
	padding: 13px 26px;
	border-radius: 999px;
	border: 1px solid var(--lc-accent);
	background: transparent;
	color: var(--lc-accent);
	cursor: pointer;
	text-decoration: none;
	transition: opacity .2s;
}

.lc-btn:hover {
	opacity: .75;
	color: var(--lc-accent);
}

.lc-btn.is-primary {
	background: var(--lc-accent);
	color: var(--lc-on-accent);
}

.lc-btn.is-primary:hover {
	color: var(--lc-on-accent);
}

.lc-lib-prog {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11.5px;
	letter-spacing: .04em;
	color: var(--lc-faint);
}

.lc-lib-prog[hidden] {
	display: none;
}

.lc-lib-bar {
	width: 56px;
	height: 2px;
	background: var(--lc-line);
	display: block;
}

.lc-lib-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--lc-accent);
	opacity: .6;
}

.lc-lib-count {
	font-size: 11.5px;
	letter-spacing: .04em;
	color: var(--lc-faint);
}

.lc-lib-empty {
	padding: 40px 0;
	color: var(--lc-faint);
	text-align: center;
}

/* ---------- menšie obrazovky ---------- */

@media (max-width: 600px) {
	.lc-col {
		padding: 34px 20px 120px;
	}

	.lc-lib-item {
		gap: 16px;
	}

	.lc-lib-cover {
		width: 68px;
		height: 96px;
	}

	.lc-lib-title {
		font-size: 24px;
	}

	.lc-resume-card {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lc-body *,
	.lc-library * {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Skryté kapitoly – poistka, ak téma prepíše predvolené správanie. */
.lc-chapter[hidden],
.lc-scrim[hidden],
.lc-resume[hidden] {
	display: none !important;
}

/* ---------- načítanie kapitoly ---------- */

.lc-col {
	transition: opacity .18s ease;
}

.lc-col.is-loading {
	opacity: .35;
}

.lc-loading {
	text-align: center;
	padding: 24px 0 60px;
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--lc-faint);
}

.lc-loading[hidden] {
	display: none !important;
}

/* Navigácia medzi kapitolami je teraz odkaz, aby fungovala aj bez JavaScriptu. */
.lc-chapnav a {
	font-family: inherit;
	font-size: 12.5px;
	letter-spacing: .03em;
	padding: 12px 0;
	text-decoration: none;
	cursor: pointer;
	transition: opacity .2s;
	max-width: 46%;
}

.lc-chapnav a:hover {
	opacity: .6;
}

a.lc-chapprev {
	color: var(--lc-soft);
	text-align: left;
}

a.lc-chapnext {
	color: var(--lc-accent);
	text-align: right;
}

a.lc-toc-item {
	text-decoration: none;
}

/* ---------- záložky so zmazaním ---------- */

.lc-bm-row {
	display: flex;
	align-items: center;
	gap: 4px;
}

.lc-bm-row .lc-bm-item {
	padding: 10px 0;
}

.lc-bm-del {
	flex: none;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--lc-faint);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	padding: 0;
	transition: background .2s, color .2s;
}

.lc-bm-del:hover {
	background: var(--lc-hover);
	color: var(--lc-fg);
}

/* ---------- dotykové ovládanie ---------- */

@media (pointer: coarse) {
	.lc-icon {
		width: 44px;
		height: 44px;
	}

	.lc-top {
		height: 62px;
	}

	.lc-set {
		top: calc(62px + env(safe-area-inset-top));
	}

	.lc-toc-item {
		padding: 15px 10px;
	}

	.lc-bm-del {
		width: 40px;
		height: 40px;
	}

	.lc-opt {
		height: 44px;
	}

	.lc-size-btn {
		height: 46px;
	}
}

/* ---------- samostatný prehľad kníh na /knihy/ ---------- */

.lc-body-library {
	background: var(--lc-bg);
	min-height: 100%;
}

.lc-libpage {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--lc-bg);
	padding-top: env(safe-area-inset-top);
}

.lc-libpage .lc-library {
	flex: 1;
}

.lc-lib-foot {
	text-align: center;
	padding: 0 24px 40px;
	padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.lc-lib-foot a {
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 10.5px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--lc-faint);
	text-decoration: none;
}

.lc-lib-foot a:hover {
	color: var(--lc-accent);
}
