/* ==========================================
   BOOK VIEWER
========================================== */

body.mpp-book-viewer-open {
	overflow: hidden;
}

.mpp-book-viewer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 12px;
	overflow: hidden;
}

.mpp-book-viewer[hidden] {
	display: none;
}

.mpp-book-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(39 31 27 / 72%);
	backdrop-filter: blur(4px);
}

.mpp-book-viewer__dialog {
	/* ======================================
	   MAIN POSITIONING CONTROLS
	====================================== */

	/* Entire book position */
	--mpp-book-x: -4%;
	--mpp-book-y: 1%;

	/* Left page content area */
	--mpp-creation-left: 14.5%;
	--mpp-creation-top: 18%;
	--mpp-creation-width: 34%;
	--mpp-creation-height: 64%;

	/* Right page artwork area */
	--mpp-prompt-right: 16%;
	--mpp-prompt-top: 11%;
	--mpp-prompt-width: 34%;
	--mpp-prompt-height: 66%;
	--mpp-spread-rotation: -2deg;

	/* Move the complete right sidebar left or right */
	--mpp-sidebar-x: -50px;

	/* Space between header, reward and buttons */
	--mpp-sidebar-gap: 22px;

	position: relative;
	z-index: 1;
	display: grid;

	grid-template-columns:
		minmax(0, 1fr)
		clamp(190px, 15vw, 250px);

	grid-template-rows:
		auto
		auto
		auto
		auto;

	column-gap: 18px;
	row-gap: var(--mpp-sidebar-gap);
	align-content: center;

	width: min(1680px, 98vw);
	height: min(940px, 96vh);
	max-width: 98vw;
	max-height: 96vh;

	overflow: hidden;
	padding: 20px 24px;
	border: 1px solid #efe5d9;
	border-radius: 18px;
	background: #faf5ef;
	box-shadow: 0 24px 70px rgb(24 18 15 / 35%);
}

/* ==========================================
   CLOSE BUTTON
========================================== */

.mpp-book-viewer__close {
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 10;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	color: #3d3833;
	font-family: Arial, sans-serif;
	font-size: 30px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}

.mpp-book-viewer__close:hover,
.mpp-book-viewer__close:focus-visible {
	background: #f1e8dd;
	color: #3d3833;
	outline: 2px solid #9ba584;
	outline-offset: 2px;
}

/* ==========================================
   RIGHT-HAND TITLE BLOCK
========================================== */

.mpp-book-viewer__header {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	justify-self: center;

	width: 100%;
	max-width: 240px;
	margin: 0;
	padding: 0;
	text-align: center;

	transform: translateX(var(--mpp-sidebar-x));
}

.mpp-book-viewer__header h2 {
	max-width: 240px;
	margin: 0 auto !important;
	color: #3d3833;
	font-size: clamp(27px, 2.15vw, 36px);
	line-height: 1.14;
}

.mpp-book-viewer__month {
	margin: 8px 0 0 !important;
	color: #3d3833;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(11px, 0.8vw, 13px);
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
}

.mpp-book-viewer__page-number {
	margin: 10px 0 25px !important;
	color: #3d3833;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(12px, 0.85vw, 14px);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-align: center;
	text-transform: uppercase;
}

.mpp-book-viewer__prompt {
	margin: 0 !important;
	color: #3d3833;
	font-family: "Playfair Display", serif;
	font-size: clamp(17px, 1.25vw, 21px);
	font-style: italic;
	line-height: 1.35;
	text-align: center;
}

/* ==========================================
   BOOK ARTWORK
========================================== */

.mpp-book-viewer__book {
	position: relative;
	grid-column: 1;
	grid-row: 1 / 5;
	align-self: center;
	justify-self: center;

	width: min(
		100%,
		calc((96vh - 64px) * 1.5)
	);

	aspect-ratio: 3 / 2;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	background: transparent;

	transform:
		translate(
			var(--mpp-book-x),
			var(--mpp-book-y)
		);

	transform-origin: center;
}

