/**
 * Starry Map block — frontend styles.
 * Scoped to .wp-block-starry-map so it doesn't affect the rest of the theme.
 */

.wp-block-starry-map.starry-map-block {
	position: relative;
	background: #000;
}

/* Full-width map; max 1920px, aspect-ratio keeps points anchored (no sliding on resize) */
.starry-map-block .starry-map__inner {
	position: relative;
	width: 100%;
	max-width: 1920px;
	margin-left: auto;
	margin-right: auto;
	aspect-ratio: 100 / 48;
	height: auto;
	min-height: 400px;
}



.starry-map-block .starry-map__map-wrap {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.starry-map-block .starry-map__img.ofc {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	display: block;
	object-fit: cover;
	object-position: center center;
}

.starry-map-block .starry-map__dots {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	pointer-events: none;
	z-index: 5;
}

/* Точка — лише якір (top/right); маркер і підпис позиціонуються окремо, щоб підпис не зміщував маркер */
.starry-map-block .starry-map__point {
	position: absolute;
	width: 0;
	height: 0;
	overflow: visible;
	text-align: center;
	color: #ff6600;
	pointer-events: auto;
}

/* Маркер завжди в одній позиції (центр якоря) */
.starry-map-block .starry-map__point .starry-map__marker {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
}

/* Підпис — position absolute, не впливає на маркер (default = bottom) */
.starry-map-block .starry-map__point .starry-map__point-label {
	position: absolute;
	white-space: pre-line;
	top: 28px;
	left: 50%;
	transform: translateX(-50%);
}
.starry-map-block .starry-map__point--label-bottom .starry-map__point-label {
	top: 28px;
	left: 50%;
	transform: translateX(-50%);
}
.starry-map-block .starry-map__point--label-top .starry-map__point-label {
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
}
.starry-map-block .starry-map__point--label-left .starry-map__point-label {
	right: 28px;
	top: 50%;
	transform: translateY(-50%);
}
.starry-map-block .starry-map__point--label-right .starry-map__point-label {
	left: 28px;
	top: 50%;
	transform: translateY(-50%);
}

/* Point label color = marker color: R&D circle, Factory triangle, Sales, HQ square */
.starry-map-block .starry-map__point:has(.starry-map__marker--circle) {
	color: #33cccc;
}

.starry-map-block .starry-map__point:has(.starry-map__marker--triangle) {
	color: #fdb913;
}

.starry-map-block .starry-map__point:has(.starry-map__marker--sales) {
	color: #4da3ff;
}

/* HQ (square, not sales) stays default orange #ff6600 from .starry-map__point */

/* Tooltip on hover */
.starry-map-block .starry-map__point-tooltip {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: 100%;
	margin-bottom: 8px;
	padding: 10px 14px;
	min-width: 140px;
	max-width: 280px;
	background: #1a1a1a;
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	white-space: pre-line;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	visibility: hidden;
	opacity: 0;
	z-index: 10;
	pointer-events: none;
	transition: visibility 0.15s ease, opacity 0.15s ease;
}

.starry-map-block .starry-map__point-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -6px;
	border: 6px solid transparent;
	border-top-color: #1a1a1a;
}

.starry-map-block .starry-map__point:hover .starry-map__point-tooltip {
	visibility: visible;
	opacity: 1;
}

.starry-map-block .starry-map__point-tooltip,
.starry-map-block .starry-map__point-tooltip * {
	color: #fff;
}

