/**
 * ==========================================================
 * MOONLIGHT COTTAGE FRONT-END STYLES
 * ==========================================================
 *
 * Controls:
 * - Cottage layout
 * - Structural room layers
 * - Room decoration depth
 * - Hotspots
 *
 * ==========================================================
 */

/* ==========================================
   SHARED ROOM STAGE
========================================== */

/*
 * The live room and Room Editor render the same shortcode markup.
 * JavaScript measures the browser content width once and sets both variables
 * on this shell. The negative offset breaks the stage out of any Kadence
 * content gutter so its left edge is exactly the viewport's left edge.
 */
.mpp-cottage-shell {
	display: block;
	box-sizing: border-box;
	width: var(--mpp-room-stage-width, 100%);
	max-width: none;
	margin: 0;
	margin-left: var(--mpp-room-stage-offset-left, 0px);
	padding: 0;
	border: 0;
	overflow: hidden;
}

.mpp-cottage {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.mpp-cottage__room {
	position: relative;
	z-index: 0;
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Every structural PNG is exported on the same full-room canvas. */
.mpp-room-layer {
	position: absolute;
	inset: 0;
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: fill;
	pointer-events: none;
}

/* ==========================================
   STRUCTURAL ROOM LAYER ORDER
========================================== */

/* Empty room background — 0 */

.mpp-cottage__room {
	z-index: 0;
}

/* Rug — behind all furniture */

.mpp-room-layer--rug {
	z-index: 10;
}

/* Wall decorations — behind fixtures and chandelier */

.mpp-room-decoration--wall {
	z-index: 20;
}

/* Fireplace structure */

.mpp-room-layer--fireplace {
	z-index: 30;
}

/* Fireplace-area decorations */

.mpp-room-decoration--fireplace {
	z-index: 35;
}

/* Mantel decorations — above fireplace structure */

.mpp-room-decoration--mantel {
	z-index: 40;
}

/* Window structure */

.mpp-room-layer--window {
	z-index: 50;
}

/* Windowsill decorations */

.mpp-room-decoration--windowsill {
	z-index: 55;
}

/* Chandelier — in front of wall and wall decorations */

.mpp-room-layer--chandelier {
	z-index: 60;
}

/* Desk structure */

.mpp-room-layer--desk {
	z-index: 70;
}

/* Desk decorations and active open book */

.mpp-room-decoration--desk,
.mpp-active-desk-book {
	z-index: 80;
}

/* Desk chair front section */

.mpp-room-layer--desk-chair-front {
	z-index: 90;
}

/* Desk chair decorations */

.mpp-room-decoration--desk-chair {
	z-index: 100;
}

/*
 * Desk chair back faces the viewer,
 * so it sits in front of the front section.
 */

.mpp-room-layer--desk-chair-back {
	z-index: 110;
}

/* Reading chair left arm */

.mpp-room-layer--reading-chair-left-arm {
	z-index: 115;
}

/* Reading chair back */

.mpp-room-layer--reading-chair-back {
	z-index: 120;
}

/* Reading chair decorations */

.mpp-room-decoration--reading-chair {
	z-index: 125;
}

/* Reading chair right arm — nearest chair layer */

.mpp-room-layer--reading-chair-right-arm {
	z-index: 130;
}

/* Floor decorations */

.mpp-room-decoration--floor {
	z-index: 140;
}

/* Foreground decorations */

.mpp-room-decoration--foreground {
	z-index: 160;
}

/* ==========================================
   SHARED HOTSPOT STYLES
========================================== */

.mpp-hotspot {
	position: absolute;
	z-index: 20;

	display: block;
	margin: 0;
	padding: 0;

	border: 0;
	background: transparent;

	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;

	cursor: pointer;
}

.mpp-hotspot:focus,
.mpp-hotspot:active {
	border: 0;
	background-color: transparent;
	outline: none;
	box-shadow: none;
}

/* ==========================================
   LEFT BOOKSHELF HOTSPOT
   Above wall layer, below fireplace/furniture.
========================================== */

.mpp-left-bookshelf {
	top: 17%;
	left: 7%;

	width: 17%;
	height: 48%;

	z-index: 25;
}

/* ==========================================
   RIGHT BOOKSHELF HOTSPOT
   Remains behind the reading chair.
========================================== */

.mpp-right-bookshelf {
	top: 17%;
	right: 22%;

	width: 17%;
	height: 48%;

	z-index: 25;
}

/* ==========================================
   WALL HOTSPOT
   Below fireplace, chandelier and furniture.
========================================== */

.mpp-wall {
	top: 12%;
	right: 44.5%;

	width: 25%;
	height: 25%;

	z-index: 25;
}

/* ==========================================
   CEILING HOTSPOT
   Below chandelier.
========================================== */

.mpp-ceiling {
	top: 1%;
	right: 18%;

	width: 80%;
	height: 5%;

	z-index: 25;
}

/* ==========================================
   FIREPLACE HOTSPOT
   Above fireplace and mantel decorations,
   below window, chandelier and desk.
========================================== */

.mpp-fireplace {
	top: 46%;
	left: 30%;

	width: 26%;
	height: 32%;

	z-index: 45;
}

/* ==========================================
   MANTELPIECE HOTSPOT
   Above mantel decorations,
   below chandelier and desk.
========================================== */

.mpp-mantelpiece {
	top: 36%;
	right: 41%;

	width: 32%;
	height: 10%;

	z-index: 45;
}

/* ==========================================
   WINDOWSILL HOTSPOT
   Above window, below chandelier/furniture.
========================================== */

.mpp-windowsill {
	right: 1%;
	bottom: 30%;

	width: 10%;
	height: 10%;

	z-index: 58;
}

/* ==========================================
   FLOOR HOTSPOT
   Above rug, behind all furniture.
========================================== */

.mpp-floor {
	right: 2.5%;
	bottom: 1%;

	width: 95%;
	height: 20%;

	z-index: 15;
}

/* ==========================================
   DESK HOTSPOT
   Above desk and desk decorations,
   below desk chair.
========================================== */

.mpp-desk {
	left: 20%;
	bottom: 29%;

	width: 41%;
	height: 6%;

	z-index: 75;
}

/* ==========================================
   READING CHAIR HOTSPOT
   Above all reading-chair layers,
   below floor and foreground decorations.
========================================== */

.mpp-chair {
	right: 14%;
	bottom: 26%;

	width: 18%;
	height: 20%;

	z-index: 135;
}

/* ==========================================
   SHARED HOTSPOT ACTIVE STATE
========================================== */

.mpp-hotspot:hover,
.mpp-hotspot:focus,
.mpp-hotspot:focus-visible,
.mpp-hotspot:active {
	border: 2px solid #d7b46a;
	border-radius: 12px;
	background: rgba(255, 215, 120, 0.22);
}
/* ==========================================
   AREA EDIT MODE AND POSITION CHOICES
========================================== */

.mpp-position-choice-layer {
	position: absolute;
	inset: 0;
	z-index: 175;
	pointer-events: none;
}

.mpp-cottage.is-area-editing .mpp-hotspot:not(.is-editing) {
	pointer-events: none;
}

.mpp-hotspot.is-editing {
	border: 2px solid rgba(215, 180, 106, 0.9);
	border-radius: 14px;
	background: rgba(255, 236, 184, 0.08);
}

.mpp-hotspot.is-editing::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 100vmax rgba(45, 36, 31, 0.16);
	pointer-events: none;
}

.mpp-position-choice {
	position: absolute;
	transform: translate(-50%, -50%);
	pointer-events: auto;

	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;

	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}

.mpp-position-choice__marker {
	position: relative;
	display: block;
	width: clamp(34px, 3.2vw, 50px);
	aspect-ratio: 1;
	border: 2px solid rgba(255, 244, 205, 0.98);
	border-radius: 50%;
	background: rgba(215, 180, 106, 0.24);
	box-shadow:
		0 0 0 5px rgba(215, 180, 106, 0.20),
		0 0 22px 8px rgba(255, 220, 135, 0.48);
	animation: mpp-slot-marker-pulse 1.8s ease-in-out infinite;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mpp-position-choice__marker::after {
	content: "✦";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font: 600 clamp(13px, 1.25vw, 18px)/1 Georgia, serif;
	color: #fff8df;
	text-shadow: 0 1px 5px rgba(79, 71, 65, 0.55);
}

.mpp-position-choice.is-filled .mpp-position-choice__marker::after {
	content: "✦";
	font-size: clamp(11px, 1.05vw, 16px);
}

.mpp-position-choice__label {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 8px);
	transform: translateX(-50%) translateY(3px);
	white-space: nowrap;
	padding: 5px 8px;
	border: 1px solid rgba(239, 229, 217, 0.95);
	border-radius: 7px;
	background: rgba(252, 247, 241, 0.97);
	box-shadow: 0 3px 12px rgba(49, 39, 33, 0.16);
	font: 600 clamp(9px, 0.72vw, 11px)/1.2 Montserrat, sans-serif;
	color: #4f4741;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.mpp-position-choice:hover .mpp-position-choice__marker,
.mpp-position-choice:focus-visible .mpp-position-choice__marker {
	transform: scale(1.12);
	box-shadow:
		0 0 0 6px rgba(215, 180, 106, 0.28),
		0 4px 14px rgba(49, 39, 33, 0.34);
}

.mpp-position-choice:hover .mpp-position-choice__label,
.mpp-position-choice:focus-visible .mpp-position-choice__label {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.mpp-position-choice:focus-visible {
	outline: none;
}

@media (max-width: 700px) {
	.mpp-position-choice__label {
		display: none;
	}
}

/* Filled positions retain the same member-facing sparkle, with a softer
   centre so the placed decoration remains visible beneath it. */
.mpp-position-choice.is-filled .mpp-position-choice__marker {
	background: rgba(215, 180, 106, 0.12);
}

.mpp-position-choice.is-filled .mpp-position-choice__marker::after {
	content: "✦";
	color: #fff8df;
	text-shadow: 0 1px 5px rgba(79, 71, 65, 0.55);
}

@keyframes mpp-slot-marker-pulse {
	0%, 100% {
		box-shadow:
			0 0 0 4px rgba(215, 180, 106, 0.17),
			0 0 15px 5px rgba(255, 220, 135, 0.36);
	}
	50% {
		box-shadow:
			0 0 0 7px rgba(215, 180, 106, 0.25),
			0 0 27px 10px rgba(255, 220, 135, 0.58);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpp-position-choice__marker {
		animation: none;
	}
}

/* Keep position controls independent from Kadence/global button styling. */
.mpp-cottage .mpp-position-choice,
.mpp-cottage .mpp-position-choice:hover,
.mpp-cottage .mpp-position-choice:focus,
.mpp-cottage .mpp-position-choice:focus-visible,
.mpp-cottage .mpp-position-choice:active {
	-webkit-appearance: none !important;
	appearance: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

.mpp-cottage .mpp-position-choice:hover .mpp-position-choice__marker,
.mpp-cottage .mpp-position-choice:focus-visible .mpp-position-choice__marker,
.mpp-cottage .mpp-position-choice:active .mpp-position-choice__marker {
	background-color: rgba(215, 180, 106, 0.88) !important;
	border-color: rgba(252, 247, 241, 0.98) !important;
	color: #fffdf8 !important;
}

.mpp-cottage .mpp-position-choice.is-filled:hover .mpp-position-choice__marker,
.mpp-cottage .mpp-position-choice.is-filled:focus-visible .mpp-position-choice__marker,
.mpp-cottage .mpp-position-choice.is-filled:active .mpp-position-choice__marker {
	background-color: rgba(215, 180, 106, 0.12) !important;
	border-color: rgba(255, 244, 205, 0.98) !important;
}

/* Build 69: member-facing slot areas use the exact Room Editor geometry and
   always sit above room artwork while their parent hotspot is active. */
.mpp-position-choice-layer {
	z-index: 100200;
}
.mpp-position-choice.is-saved-slot-area {
	box-sizing: border-box;
	transform: none;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}
.mpp-position-choice.is-saved-slot-area .mpp-position-choice__marker {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
.mpp-position-choice.is-saved-slot-area:hover .mpp-position-choice__marker,
.mpp-position-choice.is-saved-slot-area:focus-visible .mpp-position-choice__marker {
	transform: translate(-50%, -50%) scale(1.12);
}
.mpp-position-choice.is-saved-slot-area .mpp-position-choice__label {
	left: 50%;
	bottom: calc(100% + 8px);
}
