/* SNS友だち追加ポップアップ（JIRA: SNS友達追加ポップアップ実装 LIN-175）
   見た目はお知らせポップアップ（ohd-popup-notice）に合わせている */

:root {
	--snsp-accent: #2a7de1;
	--snsp-overlay: rgba(20, 32, 50, .62);
	--snsp-radius: 18px;
	--snsp-ink: #1c2733;
	--snsp-text: #3a4653;
	--snsp-muted: #5a6673;
	--snsp-line: #e3e8ee;
	--snsp-z: 999999;
}

html.snsp-lock,
html.snsp-lock body {
	overflow: hidden;
}

.snsp {
	position: fixed;
	inset: 0;
	z-index: var(--snsp-z);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity .25s ease;
}

.snsp[hidden] {
	display: none;
}

.snsp.is-open {
	opacity: 1;
}

.snsp__overlay {
	position: absolute;
	inset: 0;
	background: var(--snsp-overlay);
	cursor: pointer;
}

.snsp__panel {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 88vh;
	max-height: 88dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 46px 28px 28px;
	background: #fff;
	border-radius: var(--snsp-radius);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
	text-align: center;
	box-sizing: border-box;
	transform: translateY(16px) scale(.97);
	transition: transform .25s ease;
}

.snsp.is-open .snsp__panel {
	transform: none;
}

/* 閉じるボタン（テーマのボタン色に負けないよう固定） */
.snsp__x {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #e9edf2 !important;
	color: #33404e !important;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.snsp__x:hover,
.snsp__x:focus-visible {
	background: #d8dfe7 !important;
}

.snsp__title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--snsp-ink);
}

.snsp__lead {
	margin: 0 auto 22px;
	font-size: 14px;
	line-height: 1.8;
	color: var(--snsp-text);
	/* 日本語・中国語で語の途中や1文字だけの改行を避ける（対応ブラウザのみ） */
	word-break: auto-phrase;
	text-wrap: balance;
}