.starry-map-block .starry-map__point-tooltip strong,
.starry-map-block .starry-map__point-tooltip b {
	font-weight: 700;
	color: var(--wp--preset--color--luminous-vivid-amber, #f5a623) !important;
	display: block;
	margin-bottom: 0.25em;
}
.starry-map-block .starry-map__point-tooltip strong + *,
.starry-map-block .starry-map__point-tooltip b + * {
	margin-top: 0;
}

.starry-map-block .starry-map__point-label {
	font-family: var(--wp--preset--font-family--nexa, "Nexa-Extra-Bold", sans-serif);
	font-size: 16px;
	line-height: 1.2;
}


.starry-map-block .starry-map__point .starry-map__marker--triangle {
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
}

.starry-map-block .starry-map__point .starry-map__marker--circle {
	position: relative;
	margin: auto;
}

.starry-map-block .starry-map__marker--square,
.starry-map-block .starry-map__marker--square.starry-map__marker--sales,
.starry-map-block .starry-map__marker--sales {
	position: relative;
	width: 18px;
	height: 18px;
	background: #ff6600;
	margin: auto;
}

/* Sales: синій квадрат (вища специфічність ніж square+sales) */
.starry-map-block .starry-map__marker--square.starry-map__marker--sales,
.starry-map-block .starry-map__marker--sales {
	background: #4da3ff;
}

/* Sales & square: show the blue/orange square, pulse smaller and centered */
.starry-map-block .starry-map__marker--square .starry-map__pulse,
.starry-map-block .starry-map__marker--sales .starry-map__pulse {
	width: 8px;
	height: 8px;
	left: 50%;
	top: 50%;
	margin-left: -4px;
	margin-top: -4px;
	background-color: #4da3ff !important;
}

/* HQ (square): pulse same color as square (orange) */
.starry-map-block .starry-map__marker--square:not(.starry-map__marker--sales) .starry-map__pulse {
	background-color: #ff6600 !important;
}

.starry-map-block .starry-map__marker--triangle {
	width: 0;
	height: 0;
	border-bottom: 16px solid #fdb913;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
}

.starry-map-block .starry-map__marker--circle {
	width: 19px;
	height: 19px;
	border-radius: 50%;
	background: #33cccc;
}

/* Pulse animation */
.starry-map-block .starry-map__pulse {
	z-index: 4;
	width: 16px;
	height: 16px;
	background-color: #ff6600;
	position: absolute;
	border-radius: 50%;
	top: 0;
	left: 0;
	transform-origin: center center;
	animation: starry-map-pulse 1.7s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.starry-map-block .starry-map__pulse.delay-1 { animation-delay: 0.1s; animation-duration: 2.7s; }
.starry-map-block .starry-map__pulse.delay-2 { animation-delay: 0.3s; animation-duration: 2.7s; }
.starry-map-block .starry-map__pulse.delay-3 { animation-delay: 0.5s; animation-duration: 2.7s; }
.starry-map-block .starry-map__pulse.delay-4 { animation-delay: 0.7s; animation-duration: 2.7s; }
.starry-map-block .starry-map__pulse.delay-5 { animation-delay: 0.9s; animation-duration: 2.7s; }
.starry-map-block .starry-map__pulse.delay-6 { animation-delay: 1.1s; animation-duration: 2.7s; }

.starry-map-block .starry-map__pulse--green {
	background-color: #33cccc;
	width: 19px;
	height: 19px;
}

.starry-map-block .starry-map__pulse--yellow {
	background-color: #fdb913;
	width: 14px;
	height: 14px;
	left: -3px;
	top: -3px;
}

.starry-map-block .starry-map__pulse--blue {
	background-color: #4da3ff;
	width: 16px;
	height: 16px;
}

.starry-map-block .starry-map__pulse--orange {
	background-color: #ff6600;
}

@keyframes starry-map-pulse {
	0% { transform: scale(1); opacity: 1; }
	100% { transform: scale(5); opacity: 0; }
}

/* Legend — above map, always visible */
.starry-map-block .starry-map__legend {
	position: absolute;
	right: 20%;
	top: 66%;
	display: flex !important;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 12px;
	z-index: 10;
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
}

.starry-map-block .starry-map__legend-item {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	color: #fff;
}

.starry-map-block .starry-map__legend-item span {
	margin-left: 6px;
}

.starry-map-block .starry-map__legend-icon--circle {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #33cccc;
}

.starry-map-block .starry-map__legend-icon--square {
	width: 12px;
	height: 12px;
	background: #ff6600;
}

.starry-map-block .starry-map__legend-icon--triangle {
	width: 0;
	height: 0;
	border-bottom: 12px solid #fdb913;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
}

.starry-map-block .starry-map__legend-icon--sales {
	width: 12px;
	height: 12px;
	background: #4da3ff;
}

/* Content area — overlay, не впливає на позицію карти/точок */
.starry-map-block .starry-map__content {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	padding: 90px 0;
	pointer-events: none;
}
.starry-map-block .starry-map__content .starry-map__content-wrap,
.starry-map-block .starry-map__content .starry-map__text,
.starry-map-block .starry-map__content .starry-map__buttons a,
.starry-map-block .starry-map__content a {
	pointer-events: auto;
}

.starry-map-block .starry-map__content-wrap.alignwide {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1320px);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--wp--preset--spacing--60, 1rem);
	padding-right: var(--wp--preset--spacing--60, 1rem);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 200px;
}

