/* ReBorn Hotspot — front-end styles */

/* Page builders (Elementor flex containers) collapse the shortcode wrappers
   to zero width because .rbh only contains absolutely-positioned children and
   has no intrinsic width. Force the wrappers to take the full row. */
.elementor-widget:has([data-reborn-hotspot]),
.elementor-widget:has([data-reborn-hotspot]) .elementor-widget-container,
.elementor-shortcode:has([data-reborn-hotspot]) {
	width: 100%;
	max-width: 100%;
}

.rbh {
	/* Brand fonts — the theme is expected to load these font families. */
	--rbh-font-title: "HalisaExtended", "Halisa Extended", Georgia, serif;
	--rbh-font-text: "CynthoNext", "Cyntho Next", "Helvetica Neue", Arial, sans-serif;
	--rbh-card-bg: rgba(255, 255, 255, 0.92);

	position: relative;
	width: 100%;
	margin: 0 auto;
	overflow: hidden;
	/* Desktop shows the full-width band of the visual (1920x1000 mockup crop). */
	aspect-ratio: 1920 / 1000;
	-webkit-tap-highlight-color: transparent;
}

/* Sizes are forced with !important because theme/Elementor resets like
   `.elementor img { height: auto; max-width: 100%; }` have higher specificity
   and would collapse the image back to its intrinsic ratio, breaking the crop
   and the marker alignment. */
.rbh__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	min-height: 0 !important;
	object-fit: cover;
	/* The source visual is 3:2 — this vertical offset reproduces the mockup crop. */
	object-position: center 87%;
	display: block;
	user-select: none;
	pointer-events: none;
}

/* ---------- Markers ---------- */

/* The marker artwork (orange circle + white plus + translucent ring) is the
   zenklas SVG. Markers are <button> elements, so several properties are forced
   with !important to defeat theme button styling. */
.rbh .rbh__marker {
	position: absolute;
	z-index: 2;
	left: var(--x);
	top: var(--y);
	width: 48px;
	height: 48px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	transform: translate(-50%, -50%);
	border: 0 !important;
	border-radius: 50% !important;
	background-color: transparent !important;
	background-image: url("marker.svg") !important;
	background-position: center !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
	box-shadow: none;
	overflow: visible;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	transition: transform 0.18s ease, filter 0.18s ease;
}

/* Animated border: a copy of the SVG's translucent ring that keeps swelling
   outward and fading, so the marker's border appears to pulse. */
.rbh__marker::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.6);
	transform: scale(0.84);
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	.rbh__marker::after {
		animation: rbh-ring 2.6s ease-out infinite;
		/* Set per marker by hotspot.js so every ring pulses in the same
		   phase no matter when the marker starts animating. */
		animation-delay: var(--rbh-ring-delay, 0s);
	}
}

@keyframes rbh-ring {
	0% {
		transform: scale(0.84);
		opacity: 1;
	}
	70% {
		transform: scale(1.45);
		opacity: 0;
	}
	100% {
		transform: scale(1.45);
		opacity: 0;
	}
}

.rbh .rbh__marker:hover,
.rbh .rbh__marker:focus,
.rbh .rbh__marker:focus-visible,
.rbh .rbh__marker:active {
	background-color: transparent !important;
	outline: none;
}

.rbh .rbh__marker:hover,
.rbh .rbh__marker:focus-visible {
	transform: translate(-50%, -50%) scale(1.1);
}

.rbh .rbh__marker:focus-visible {
	box-shadow: 0 0 0 3px rgba(202, 118, 58, 0.5);
}

/* Active (opened) marker: slightly larger and darker, pulse paused. */
.rbh .rbh__marker.is-active,
.rbh .rbh__marker.is-active:hover,
.rbh .rbh__marker.is-active:focus,
.rbh .rbh__marker.is-active:focus-visible,
.rbh .rbh__marker.is-active:active {
	transform: translate(-50%, -50%) scale(1.06);
	filter: brightness(0.92);
}

.rbh .rbh__marker.is-active::after {
	animation: none;
	opacity: 0;
}

/* ---------- Tooltip card ---------- */

