/**
 * Dutch Mike Flipbook — front-end styles.
 * Minimal and neutral so the player does not fight the host site's design.
 * All color theming flows through the --dmfb-accent custom property.
 */

.dmfb-flipbook {
	--dmfb-accent: #0073aa;
	position: relative;
	width: 100%;
	max-width: 1100px;
	margin: 2rem auto;
	box-sizing: border-box;
}

.dmfb-flipbook *,
.dmfb-flipbook *::before,
.dmfb-flipbook *::after {
	box-sizing: border-box;
}

.dmfb-scaffold {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dmfb-viewer {
	position: relative;
	width: 100%;
	min-height: 300px;
	background: #f4f4f4;
	border-radius: 4px;
	overflow: hidden;
}

.dmfb-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: #555;
	background: #f4f4f4;
	z-index: 2;
}

.dmfb-book {
	width: 100%;
	margin: 0 auto;
	transition: max-width 0.3s ease;
}

.dmfb-book.dmfb-solo {
	max-width: 50%;
}

.dmfb-book .dmfb-page {
	background: #fff;
	overflow: hidden;
	position: relative;
}

.dmfb-book .dmfb-page canvas {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	max-height: 100%;
}

.dmfb-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 0;
	flex-wrap: wrap;
}

.dmfb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background: #fff;
	color: #222;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dmfb-btn:hover,
.dmfb-btn:focus-visible {
	background: var(--dmfb-accent);
	color: #fff;
	border-color: var(--dmfb-accent);
	outline: none;
}

.dmfb-btn:disabled,
.dmfb-btn[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
	background: #fff;
	color: #222;
	border-color: rgba(0, 0, 0, 0.1);
}

.dmfb-counter {
	font-size: 14px;
	color: #555;
	min-width: 90px;
	text-align: center;
}

/* Thumbnail trigger (lightbox mode) */
.dmfb-mode-thumbnail-lightbox .dmfb-thumbnail-trigger {
	display: inline-block;
	padding: 0;
	margin: 0;
	background: none;
	border: none;
	cursor: pointer;
	text-align: center;
}

.dmfb-thumbnail-trigger img,
.dmfb-thumbnail-trigger canvas {
	display: block;
	max-width: 240px;
	height: auto;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 4px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dmfb-thumbnail-trigger:hover img,
.dmfb-thumbnail-trigger:focus-visible img,
.dmfb-thumbnail-trigger:hover canvas,
.dmfb-thumbnail-trigger:focus-visible canvas {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.dmfb-thumbnail-label {
	display: block;
	margin-top: 8px;
	font-size: 14px;
	color: var(--dmfb-accent);
}

.dmfb-cover-placeholder {
	display: inline-block;
	width: 240px;
	height: 320px;
	background: #eee;
}

.dmfb-cover-placeholder canvas {
	width: 100%;
	height: auto;
}

/* Lightbox overlay */
.dmfb-lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 10, 0.88);
	z-index: 99999;
	padding: 24px;
}

.dmfb-lightbox.is-open {
	display: flex;
}

.dmfb-lightbox-inner {
	position: relative;
	width: 100%;
	max-width: 1200px;
	max-height: 100%;
	overflow: auto;
}

.dmfb-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #000;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.dmfb-lightbox-close:hover,
.dmfb-lightbox-close:focus-visible {
	background: var(--dmfb-accent);
	color: #fff;
	outline: none;
}

body.dmfb-lightbox-open {
	overflow: hidden;
}

/* Fallback for no-JS users */
.dmfb-noscript {
	display: inline-block;
	padding: 12px 16px;
	background: #f4f4f4;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	color: var(--dmfb-accent);
	text-decoration: none;
}

.dmfb-noscript img {
	display: block;
	max-width: 240px;
	height: auto;
	margin-bottom: 8px;
}

@media (max-width: 600px) {
	.dmfb-btn {
		min-width: 44px;
		height: 44px;
	}

	.dmfb-counter {
		min-width: 100%;
		order: 10;
	}
}
