/**
 * 利害關係人 Widget 樣式
 * 版面：左側卡片群（1~3）| 中心區（orbit ring + earth + 6個絕對定位 icon btn + 靜態連接線）| 右側卡片群（4~6）
 * Elementor {{WRAPPER}} 自動 scope，class 名稱與 GPT 設計保持一致。
 */

/* ──────────────────────────────────────────
   CSS 變數預設值
────────────────────────────────────────── */
.dy-sh-wrap {
	--sh-hover-color:      #00d2ff;
	--sh-card-hover:       #00d2ff;
	--sh-orbit-color:      rgba(0, 210, 255, 0.35);
	--sh-orbit-glow:       0 0 24px rgba(0, 210, 255, 0.25);
	--sh-earth-glow:       0 0 60px rgba(0, 150, 255, 0.55), 0 0 20px rgba(0, 100, 200, 0.35);
	--sh-icon-glow:        0 0 18px rgba(0, 210, 255, 0.55);
	--sh-connector-color:  rgba(0, 210, 255, 0.45);
	/* Icon 按鈕顏色預設值（可由 inline style CSS 變數覆寫） */
	--icon-color:          #00d2ff;
	--icon-hover-color:    #ffffff;
}

/* ──────────────────────────────────────────
   外層容器
────────────────────────────────────────── */
.dy-sh-wrap {
	width: 100%;
	overflow: hidden;
}

/* ──────────────────────────────────────────
   三欄 grid 版面
   左卡片 | 中心區 | 右卡片
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-layout {
	display: grid;
	grid-template-columns: minmax(320px, 1fr) minmax(380px, 480px) minmax(320px, 1fr);
	gap: 40px;
	align-items: center;
}

/* ──────────────────────────────────────────
   卡片群組（左右各一欄）
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-cards {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ──────────────────────────────────────────
   單張卡片
   使用 grid：圖片欄 120px | 文字欄 1fr
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-card {
	display: grid;
	grid-template-columns: 120px 1fr;
	min-height: 155px;
	background: #ffffff;
	border-radius: 18px;
	border: 2px solid transparent;
	overflow: hidden;
	cursor: default;
	position: relative;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 卡片連接點（小圓點）— 用 !important 蓋過 Elementor *::after 全域樣式 */
