/* Magazine viewer */
.fat-magazine-viewer { margin: 2em 0; }
.fat-magazine-limit { padding: 0.75em; background: #f0f0f0; border-radius: 4px; margin-bottom: 1em; }

.fat-magazine-flipbook {
	min-height: 500px;
	background: #2a2a2a;
	padding: 1rem;
	border-radius: 4px;
}

.fat-flipbook-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 1rem;
}

.fat-flip-prev,
.fat-flip-next {
	padding: 0.5rem 1rem;
	font-size: 1.25rem;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
}
.fat-flip-prev:hover:not(:disabled),
.fat-flip-next:hover:not(:disabled) { background: #f5f5f5; }
.fat-flip-prev:disabled,
.fat-flip-next:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.fat-flip-page-info {
	color: #fff;
	font-size: 1rem;
	min-width: 80px;
	text-align: center;
}

.fat-flipbook-pages {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-height: 400px;
	position: relative;
}

/* Single row: one left page, one right page (book spread) */
.fat-flipbook-spread {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 12px;
	max-width: 100%;
	width: 100%;
}

/* Two-page spread: exactly one page slot left, one page slot right */
.fat-flipbook-left,
.fat-flipbook-right {
	display: flex;
	flex: 0 1 50%;
	min-width: 0;
	max-width: 50%;
	align-items: stretch;
	justify-content: center;
}

.fat-flipbook-left.fat-flipbook-empty {
	flex: 0 0 0;
	width: 0;
	min-width: 0;
	max-width: 0;
	overflow: hidden;
	padding: 0;
	margin: 0;
	border: none;
}

.fat-flipbook-left.fat-flipbook-empty .fat-flipbook-page-wrap {
	width: 0;
	min-width: 0;
	overflow: hidden;
}

/* Cover only: single page uses full width of right slot */
.fat-flipbook-left.fat-flipbook-empty + .fat-flipbook-right {
	flex: 1 1 auto;
	max-width: 100%;
}

.fat-flipbook-page-wrap {
	background: #fff;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	overflow: hidden;
	max-width: 100%;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

/* One canvas per slot: left page on left, right page on right */
.fat-flipbook-canvas {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
	vertical-align: top;
}

.fat-flipbook-flip-overlay {
	display: none;
}

.fat-flipbook-loading .fat-flipbook-spread {
	opacity: 0.4;
	pointer-events: none;
}

.fat-flipbook-loading .fat-flipbook-pages::before {
	content: 'Loading PDF…';
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 1rem;
	z-index: 5;
}

.fat-flipbook-hint {
	color: rgba(255,255,255,0.8);
	font-size: 0.875rem;
	text-align: center;
	margin-top: 1rem;
	margin-bottom: 0;
}

/* Subscribe overlay popup */
.fat-subscribe-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.6);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.fat-subscribe-popup {
	background: #fff;
	padding: 2rem;
	border-radius: 8px;
	max-width: 400px;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.fat-subscribe-popup h3 {
	margin: 0 0 0.5rem 0;
	font-size: 1.25rem;
}

.fat-subscribe-popup p {
	margin: 0 0 1.5rem 0;
	color: #666;
}

.fat-subscribe-popup-btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	background: #000;
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 4px;
	margin-bottom: 0.75rem;
}

.fat-subscribe-popup-btn:hover { opacity: 0.9; }

.fat-subscribe-close {
	display: block;
	margin: 0 auto;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.875rem;
}