.mpp-book-viewer__pages {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

/* ==========================================
   PAGE CONTENT CONTAINERS
========================================== */

.mpp-book-page {
	position: absolute;
	z-index: 2;
	min-width: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

/* ==========================================
   PAGE 0 — BOOK CONTENTS
========================================== */

.mpp-book-contents {
	position: absolute;
	inset: 0;
	z-index: 3;

	display: grid;
	grid-template-columns: 1fr 1fr;

	box-sizing: border-box;
	width: 100%;
	height: 100%;

	padding:
    8%
    13.5%
    17%
    13.5%;

	pointer-events: auto;
}

.mpp-book-contents[hidden] {
	display: none !important;
}

/* Left book page */

.mpp-book-contents__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;

	box-sizing: border-box;
	padding:
		0
		16%
		0
		5%;

	text-align: center;

	transform: translateX(20px);
}

.mpp-book-contents__intro-heading {
	margin: 0 0 15px !important;

	color: #4f4741;
	font-family: "Playfair Display", serif;
	font-size: clamp(22px, 2vw, 32px);
	font-weight: 500;
	line-height: 1.2;
}

.mpp-book-contents__intro-text {
	max-width: 270px;
	margin: 0 !important;

	color: #6d655f;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(10px, 0.85vw, 14px);
	font-weight: 400;
	line-height: 1.65;
	text-align: center;
}

/* Right book page */

.mpp-book-contents__main {
	box-sizing: border-box;
	padding:
		3%
		15%
		0
		3%;

	transform: rotate(-1.5deg);
	transform-origin: center center;
}

.mpp-book-contents__heading {
	margin: 0 0 14px !important;

	color: #4f4741;
	font-family: "Playfair Display", serif;
	font-size: clamp(24px, 2vw, 34px);
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
}

.mpp-book-contents__list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4px;

	margin: 0;
	padding: 0;

	list-style: none;
	counter-reset: none;
}

.mpp-book-contents__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mpp-book-contents__list li::marker {
	content: "";
}

/* Individual prompt rows */