.dy-sh-wrap .stakeholder-cards.left .stakeholder-card::after,
.dy-sh-wrap .stakeholder-cards.right .stakeholder-card::after {
	content: '' !important;
	position: absolute !important;
	top: 50% !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
	width: 8px !important;
	height: 8px !important;
	border-radius: 50% !important;
	background: var(--sh-connector-color, rgba(0, 210, 255, 0.45)) !important;
	box-shadow: 0 0 8px var(--sh-connector-color, rgba(0, 210, 255, 0.45)) !important;
	transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* 左側卡片連接點在右側 */
.dy-sh-wrap .stakeholder-cards.left .stakeholder-card::after {
	right: -4px !important;
	left: auto !important;
}

/* 右側卡片連接點在左側 */
.dy-sh-wrap .stakeholder-cards.right .stakeholder-card::after {
	left: -4px !important;
	right: auto !important;
}

/* 卡片 active / hover 狀態 */
.dy-sh-wrap .stakeholder-card.active,
.dy-sh-wrap .stakeholder-card:hover {
	transform: translateY(-6px) scale(1.025);
	box-shadow: 0 8px 32px rgba(0, 150, 255, 0.18);
	border-color: var(--sh-card-hover, #00d2ff);
}

.dy-sh-wrap .stakeholder-card.active::after,
.dy-sh-wrap .stakeholder-card:hover::after {
	background: var(--sh-card-hover, #00d2ff);
	box-shadow: 0 0 12px var(--sh-card-hover, #00d2ff);
}

/* ──────────────────────────────────────────
   卡片：圖片欄
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-card-image {
	width: 120px;
	flex-shrink: 0;
	overflow: hidden;
}

.dy-sh-wrap .stakeholder-card-image img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

/* ──────────────────────────────────────────
   卡片：文字欄
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-card-content {
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.dy-sh-wrap .stakeholder-number {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #a0b8d0;
	line-height: 1.2;
}

.dy-sh-wrap .stakeholder-card-content h3 {
	font-size: 17px;
	font-weight: 700;
	color: #0a3c6e;
	margin: 0;
	line-height: 1.3;
}

.dy-sh-wrap .stakeholder-card-content h3 a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.dy-sh-wrap .stakeholder-card-content h3 a:hover {
	color: var(--sh-hover-color, #00d2ff);
}

.dy-sh-wrap .stakeholder-card-content p {
	font-size: 13px;
	color: #555555;
	line-height: 1.6;
	margin: 0;
}

/* 卡片連結（箭頭 / 按鈕） */
.dy-sh-wrap .sh-card-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
	margin-top: 10px;
	align-self: flex-start;
}

/* ── 箭頭模式 ── */
.dy-sh-wrap .sh-card-link--arrow {
	color: #0a3c6e;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	justify-content: center;
}

.dy-sh-wrap .sh-card-link--arrow svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.dy-sh-wrap .sh-card-link--arrow:hover {
	color: #00d2ff;
	transform: translateX(3px);
}

/* ── 文字按鈕模式 ── */
.dy-sh-wrap .sh-card-link--btn {
	font-size: 12px;
	font-weight: 600;
	color: #0a3c6e;
	border: 1.5px solid #0a3c6e;
	border-radius: 20px;
	padding: 4px 14px;
	letter-spacing: 0.02em;
}

.dy-sh-wrap .sh-card-link--btn:hover {
	color: #00d2ff;
	border-color: #00d2ff;
	background: rgba(0, 210, 255, 0.06);
}

/* ──────────────────────────────────────────
   中心區（position relative，固定尺寸）
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-center {
	position: relative;
	width: 100%;
	max-width: 520px;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

/* ──────────────────────────────────────────
   軌道環
────────────────────────────────────────── */
.dy-sh-wrap .orbit-ring {
	position: absolute;
	width: 69.2%;   /* 360/520 */
	aspect-ratio: 1 / 1;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	border: 2px solid var(--sh-orbit-color, rgba(0, 210, 255, 0.35));
	box-shadow: var(--sh-orbit-glow);
	pointer-events: none;
}

/* 外環虛線 */
.dy-sh-wrap .orbit-ring::before {
	content: '';
	position: absolute;
	inset: -16px;
	border-radius: 50%;
	border: 1px dashed rgba(0, 210, 255, 0.2);
}

/* ──────────────────────────────────────────
   地球球體（earth）
────────────────────────────────────────── */
.dy-sh-wrap .earth {
	position: absolute;
	width: 53.8%;   /* 280/520 */
	aspect-ratio: 1 / 1;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #1a73e8, #0a3c6e 60%, #041e42);
	overflow: hidden;
	box-shadow: var(--sh-earth-glow);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	z-index: 2;
}

.dy-sh-wrap .earth img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: 0;
}

/* 圖示模式：不裁切 overflow（讓 icon pulse/spin 動畫不被裁切） */
.dy-sh-wrap .earth.earth--icon {
	overflow: visible;
	gap: 0;
}

/* 圖示模式文字：絕對定位置中，不佔 flex 空間 */
.dy-sh-wrap .earth.earth--icon .earth-text {
	position: absolute !important;
	top: 50% !important;
	bottom: auto !important;
	left: 50% !important;
	right: auto !important;
	transform: translate(-50%, -50%) !important;
	width: 90%;
	z-index: 1;
}

.dy-sh-wrap .earth-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.dy-sh-wrap .earth-icon i,
.dy-sh-wrap .earth-icon svg {
	font-size: 48px;
	color: #ffffff;
	fill: #ffffff;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.dy-sh-wrap .earth-text {
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	text-align: center;
	line-height: 1.4;
	padding: 0 16px;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* 圖片模式時，文字疊加在球體正中央 */
.dy-sh-wrap .earth:not(.earth--icon) .earth-text {
	position: absolute !important;
	top: 50% !important;
	bottom: auto !important;
	left: 50% !important;
	right: auto !important;
	transform: translate(-50%, -50%) !important;
	z-index: 1;
	width: 90%;
}

/* ──────────────────────────────────────────
   Icon 按鈕（絕對定位，最多 6 個）
────────────────────────────────────────── */
.dy-sh-wrap .stakeholder-icon {
	position: absolute;
	width: 86px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: rgba(10, 30, 60, 0.85);
	border: 2px solid rgba(0, 210, 255, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--sh-icon-glow);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
	z-index: 5;
	overflow: visible;
}

/* pulse 外框動畫 */
.dy-sh-wrap .stakeholder-icon::before {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(0, 210, 255, 0.35);
	animation: sh-pulse 2.5s ease-in-out infinite;
}

/* 旋轉虛線環 */
.dy-sh-wrap .stakeholder-icon::after {
	content: '';
	position: absolute;
	inset: -12px;
	border-radius: 50%;
	border: 1.5px dashed rgba(0, 210, 255, 0.25);
	animation: sh-spin 8s linear infinite;
}

.dy-sh-wrap .stakeholder-icon:hover,
.dy-sh-wrap .stakeholder-icon.active {
	transform: scale(1.18);
	box-shadow: 0 0 28px var(--sh-hover-color, #00d2ff), 0 0 10px var(--sh-hover-color, #00d2ff);
	border-color: var(--sh-hover-color, #00d2ff);
	background: rgba(0, 40, 80, 0.95);
}

/* icon 內框（白底圓形） */
.dy-sh-wrap .icon-inner {
	width: 66px;
	height: 66px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	border: 2px solid rgba(0, 100, 200, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.dy-sh-wrap .stakeholder-icon:hover .icon-inner,
.dy-sh-wrap .stakeholder-icon.active .icon-inner {
	background: rgba(0, 210, 255, 0.12);
	border-color: var(--sh-hover-color, #00d2ff);
}

.dy-sh-wrap .icon-inner i,
.dy-sh-wrap .icon-inner svg {
	font-size: 22px;
	color: var(--icon-color, #00d2ff);
	fill: var(--icon-color, #00d2ff);
	pointer-events: none;
	transition: color 0.25s ease, fill 0.25s ease;
}

.dy-sh-wrap .stakeholder-icon:hover .icon-inner i,
.dy-sh-wrap .stakeholder-icon:hover .icon-inner svg,
.dy-sh-wrap .stakeholder-icon.active .icon-inner i,
.dy-sh-wrap .stakeholder-icon.active .icon-inner svg {
	color: var(--icon-hover-color, #ffffff);
	fill: var(--icon-hover-color, #ffffff);
}

/* ── Icon 位置（固定絕對定位）──
   左上：icon-1，右上：icon-2
   左中：icon-3，右中：icon-4
   左下：icon-5，右下：icon-6
────────────────────────────────────────── */
/* 左上→左中→左下 = 1,2,3；右上→右中→右下 = 4,5,6
   百分比定位（相對容器寬/高），確保容器縮放時位置不跑 */
.dy-sh-wrap .icon-1 { left: 17.3%; top:    10.6%; }
.dy-sh-wrap .icon-2 { left:  6.7%; top:    41.7%; }
.dy-sh-wrap .icon-3 { left: 17.3%; bottom: 10.6%; }
.dy-sh-wrap .icon-4 { left: 66.2%; top:    10.6%; }
.dy-sh-wrap .icon-5 { left: 76.7%; top:    41.7%; }
.dy-sh-wrap .icon-6 { left: 66.2%; bottom: 10.6%; }

/* ──────────────────────────────────────────
   靜態連接線（6條，連接 icon 與卡片區）
────────────────────────────────────────── */
.dy-sh-wrap .connector {
	position: absolute;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--sh-connector-color, rgba(0,210,255,0.45)), transparent);
	pointer-events: none;
	z-index: 1;
	transform-origin: center center;
}

/* line-1：左上，連向 icon-1 */
.dy-sh-wrap .line-1 {
	width: 21.2%;
	left: -1%;
	top: 19.2%;
	transform: rotate(25deg);
}

/* line-2：左中，連向 icon-2 */
.dy-sh-wrap .line-2 {
	width: 18.3%;
	left: -3.8%;
	top: 50%;
}

/* line-3：左下，連向 icon-3 */
.dy-sh-wrap .line-3 {
	width: 21.2%;
	left: -1%;
	bottom: 19.2%;
	transform: rotate(-25deg);
}

/* line-4：右上，連向 icon-4 */
.dy-sh-wrap .line-4 {
	width: 21.2%;
	left: 79.8%;
	top: 19.2%;
	transform: rotate(-25deg);
	background: linear-gradient(90deg, var(--sh-connector-color, rgba(0,210,255,0.45)), transparent);
}

/* line-5：右中，連向 icon-5
   對稱 line-2，用 right: -3.8% 從容器右邊界外往左延伸，
   gradient 反向（右透明 → 左亮色），讓亮色落在容器可見範圍 */
.dy-sh-wrap .line-5 {
	width: 30%;
	right: -14%;
	left: auto;
	top: 50%;
	background: linear-gradient(270deg, transparent, var(--sh-connector-color, rgba(0,210,255,0.45)), transparent);
}

/* line-6：右下，連向 icon-6 */
.dy-sh-wrap .line-6 {
	width: 21.2%;
	left: 79.8%;
	bottom: 19.2%;
	transform: rotate(25deg);
	background: linear-gradient(90deg, var(--sh-connector-color, rgba(0,210,255,0.45)), transparent);
}

/* ──────────────────────────────────────────
   關鍵影格動畫
────────────────────────────────────────── */
@keyframes sh-pulse {
	0%, 100% { opacity: 0.4; transform: scale(1); }
	50%       { opacity: 0.9; transform: scale(1.08); }
}

@keyframes sh-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* ──────────────────────────────────────────
   RWD：≤ 1100px 中心縮小
────────────────────────────────────────── */
@media (max-width: 1100px) {
	.dy-sh-wrap .stakeholder-layout {
		grid-template-columns: minmax(220px, 1fr) minmax(320px, 440px) minmax(220px, 1fr);
		gap: 24px;
	}

	.dy-sh-wrap .earth-text {
		font-size: 13px;
	}

	.dy-sh-wrap .stakeholder-icon {
		width: 70px;
	}

	.dy-sh-wrap .icon-inner {
		width: 54px;
		height: 54px;
	}

	/* 中心區、orbit-ring、earth 已用 %/aspect-ratio，不需 override */
}

/* ──────────────────────────────────────────
   RWD：≤ 767px 行動裝置（flex column）
────────────────────────────────────────── */
@media (max-width: 767px) {
	.dy-sh-wrap .stakeholder-layout {
		display: flex;
		flex-direction: column;
		gap: 32px;
	}

	/* 中心區置頂 */
	.dy-sh-wrap .stakeholder-center {
		order: -1;
		width: 300px;
		max-width: 300px;
		margin: 0 auto;
	}

	.dy-sh-wrap .stakeholder-cards.left {
		order: 0;
	}

	.dy-sh-wrap .stakeholder-cards.right {
		order: 1;
	}

	/* 連接線手機版隱藏（layout 改變，靜態線位置不對） */
	.dy-sh-wrap .connector {
		display: none;
	}

	/* orbit-ring / earth 已用 %/aspect-ratio，隨容器縮放 */

	.dy-sh-wrap .earth-text {
		font-size: 12px;
	}

	.dy-sh-wrap .stakeholder-icon {
		width: 52px;
	}

	.dy-sh-wrap .icon-inner {
		width: 40px;
		height: 40px;
	}

	.dy-sh-wrap .icon-inner i,
	.dy-sh-wrap .icon-inner svg {
		font-size: 18px;
	}

	/* icon 位置已用百分比，不需 override */

	/* 卡片改為 flex（行動版圖片可能不需要固定寬度） */
	.dy-sh-wrap .stakeholder-card {
		grid-template-columns: 90px 1fr;
		min-height: 120px;
	}

	.dy-sh-wrap .stakeholder-card-image {
		width: 90px;
	}
}
