/**
 * メディア記事用スクロールポップアップ
 * 60% スクロール + 30 秒滞在で右下にスライドイン表示。
 * モバイルは画面下部に固定。
 */

.ptg-scroll-popup {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 360px;
	max-width: calc(100vw - 32px);
	background: #ffffff;
	border-radius: 14px;
	box-shadow:
		0 24px 48px -12px rgba(0, 0, 0, 0.22),
		0 8px 16px -8px rgba(0, 0, 0, 0.12);
	padding: 20px 20px 18px;
	z-index: 9999;
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.32s ease,
		transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
	pointer-events: none;
	font-family: inherit;
}

.ptg-scroll-popup.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.ptg-scroll-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: #888;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ptg-scroll-popup__close:hover,
.ptg-scroll-popup__close:focus-visible {
	background-color: rgba(0, 0, 0, 0.06);
	color: #222;
	outline: none;
}

/* ── 共通バッジ ── */
.ptg-scroll-popup__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fde8e8;
	color: #c52424;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	margin-bottom: 12px;
}

.ptg-scroll-popup__badge--brand {
	background: linear-gradient(135deg, #0073aa 0%, #00a8e8 100%);
	color: #ffffff;
}

.ptg-scroll-popup__badge-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #e53935;
	box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.6);
	animation: ptg-scroll-popup-pulse 1.8s infinite;
}

@keyframes ptg-scroll-popup-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.5); }
	70%  { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
	100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

/* ── 企業表示モード ── */
.ptg-scroll-popup__company {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ptg-scroll-popup__company-main {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.ptg-scroll-popup__logo {
	flex-shrink: 0;
	width: 112px;
	height: 48px;
	border-radius: 8px;
	background-color: #ffffff;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid #eceef2;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #555;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	overflow: hidden;
}

/* ロゴ画像なし時のイニシャル表示は薄いグレー背景に */
.ptg-scroll-popup__logo:not([style*="background-image"]) {
	background-color: #f4f4f6;
}

.ptg-scroll-popup__company-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ptg-scroll-popup__company-name {
	font-size: 0.98rem;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.ptg-scroll-popup__company-tagline {
	font-size: 0.78rem;
	color: #6b6b6b;
	line-height: 1.45;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ptg-scroll-popup__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 11px 16px;
	background: #0a0a0a;
	color: #ffffff;
	border-radius: 10px;
	font-size: 0.88rem;
	font-weight: 600;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.ptg-scroll-popup__company:hover .ptg-scroll-popup__cta,
.ptg-scroll-popup__company:focus-visible .ptg-scroll-popup__cta {
	background: #222;
}

.ptg-scroll-popup__company:hover .ptg-scroll-popup__cta-arrow {
	transform: translateX(3px);
}

.ptg-scroll-popup__cta-arrow {
	transition: transform 0.2s ease;
	display: inline-block;
}

/* ── ブランドフォールバックモード ── */
.ptg-scroll-popup__brand-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.4;
	margin: 0 0 8px;
}

.ptg-scroll-popup__brand-text {
	font-size: 0.82rem;
	color: #555;
	line-height: 1.55;
	margin: 0 0 14px;
}

.ptg-scroll-popup__brand-buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ptg-scroll-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 0.86rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ptg-scroll-popup__btn--primary {
	background: #0a0a0a;
	color: #ffffff;
}

.ptg-scroll-popup__btn--primary:hover,
.ptg-scroll-popup__btn--primary:focus-visible {
	background: #222;
}

.ptg-scroll-popup__btn--secondary {
	background: #ffffff;
	color: #0a0a0a;
	border: 1px solid #e0e0e0;
}

.ptg-scroll-popup__btn--secondary:hover,
.ptg-scroll-popup__btn--secondary:focus-visible {
	background: #f6f6f8;
	border-color: #cfcfcf;
}

/* ── モバイル ── */
@media (max-width: 600px) {
	.ptg-scroll-popup {
		right: 12px;
		left: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
		padding: 18px 16px 16px;
		border-radius: 12px;
	}
}

/* アクセシビリティ: モーション抑制設定の尊重 */
@media (prefers-reduced-motion: reduce) {
	.ptg-scroll-popup {
		transition: opacity 0.2s ease;
		transform: none;
	}
	.ptg-scroll-popup__badge-dot {
		animation: none;
	}
}