.starry-map-block .starry-map__content-wrap--top-left .starry-map__text { align-self: flex-start; }
.starry-map-block .starry-map__content-wrap--top-right .starry-map__text { align-self: flex-end; margin-left: auto; }
.starry-map-block .starry-map__content-wrap--bottom-left .starry-map__text { margin-top: auto; align-self: flex-start; }
.starry-map-block .starry-map__content-wrap--bottom-right .starry-map__text { margin-top: auto; align-self: flex-end; margin-left: auto; }

.starry-map-block .starry-map__text {
	position: relative;
	color: #fff;
	max-width: 380px;
}

.starry-map-block .starry-map__text--left { text-align: left; }
.starry-map-block .starry-map__text--center { text-align: center; }
.starry-map-block .starry-map__text--right { text-align: right; }

/* Content area — heading, span, paragraph (theme typography) */
.starry-map-block .starry-map__content h2 {
	padding-top: 0;
	padding-bottom: 0;
	font-size: 42px;
	font-style: normal;
	font-weight: 800;
	line-height: 1.2;
	font-family: var(--wp--preset--font-family--nexa) !important;
	margin: 0 0 1em;
}

.starry-map-block .starry-map__content span {
	color: var(--wp--preset--color--luminous-vivid-amber) !important;
}

.starry-map-block .starry-map__content p {
	color: #fff !important;
	font-style: normal;
	font-weight: 300;
	line-height: 1.5;
	font-family: var(--wp--preset--font-family--assistant) !important;
}

.starry-map-block .starry-map__content-title {
	color: #fff;
}

.starry-map-block .starry-map__description {
	margin-top: 24px;
	max-width: 350px;
	font-family: 'Assistant', sans-serif;
}

.starry-map-block .starry-map__description p {
	margin: 0 0 0.5em;
}

.starry-map-block .starry-map__buttons {
	margin-top: 1.5em;
}

.starry-map-block .starry-map__btn {
	border-radius: 10px;
	padding: 16px 32px;
	font-weight: 600;
	line-height: 1;
}

/* Numbers / stats — alignwide container from theme.json */
.starry-map-block .starry-map__numbers-wrap.alignwide {
	position: absolute;
	bottom: 240px;
	left: 0;
	right: 0;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1320px);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--wp--preset--spacing--60, 1rem);
	padding-right: var(--wp--preset--spacing--60, 1rem);
	box-sizing: border-box;
	z-index: 7;
}