.rbh__card {
	position: absolute;
	z-index: 5;
	left: 0;
	top: 0;
	/* Wide enough that every tooltip text wraps to exactly two lines.
	   box-sizing is pinned so the card measures the same with or without
	   a theme's global border-box reset. */
	box-sizing: border-box;
	/* Fallback before hotspot.js sizes the card per text; max-width matches
	   the JS desktop cap so it never clamps the computed width. */
	width: min(448px, 90%);
	max-width: 520px;
	padding: 24px;
	background: var(--rbh-card-bg);
	border-radius: 10px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
	text-align: left;
	visibility: hidden;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.rbh__card.is-open {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

/* Scoped with .rbh so these win over theme paragraph typography. */
.rbh .rbh__card-title {
	margin: 0 0 14px;
	font-family: var(--rbh-font-title);
	font-weight: 400;
	font-style: normal;
	font-size: 18px;
	line-height: 120%;
	letter-spacing: -0.02em;
	text-align: left;
	text-transform: none;
	color: #000000;
}

.rbh .rbh__card-text {
	margin: 0;
	font-family: var(--rbh-font-text);
	font-weight: 400;
	font-style: normal;
	font-size: 16px;
	line-height: 140%;
	letter-spacing: -0.1px;
	text-align: left;
	color: #000000;
	/* Break the two lines at even lengths (progressive enhancement). */
	text-wrap: balance;
}

/* Pointer tail. Default points DOWN (card sits above marker). */
.rbh__tail {
	position: absolute;
	left: 50%;
	top: 100%;
	width: 0;
	height: 0;
	transform: translateX(-50%);
	border-left: 11px solid transparent;
	border-right: 11px solid transparent;
	border-top: 12px solid var(--rbh-card-bg);
	filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.06));
}

/* When the card is flipped BELOW the marker the tail points UP. */
.rbh__card.is-flipped .rbh__tail {
	top: auto;
	bottom: 100%;
	border-top: none;
	border-bottom: 12px solid var(--rbh-card-bg);
	filter: drop-shadow(0 -6px 4px rgba(0, 0, 0, 0.06));
}

/* ---------- Close button ---------- */

/* The close button is a <button>, so its look is forced with !important to
   defeat theme/Elementor button styling (e.g. a red hover background). */
.rbh .rbh__close,
.rbh .rbh__close:hover,
.rbh .rbh__close:focus,
.rbh .rbh__close:focus-visible,
.rbh .rbh__close:active {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #000000 !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	transition: opacity 0.15s ease;
}

.rbh .rbh__close {
	opacity: 0.5;
}

.rbh .rbh__close:hover,
.rbh .rbh__close:focus-visible {
	opacity: 0.9;
}

.rbh .rbh__close::before,
.rbh .rbh__close::after,
.rbh .rbh__close:hover::before,
.rbh .rbh__close:hover::after,
.rbh .rbh__close:focus::before,
.rbh .rbh__close:focus::after,
.rbh .rbh__close:active::before,
.rbh .rbh__close:active::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 1.5px;
	background: #000000 !important;
}

.rbh .rbh__close::before,
.rbh .rbh__close:hover::before,
.rbh .rbh__close:focus::before,
.rbh .rbh__close:active::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.rbh .rbh__close::after,
.rbh .rbh__close:hover::after,
.rbh .rbh__close:focus::after,
.rbh .rbh__close:active::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------- Mobile: crop image to portrait ---------- */

@media (max-width: 768px) {
	/* Portrait frame matching the mobile mockup (440x555). The mockup is a
	   ZOOMED crop of the visual — template-matched window: x 42.30%, y 15.77%,
	   w 44.40%, h 84.00% of the full image — tighter than object-fit: cover
	   allows, so the image is oversized and offset explicitly instead. */
	.rbh {
		aspect-ratio: 440 / 555;
	}

	.rbh__img {
		inset: auto;
		width: 225.23% !important;  /* 100 / 0.4440 */
		height: 119.05% !important; /* 100 / 0.8400 */
		left: -95.27%;              /* -42.30 / 0.4440 */
		top: -18.77%;               /* -15.77 / 0.8400 */
	}

	.rbh .rbh__marker {
		left: var(--mx, var(--x));
		top: var(--my, var(--y));
		width: 40px;
		height: 40px;
	}

	.rbh__card {
		/* Fallback before hotspot.js sizes the card per text; max-width
		   matches the JS mobile cap so it never clamps the computed width. */
		width: min(300px, 82%);
		max-width: min(420px, 94%);
		padding: 16px;
	}

	.rbh .rbh__card-title {
		margin: 0 0 8px;
		font-size: 16px;
	}

	.rbh .rbh__card-text {
		font-size: 14px;
	}
}
