/**
 * Global Network Map widget
 * 팜올로지 본사에서 각 국가로 뻗어나가는 지도 애니메이션
 */

.pm-gmap {
	--pm-gmap-route-color: #4a79c4;
	--pm-gmap-route-width: 1.6;
	--pm-gmap-marker-w: 24px;
	--pm-gmap-hub-marker-w: 24px;
	--pm-gmap-draw: 1.1s;
	--pm-gmap-spark: 3.2s;
	position: relative;
	width: 100%;
}

.pm-gmap__stage {
	position: relative;
	margin: 0 auto;
	width: 100%;
	max-width: 100%;
	/* 상단 말풍선 라벨이 잘리지 않도록 여백 확보 */
	padding-top: 60px;
}

.pm-gmap__frame {
	position: relative;
	width: 100%;
	line-height: 0;
}

.pm-gmap__base {
	display: block;
	width: 100%;
	height: auto;
	-webkit-user-select: none;
	user-select: none;
	pointer-events: none;
}

/* ---------------------------------------------------------- routes */

.pm-gmap__routes {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.pm-gmap__route {
	fill: none;
	stroke: var(--pm-gmap-route-color);
	stroke-width: var(--pm-gmap-route-width);
	stroke-linecap: round;
	stroke-dasharray: var(--pm-gmap-dash, 4.5 3);
}

.pm-gmap--flow .pm-gmap__route {
	animation: pm-gmap-flow 1.4s linear infinite;
}

@keyframes pm-gmap-flow {
	to {
		stroke-dashoffset: var(--pm-gmap-dash-sum, -7.5);
	}
}

/* 마스크용 패스 : 허브 -> 목적지 방향으로 경로를 그려냄
   JS 가 .is-init 를 붙이기 전에는 전부 그려진 상태(=JS 미실행 시 폴백) */
.pm-gmap__reveal {
	fill: none;
	stroke: #fff;
	stroke-width: 26;
	stroke-linecap: round;
	stroke-dasharray: 100;
	stroke-dashoffset: 0;
}

.pm-gmap.is-init .pm-gmap__reveal {
	stroke-dashoffset: 100;
}

.pm-gmap.is-active .pm-gmap__reveal {
	animation: pm-gmap-draw var(--pm-gmap-draw) cubic-bezier(0.33, 0.55, 0.28, 1) var(--pm-gmap-d, 0s) forwards;
}

@keyframes pm-gmap-draw {
	to {
		stroke-dashoffset: 0;
	}
}

/* 경로 위를 이동하는 빛 점 */
/* 출발 시각 전에는 뷰박스 원점에 머물러 있으므로 숨겨 둔다.
   노출 시점은 SVG <set> 이 animateMotion 과 동일한 begin 으로 제어한다. */
.pm-gmap__spark {
	fill: var(--pm-gmap-route-color);
	opacity: 0;
}

/* ---------------------------------------------------------- pins */

.pm-gmap__pins {
	position: absolute;
	inset: 0;
	line-height: 1;
}

.pm-gmap__pin {
	position: absolute;
	left: var(--pm-gmap-x, 50%);
	top: var(--pm-gmap-y, 50%);
	width: var(--pm-gmap-marker-w);
	transform: translate(-50%, -100%);
	z-index: 2;
}

.pm-gmap__pin--hub {
	width: var(--pm-gmap-hub-marker-w);
	z-index: 5;
}

.pm-gmap__pinInner {
	position: relative;
	display: block;
	width: 100%;
	transform-origin: 50% 100%;
	transition: transform 0.25s ease;
}

.pm-gmap.is-init .pm-gmap__pinInner {
	opacity: 0;
}

.pm-gmap__pin > a.pm-gmap__pinInner {
	text-decoration: none;
}

.pm-gmap.is-active .pm-gmap__pinInner {
	animation: pm-gmap-drop 0.72s cubic-bezier(0.22, 1.2, 0.36, 1) var(--pm-gmap-d, 0s) forwards;
}

@keyframes pm-gmap-drop {
	0% {
		opacity: 0;
		transform: translateY(-22px) scale(0.35);
	}
	60% {
		opacity: 1;
		transform: translateY(0) scale(1.14);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.pm-gmap__marker {
	display: block;
	width: 100%;
	height: auto;
}

/* 마커 하단 파장 */
.pm-gmap__ripple {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 200%;
	height: 100%;
	border-radius: 50%;
	border: 1.5px solid var(--pm-gmap-route-color);
	opacity: 0;
	transform: translate(-50%, 50%) scale(0.2);
	pointer-events: none;
}

.pm-gmap--ripple.is-active .pm-gmap__pin--dest .pm-gmap__ripple {
	animation: pm-gmap-ripple 1.6s ease-out var(--pm-gmap-d, 0s) 1 both;
}

.pm-gmap--ripple.is-active .pm-gmap__pin--hub .pm-gmap__ripple {
	animation: pm-gmap-ripple 2.6s ease-out var(--pm-gmap-d, 0s) infinite both;
}

@keyframes pm-gmap-ripple {
	0% {
		opacity: 0;
		transform: translate(-50%, 50%) scale(0.2);
	}
	15% {
		opacity: 0.55;
	}
	100% {
		opacity: 0;
		transform: translate(-50%, 50%) scale(1.6);
	}
}

/* ---------------------------------------------------------- labels */

.pm-gmap__label {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 18px);
	transform: translateX(-50%);
	display: block;
	white-space: nowrap;
	padding: 13px 26px;
	border-radius: 20px;
	background-color: #ffffff;
	color: #17181a;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
	box-shadow: 0 6px 24px rgba(23, 30, 48, 0.14);
	pointer-events: none;
}

.pm-gmap__label::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 18px;
	height: 12px;
	margin-left: -9px;
	background-color: inherit;
	-webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.pm-gmap.is-init .pm-gmap__label--hub {
	opacity: 0;
}

.pm-gmap.is-active .pm-gmap__label--hub {
	animation: pm-gmap-label-in 0.6s ease var(--pm-gmap-ld, 0.35s) forwards;
}

@keyframes pm-gmap-label-in {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

/* 거점 라벨은 hover 시에만 노출 */
.pm-gmap__pin--dest .pm-gmap__label {
	padding: 8px 16px;
	border-radius: 14px;
	font-size: 14px;
	bottom: calc(100% + 12px);
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.pm-gmap__pin--dest:hover {
	z-index: 6;
}

.pm-gmap__pin--dest:hover .pm-gmap__label {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.pm-gmap.is-active .pm-gmap__pin--dest:hover .pm-gmap__pinInner {
	transform: scale(1.18);
}

/* 허브 라벨을 숨긴 경우 */
.pm-gmap--nohublabel .pm-gmap__stage {
	padding-top: 0;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	.pm-gmap__label {
		padding: 10px 18px;
		border-radius: 16px;
		font-size: 15px;
	}
	.pm-gmap__stage {
		padding-top: 44px;
	}
}

@media (max-width: 767px) {
	.pm-gmap__label {
		padding: 7px 13px;
		border-radius: 12px;
		font-size: 12px;
	}
	.pm-gmap__pin--dest .pm-gmap__label {
		padding: 5px 10px;
		font-size: 11px;
	}
	.pm-gmap__stage {
		padding-top: 34px;
	}
}

/* ------------------------------------ always-on labels (reference style) */
/* Country name shown beside each destination pin: connector dot + bold text. */
.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label {
	left: calc(100% + 12px);
	right: auto;
	top: 55%;
	bottom: auto;
	transform: translateY(-50%);
	padding: 0 0 0 14px;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	color: var(--pm-gmap-label-color, #1f2733);
	font-size: var(--pm-gmap-label-size, 16px);
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
	visibility: visible;
	text-shadow: 0 1px 2px #fff, 0 -1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff, 0 0 3px #fff;
}

.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label::after {
	display: none; /* drop the bubble tail */
}

.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -3.5px;
	border-radius: 50%;
	background: var(--pm-gmap-route-color);
}

/* Left-side variant (label sits to the left of the pin) */
.pm-gmap--labels .pm-gmap__pin--dest.is-left .pm-gmap__label {
	left: auto;
	right: calc(100% + 12px);
	padding: 0 14px 0 0;
	text-align: right;
}
.pm-gmap--labels .pm-gmap__pin--dest.is-left .pm-gmap__label::before {
	left: auto;
	right: 2px;
}

/* Fade the labels in with their marker */
.pm-gmap--labels.is-init .pm-gmap__pin--dest .pm-gmap__label {
	opacity: 0;
}
.pm-gmap--labels.is-active .pm-gmap__pin--dest .pm-gmap__label {
	animation: pm-gmap-fade 0.5s ease var(--pm-gmap-d, 0s) forwards;
}
@keyframes pm-gmap-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (max-width: 1024px) {
	.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label { font-size: 13px; }
}
@media (max-width: 767px) {
	.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label { font-size: 10px; padding-left: 9px; }
	.pm-gmap--labels .pm-gmap__pin--dest .pm-gmap__label::before { width: 5px; height: 5px; margin-top: -2.5px; }
	.pm-gmap--labels .pm-gmap__pin--dest.is-left .pm-gmap__label { padding: 0 9px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.pm-gmap--labels.is-init .pm-gmap__pin--dest .pm-gmap__label { opacity: 1; }
	.pm-gmap .pm-gmap__reveal,
	.pm-gmap .pm-gmap__pinInner,
	.pm-gmap .pm-gmap__label--hub,
	.pm-gmap .pm-gmap__ripple,
	.pm-gmap .pm-gmap__route {
		animation: none !important;
	}
	.pm-gmap.is-init .pm-gmap__reveal {
		stroke-dashoffset: 0;
	}
	.pm-gmap.is-init .pm-gmap__pinInner,
	.pm-gmap.is-init .pm-gmap__label--hub {
		opacity: 1;
	}
	.pm-gmap__spark {
		display: none;
	}
}