/* アイコンの並び */
.snsp__list {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.snsp__cell {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.snsp__cell::before,
.snsp__cell::marker {
	content: none;
}

.snsp__item {
	width: 100%;
	min-height: 100px;
	margin: 0;
	padding: 16px 6px 12px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid var(--snsp-line) !important;
	border-radius: 14px;
	background: #fff !important;
	color: var(--snsp-ink) !important;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .01em;
	text-decoration: none !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.snsp__item:hover {
	border-color: #b9c6d3 !important;
	box-shadow: 0 8px 20px rgba(28, 39, 51, .10);
	transform: translateY(-2px);
}

.snsp__item:focus-visible,
.snsp__wide:focus-visible,
.snsp__x:focus-visible {
	outline: 2px solid var(--snsp-accent);
	outline-offset: 2px;
}

.snsp__item[aria-expanded="true"] {
	border-color: var(--snsp-accent) !important;
	background: #f3f8fe !important;
	box-shadow: none;
	transform: none;
}

.snsp__icon {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.snsp__icon img {
	width: 44px;
	height: 44px;
	object-fit: contain;
	display: block;
	margin: 0;
}

/* アイコン画像が未配置のときの仮表示 */
.snsp__icon--empty {
	border-radius: 50%;
	background: #e9edf2;
	color: var(--snsp-muted);
	font-size: 18px;
	font-weight: 700;
}

.snsp__label {
	display: block;
	color: var(--snsp-ink);
}

/* WeChatのQR */
.snsp__qr {
	margin: 16px 0 0;
	padding: 18px 16px 16px;
	border-radius: 14px;
	background: #f5f7fa;
}

.snsp__qr[hidden] {
	display: none;
}

.snsp__qr img {
	display: block;
	width: 180px;
	height: 180px;
	margin: 0 auto 12px;
	border-radius: 8px;
	background: #fff;
	object-fit: contain;
}

.snsp__qr-note {
	margin: 0 auto;
	max-width: 28em;
	font-size: 13px;
	line-height: 1.75;
	color: var(--snsp-muted);
	text-align: left;
	word-break: auto-phrase;
	text-wrap: pretty;
}

/* 繁體のみ：訪日LINE（横長のカード） */
.snsp__wide {
	margin: 12px 0 0;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1px solid var(--snsp-line) !important;
	border-radius: 14px;
	background: #fff !important;
	color: var(--snsp-ink) !important;
	text-align: left;
	text-decoration: none !important;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.snsp__wide:hover {
	border-color: #b9c6d3 !important;
	box-shadow: 0 8px 20px rgba(28, 39, 51, .10);
	transform: translateY(-2px);
}

.snsp__wide-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.snsp__wide-label {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.snsp__wide-note {
	font-size: 12px;
	line-height: 1.6;
	color: var(--snsp-muted);
}

.snsp__wide-arrow {
	flex: 0 0 auto;
	font-size: 22px;
	line-height: 1;
	color: #9fadbb;
}

/* スマホ */
@media (max-width: 600px) {
	.snsp {
		padding: 12px;
	}
	.snsp__panel {
		padding: 42px 18px 20px;
		max-height: 92vh;
		max-height: 92dvh;
	}
	.snsp__title {
		font-size: 19px;
	}
	.snsp__lead {
		font-size: 13px;
		margin-bottom: 18px;
	}
	.snsp__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.snsp__item {
		min-height: 92px;
	}
	.snsp__item:hover,
	.snsp__wide:hover {
		transform: none;
	}
	.snsp__qr img {
		width: 160px;
		height: 160px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.snsp,
	.snsp__panel,
	.snsp__item,
	.snsp__wide {
		transition: none;
	}
}

/* 中国語（简体・繁體）：言葉の途中で改行しない。句読点の後と、PHPの文言に入れた区切り（U+200B）でだけ改行する。
   1行に収まらないときだけ途中で改行する（overflow-wrap） */
.snsp--zh-cn .snsp__lead,
.snsp--zh-tw .snsp__lead,
.snsp--zh-cn .snsp__qr-note,
.snsp--zh-tw .snsp__qr-note,
.snsp--zh-tw .snsp__wide-note {
	word-break: keep-all;
	overflow-wrap: anywhere;
}

/* パソコンで Facebook・WhatsApp のQRを開いたとき（2026-11-09 追加） */
.snsp__qr--pc .snsp__qr-note {
	text-align: center;
}

.snsp__qr-open {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--snsp-accent) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

.snsp__qr-open:focus-visible {
	outline: 2px solid var(--snsp-accent);
	outline-offset: 2px;
}

/* トップの最初の画面の「SNS友だち追加」ボタン（2026-11-12 堂山さん依頼）
   「日本在住の方」などのボタンの色を反転（白地・緑の枠と文字・緑の矢印） */
.custom-header-content .buttons .button.snsp-hero-btn {
	background-color: #fff;
	color: #40BC50;
	box-shadow: inset 0 0 0 2px #40BC50;
}

.custom-header-content .buttons .button.snsp-hero-btn:hover,
.custom-header-content .buttons .button.snsp-hero-btn:focus {
	background-color: #EEF9F0;
	color: #40BC50;
}

.custom-header-content .buttons .button.snsp-hero-btn:focus-visible {
	outline: 2px solid #40BC50;
	outline-offset: 2px;
}

/* 白い矢印の画像を型にして、緑で塗る */
.custom-header-content .buttons .button.snsp-hero-btn::after {
	background-image: none;
	background-color: #40BC50;
	-webkit-mask: url("../images/icon-chevron_right-wh.svg") no-repeat 0 0 / contain;
	mask: url("../images/icon-chevron_right-wh.svg") no-repeat 0 0 / contain;
}

/* トップの最初の画面（FV）が見えている間は、右下の固定ボタン（空き状況・友だち追加）を隠す（2026-11-12）
   クラスの切り替えは asset/js/sns-popup.js（FVがあるトップページだけ） */
html.snsp-fv-in .bn-fixed-rsv-dt {
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	pointer-events: none;
}

html.snsp-fv-ready .bn-fixed-rsv-dt {
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

html.snsp-fv-ready:not(.snsp-fv-in) .bn-fixed-rsv-dt {
	transition: opacity .3s ease, transform .3s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
	html.snsp-fv-in .bn-fixed-rsv-dt {
		transform: none;
	}

	html.snsp-fv-ready .bn-fixed-rsv-dt,
	html.snsp-fv-ready:not(.snsp-fv-in) .bn-fixed-rsv-dt {
		transition: none;
	}
}
