/* Basic page layout */
:root {
	--max-width: 1440px;
}
* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
	margin: 0;
}
body {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f6f7f8;
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
	padding: 12px;
}

/* ... (keep all existing CSS) ... */

/* Navigation Button Container */
#nav-buttons {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	padding-top: 15px; /* Space between flipbook and buttons */
	gap: 12px; /* Space between buttons */
	flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}

/* Navigation Button Styling */
#nav-buttons button {
	font-size: 1rem;
	padding: 10px 20px;
	cursor: pointer;
	border: none;
	border-radius: 6px;
	background-color: #004d40; /* Dark green from catalog */
	color: white;
	font-weight: bold;
	transition: background-color 0.2s, opacity 0.2s;
	min-width: 100px;
}

#nav-buttons button:hover {
	background-color: #00695c; /* Lighter green for hover */
}

#nav-buttons button:disabled {
	background-color: #cccccc; /* Grey for disabled */
	color: #888888;
	cursor: not-allowed;
	opacity: 0.7;
}

/* Flipbook container */
#flipbook {
	position: relative; /* IMPORTANT: overlays are positioned relative to this */
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	/* height will be set dynamically via JS to preserve image aspect ratio */
}

/* Each page (Turn.js expects child elements) */
.page {
	position: relative; /* overlays are appended inside each .page */
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: #fff;
}

/* The page image (keeps aspect ratio) */
.page img.page-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain; /* ensures no cropping, fits inside container */
}

/* Invisible overlay hotspot (clickable) */
.overlay-link {
	position: absolute;
	display: block;
	background: rgba(0, 0, 0, 0); /* transparent by default */
	z-index: 999;
	pointer-events: auto;
}

/* Kill Turn.js clickable corners but keep swipe/animation */
.turn-region,
.region {
	pointer-events: none !important;
}

/* TEMP: uncomment during debug to show hotspots */

.overlay-debug {
	background: rgba(255, 0, 0, 0.18);
	outline: 1px dashed rgba(255, 0, 0, 0.5);
}

/* Small responsiveness */
@media (max-width: 420px) {
	body {
		padding: 6px;
	}
}