button.mpp-book-contents__page {
	display: grid;
	grid-template-columns:
		58px
		minmax(0, 1fr);
	align-items: baseline;
	gap: 9px;

	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 5px 3px 7px !important;

	border: 0 !important;
	border-bottom:
		1px dotted
		rgb(79 71 65 / 25%) !important;

	border-radius: 0;
	background: transparent !important;
	color: #4f4741 !important;
	box-shadow: none !important;

	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

button.mpp-book-contents__page:hover,
button.mpp-book-contents__page:focus,
button.mpp-book-contents__page:focus-visible,
button.mpp-book-contents__page:active {
	border-color:
		rgb(79 71 65 / 25%) !important;

	background:
		rgb(155 165 132 / 10%) !important;

	color: #4f4741 !important;
	box-shadow: none !important;
	outline: none;
}

.mpp-book-contents__page-number {
	color: #7a716a;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(9px, 0.7vw, 11px);
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
}

.mpp-book-contents__prompt {
	min-width: 0;

	color: #4f4741;
	font-family: "Playfair Display", serif;
	font-size: clamp(13px, 1vw, 17px);
	font-weight: 500;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

/* Left page */
.mpp-book-page--creation {
	top: var(--mpp-creation-top);
	left: var(--mpp-creation-left);
	width: var(--mpp-creation-width);
	height: var(--mpp-creation-height);
	container-type: inline-size;
}

/* Right page */
.mpp-book-page--prompt {
	top: var(--mpp-prompt-top);
	right: var(--mpp-prompt-right);
	width: var(--mpp-prompt-width);
	height: var(--mpp-prompt-height);
}

.mpp-book-page__inner {
	position: relative;
	width: 100%;
	height: 100%;
	padding: 0;
}

/* ==========================================
   LEFT PAGE — CREATION
========================================== */

.mpp-creation-frame {
	position: relative;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 78%;
	aspect-ratio: 1 / 1;
	height: auto;
	margin: -20px auto 0;
	padding: clamp(10px, 1.3vw, 20px);
	border:
		clamp(5px, 0.65vw, 10px)
		solid #ffffff;
	background: #f3ece3;
	box-shadow: 0 8px 22px rgb(71 53 41 / 14%);
	text-align: center;
	overflow: hidden;
}

.mpp-creation-frame__empty {
	width: 100%;
	height: 100%;
	min-width: 0;
}

.mpp-creation-frame__empty p {
	margin: 0 0 clamp(8px, 7cqw, 30px);
	color: #3d3833;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(8px, 5cqw, 18px);
	font-weight: 400;
	line-height: 1.4;
	text-align: center;
	overflow-wrap: anywhere;
}

.mpp-creation-upload-note {
	margin: 0 0 12px !important;
	color: #7a716a !important;
	font-size: clamp(8px, 3.2cqw, 12px) !important;
	line-height: 1.35 !important;
}

.mpp-upload-creation {
	width: auto;
	max-width: 100%;
	min-height: 35px;

	padding: 5px 16px;

	font-size: clamp(11px, 0.95vw, 15px) !important;
	font-weight: 500;
	line-height: 1.2;

	text-transform: uppercase;
	letter-spacing: 0.12em;

	white-space: nowrap;
	overflow: visible;
	text-overflow: clip;
}

.mpp-creation-frame__image {
	display: block;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;

	object-fit: cover;
	object-position: center;

	overflow: hidden;
}

.mpp-creation-frame__image[hidden] {
	display: none !important;
}

/* ==========================================
   CREATION SUBMITTED
========================================== */

.mpp-creation-submitted {
	box-sizing: border-box;
	width: 78%;
	margin: 10px auto 0;
	padding: 10px 12px;
	border: 1px solid #e5d8ca;
	border-radius: 10px;
	background: rgb(252 247 241 / 92%);
	text-align: center;
}

.mpp-creation-submitted[hidden] {
	display: none !important;
}

.mpp-creation-submitted h3 {
	margin: 0 0 5px;

	color: #4f4741;
	font-family: "Playfair Display", serif;
	font-size: clamp(16px, 1.1vw, 20px);
	font-weight: 500;
	line-height: 1.2;
}

.mpp-creation-submitted p {
	margin: 0 0 11px;

	color: #4f4741;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(11px, 0.8vw, 13px);
	font-weight: 400;
	line-height: 1.45;
}

.mpp-replace-creation {
	width: auto;
	min-width: 150px;
	margin: 0;
	padding: 8px 14px;

	font-size: 11px;
	line-height: 1.2;
}

/* ==========================================
   RIGHT PAGE — STORYBOOK SPREAD
========================================== */

.mpp-storybook-spread {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;

	transform: rotate(var(--mpp-spread-rotation));
	transform-origin: center;
}

/* ==========================================
   CURRENT PAGE REWARD
========================================== */

.mpp-book-viewer__reward {
	grid-column: 2;
	grid-row: 2;
	align-self: center;
	justify-self: center;
	z-index: 5;

	width: min(190px, 100%);
	margin: 0;
	padding: 0;
	text-align: center;

	transform: translateX(var(--mpp-sidebar-x));
}

/* Contents-page rewards use the same middle sidebar row. */
.mpp-book-viewer__contents-rewards {
	grid-column: 2;
	grid-row: 2;
	align-self: center;
	justify-self: center;
	z-index: 5;

	width: min(190px, 100%);
	margin: 0;
	padding: 0;
	text-align: center;

	transform: translateX(var(--mpp-sidebar-x));
}



.mpp-book-viewer__reward[hidden] {
	display: none !important;
}

.mpp-book-viewer__reward-heading {
	margin: 0 0 8px !important;
	color: #3d3833;
	font-family: "Montserrat", sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

.mpp-book-viewer__reward-image {
	display: block;
	width: auto;
	height: 95px;
	max-width: 100%;
	margin: 0 auto 6px;
	object-fit: contain;
}

.mpp-book-viewer__reward-image[hidden] {
	display: none !important;
}

.mpp-book-viewer__reward-title {
	margin: 0 !important;
	color: #3d3833;
	font-family: "Montserrat", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
}

/* ==========================================
   BOOK NAVIGATION
========================================== */

.mpp-book-viewer__navigation {
	grid-column: 2;
	grid-row: 3;
	align-self: start;
	justify-self: center;
	z-index: 5;

	display: flex;
	flex-direction: column;
	gap: 10px;

	width: min(190px, 100%);
	margin: 0;
	padding: 0;

	transform: translateX(var(--mpp-sidebar-x));
}

.mpp-book-viewer__navigation button {
	width: 100%;
	min-height: 35px;
	padding: 3px;

	-webkit-appearance: none;
	appearance: none;

	background: #9ba284 !important;
	border: 1px solid #9ba284 !important;
	border-radius: 8px;
	color: #faf5ef !important;

	box-shadow: none !important;
	outline: none;

	font-family: "Montserrat", sans-serif;
	font-size: clamp(11px, 0.95vw, 15px);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;

	cursor: pointer;

	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		color 0.25s ease;
}

.mpp-book-viewer__navigation button:hover,
.mpp-book-viewer__navigation button:focus,
.mpp-book-viewer__navigation button:focus-visible,
.mpp-book-viewer__navigation button:active {
	background: #b1a6b7 !important;
	border-color: #b1a6b7 !important;
	color: #faf5ef !important;
	box-shadow: none !important;
	outline: none;
}

.mpp-book-viewer__navigation button:disabled {
	background: #9ba284 !important;
	border-color: #9ba284 !important;
	color: #faf5ef !important;
	opacity: 1;
	cursor: default;
}


/* Smaller buttons displayed inside the book page */

.mpp-upload-creation,
.mpp-replace-creation {
	-webkit-appearance: none;
	appearance: none;

	min-height: 32px;
	padding: 6px 12px;

	background: #9ba284 !important;
	border: 1px solid #9ba284 !important;
	border-radius: 7px;
	color: #faf5ef !important;

	box-shadow: none !important;
	outline: none;

	font-family: "Montserrat", sans-serif;
	font-size: clamp(9px, 0.7vw, 11px);
	font-weight: 500;
	letter-spacing: 0.07em;
	line-height: 1.2;
	text-transform: uppercase;

	cursor: pointer;

	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		color 0.25s ease;
}

.mpp-upload-creation:hover,
.mpp-upload-creation:focus,
.mpp-upload-creation:focus-visible,
.mpp-upload-creation:active,
.mpp-replace-creation:hover,
.mpp-replace-creation:focus,
.mpp-replace-creation:focus-visible,
.mpp-replace-creation:active {
	background: #b1a6b7 !important;
	border-color: #b1a6b7 !important;
	color: #faf5ef !important;
	box-shadow: none !important;
	outline: none;
}

.mpp-upload-creation:disabled,
.mpp-replace-creation:disabled {
	background: #9ba284 !important;
	border-color: #9ba284 !important;
	color: #faf5ef !important;
	opacity: 1;
	cursor: default;
}

/* ==========================================
   START BOOK BUTTON
========================================== */

.mpp-book-viewer__start-wrap {
	grid-column: 2;
	grid-row: 4;
	align-self: start;
	justify-self: center;
    width: min(190px, 100%);
	margin: -14px 0 0;
	padding: 0;

	transform: translateX(var(--mpp-sidebar-x));
}

.mpp-book-viewer__start {
	width: 100%;
	background: #b1a6b7;
	border: 1px solid #b1a6b7;
	border-radius: 8px;
	color: #faf5ef;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(11px, 0.95vw, 15px);
    letter-spacing: 0.12em;
	font-weight: 500;
	transition:
	background 0.25s ease,
	border-color 0.25s ease,
	color 0.25s ease;
	text-transform: uppercase;
	padding: 5px 5px;
    min-height: 40px;
}

.mpp-book-viewer__start:hover,
.mpp-book-viewer__start:focus,
.mpp-book-viewer__start:focus-visible,
.mpp-book-viewer__start:active {
	background: #9ba284;
	border-color: #9ba284;
	color: #faf5ef;
	outline: none;
	box-shadow: none;
}