.starry-map-block .starry-map__numbers {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.starry-map-block .starry-map__numbers-title {
	display: none;
}

.starry-map-block .starry-map__stat-item {
	position: relative;
	text-align: center;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 20px 24px;
	transition: transform 0.3s ease, background 0.3s ease;
	flex: 1;
	max-width: 200px;
	margin: 0 8px;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.starry-map-block .starry-map__stat-item:first-child {
	margin-left: 0;
}

.starry-map-block .starry-map__stat-item:last-child {
	margin-right: 0;
}

.starry-map-block .starry-map__stat-item:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
}

.starry-map-block .starry-map__stat-num {
	color: #fdb913;
	font-size: 54px;
	line-height: 1;
	white-space: nowrap;
	font-family: var(--wp--preset--font-family--nexa, "Nexa-Extra-Bold", sans-serif);
}

.starry-map-block .starry-map__stat-num--3,
.starry-map-block .starry-map__stat-num--5 {
	transform: translateX(-5px);
}

.starry-map-block .starry-map__stat-label {
	font-size: 18px;
	line-height: 24px;
	color: #fff;
	margin-top: 12px;
	font-family: var(--wp--preset--font-family--assistant, sans-serif);
}
.starry-map-block .starry-map__inner .alignwide .starry-map__title-wrap h2 span{
	font-family: 'Assistant', sans-serif!important;
	font-size: 42px!important;
	font-weight: 600!important;
	line-height: 1.2!important;
	color: #fff!important;
	margin: 0 0 1em!important;
}
/* Responsive: tablet and below */
@media (max-width: 1024px) {
	.starry-map-block .starry-map__inner {
		height: auto;
		min-height: 0;
		z-index: 7!important;
		
	}

	.starry-map-block .starry-map__title-heading {
		display: block;
		position: relative;
		text-align: center;
		padding: 40px 0 0;
		color: #fff;
	}

	.starry-map-block .starry-map__title-heading h2 {
		color: #fff;
		margin: 0;
	}

	.starry-map-block .starry-map__map-wrap {
		position: relative;
		height: 70vw;
		margin-top: 50px;
	}

	.starry-map-block .starry-map__img.ofc {
		object-position: right;
	}

	.starry-map-block .starry-map__point-label {
		font-size: 12px;
	}

	.starry-map-block .starry-map__marker--square,
	.starry-map-block .starry-map__marker--square.starry-map__marker--sales {
		width: 8px;
		height: 8px;
	}

	.starry-map-block .starry-map__marker--triangle {
		border-bottom-width: 8px;
		border-left-width: 4px;
		border-right-width: 4px;
	}

	.starry-map-block .starry-map__marker--circle {
		width: 9px;
		height: 9px;
	}

	.starry-map-block .starry-map__legend {
		right: 30px;
		top: auto;
		bottom: 30px;
	}

	.starry-map-block .starry-map__legend-icon--circle {
		width: 9px;
		height: 9px;
	}

	.starry-map-block .starry-map__legend-icon--square {
		width: 8px;
		height: 8px;
	}

	.starry-map-block .starry-map__legend-icon--triangle {
		border-bottom-width: 10px;
		border-left-width: 5px;
		border-right-width: 5px;
	}

	.starry-map-block .starry-map__content {
		height: auto;
		padding: 20px 0 60px;
	}

	.starry-map-block .starry-map__content-title {
		display: none;
	}

	.starry-map-block .starry-map__description {
		margin-top: 0;
	}

	.starry-map-block .starry-map__numbers-wrap.alignwide {
		position: relative;
		bottom: auto;
		left: auto;
		right: auto;
		max-width: 100%;
		margin: 90px auto 0;
	}

	.starry-map-block .starry-map__numbers {
		display: block;
	}

	.starry-map-block .starry-map__numbers-title {
		display: block;
		text-align: center;
		color: #fff;
		font-size: 27px;
		margin-bottom: 1rem;
	}

	.starry-map-block .starry-map__stat-item {
		margin: 50px auto 0;
	}

	.starry-map-block .starry-map__stat-num {
		font-size: 54px;
		width: 100%;
	}

	.starry-map-block .starry-map__stat-num span {
		width: auto;
	}
}

@media (max-width: 600px) {
	.starry-map-block .starry-map__numbers {
		flex-direction: column;
		align-items: stretch;
		max-width: 320px;
		margin-left: auto;
		margin-right: auto;
	}

	.starry-map-block .starry-map__stat-item {
		max-width: none;
		margin: 12px 0 0;
	}

	.starry-map-block .starry-map__stat-item:first-child {
		margin-top: 0;
	}
}
