/* ============================================================
   mr-blur.css  —  ぼかし閲覧制限 & ペイウォール型アンロックUI
   ============================================================ */

/* ─────────────────────────────────────────────────
   ① ぼかしエリア（.mr-blur-body）
      header / rating は対象外。body / custom_fields / footer のみ。
      position: relative でオーバーレイの絶対配置の基準になる。
   ───────────────────────────────────────────────── */

.mr-review.restricted-review .mr-blur-body {
	position: relative;
	overflow: hidden;
	user-select: none;
	min-height: 320px; /* テキストが短くても透け感を確保する最低高さ（モバイルでのクリップ防止） */
}

/*
 * 直下の子要素（本文・カスタムフィールド・フッター）を blur でぼかす。
 * display:none で消さない — テキストは全文残したまま視覚的にぼかす。
 */
.mr-review.restricted-review .mr-blur-body > :not(.mr-unlock-overlay) {
	filter: blur(8px);
	opacity: 0.6;
	pointer-events: none;
}

/* ─────────────────────────────────────────────────
   ② オーバーレイコンテナ
      position: absolute; top/left/width/height で本文の上に完全に被せる。
      背景は rgba(255,255,255,0.4) のフロストガラス。
      backdrop-filter: blur(12px) で背後のぼけたテキストが柔らかく透ける。
      フォームは align-items: flex-end で下部に固定し、
      上部にぼかしテキストが透けて見える構造にする。
   ───────────────────────────────────────────────── */

.mr-unlock-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	display: flex;
	align-items: flex-end; /* フォームを下部に固定 → 上部にぼけたテキストが透ける */
	justify-content: center;
	padding: 0 12px 16px;
	box-sizing: border-box;
	/* フロストガラス効果: 半透明の白 + backdrop-filter でコンテンツが透けて見える */
	background: rgba(255, 255, 255, 0.40);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* ─────────────────────────────────────────────────
   ③ フロストガラスボックス（内側コンテナ）
      フロストガラス効果は親の .mr-unlock-overlay が担う。
      このボックスは半透明の白背景 + 角丸 + shadow のみ。
   ───────────────────────────────────────────────── */

.mr-unlock-overlay-inner {
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.75);
	border-radius: 12px;
	padding: 20px 20px 18px;
	text-align: center;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	width: 100%;
	max-width: 340px;
	box-sizing: border-box;
}

.mr-unlock-overlay-title {
	font-size: 1em;
	font-weight: bold;
	color: #1a1a1a;
	margin: 0 0 6px;
	line-height: 1.4;
}

.mr-unlock-overlay-desc {
	font-size: 0.82em;
	color: #555;
	line-height: 1.6;
	margin: 0 0 14px;
}

/* ─────────────────────────────────────────────────
   ④ フォーム
   ───────────────────────────────────────────────── */

.mr-unlock-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: stretch;
	width: 100%;
	box-sizing: border-box;
}

.mr-unlock-email-input {
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 0.9em;
	width: 100%;
	box-sizing: border-box;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	background: rgba(255, 255, 255, 0.9);
}

.mr-unlock-email-input:focus {
	border-color: #33A8DE;
	background: #fff;
	box-shadow: 0 0 0 2px rgba(51, 168, 222, 0.25);
}

/* CTA ボタン */
.mr-unlock-submit {
	background: #33A8DE;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 12px 18px;
	font-size: 0.9em;
	font-weight: bold;
	cursor: pointer;
	width: 100%;
	box-sizing: border-box;
	transition: background 0.2s, transform 0.1s;
	letter-spacing: 0.02em;
	min-height: 44px;
}

.mr-unlock-submit:hover {
	background: #2591c7;
}

.mr-unlock-submit:active {
	background: #1e7eae;
	transform: scale(0.98);
}

.mr-unlock-submit:disabled {
	background: #aaa;
	cursor: not-allowed;
	transform: none;
}

/* エラー / 成功メッセージ */
.mr-unlock-message {
	font-size: 0.8em;
	color: #e74c3c;
	margin: 2px 0 0;
	min-height: 1.2em;
	text-align: center;
}

.mr-unlock-message.is-success {
	color: #33A8DE;
}

/* ─────────────────────────────────────────────────
   ⑤ アンロック後: オーバーレイを非表示
   ───────────────────────────────────────────────── */

.mr-review:not(.restricted-review) .mr-unlock-overlay {
	display: none;
}

/* ─────────────────────────────────────────────────
   ⑥ スマホ対応（768px以下）
   ───────────────────────────────────────────────── */

@media (max-width: 768px) {
	/* min-height は 320px のまま継承（デスクトップと統一） */

	.mr-unlock-overlay {
		padding: 0 8px 12px;
	}

	.mr-unlock-overlay-inner {
		max-width: 100%;
		padding: 16px 14px 14px;
		border-radius: 10px;
	}

	.mr-unlock-overlay-title {
		font-size: 0.95em;
	}

	.mr-unlock-overlay-desc {
		font-size: 0.8em;
		margin-bottom: 12px;
	}

	.mr-unlock-email-input {
		font-size: 16px; /* iOS でズームインを防ぐ */
		padding: 10px 12px;
	}

	.mr-unlock-submit {
		font-size: 0.88em;
		padding: 12px 10px;
	}
}

/* ─────────────────────────────────────────────────
   ⑦ 超小型スマホ（390px 以下: iPhone SE / 12 mini 等）
      ボタン・フォームが見切れないよう上下 padding を微調整。
   ───────────────────────────────────────────────── */

@media (max-width: 390px) {
	.mr-unlock-overlay {
		padding: 0 6px 10px;
	}

	.mr-unlock-overlay-inner {
		padding: 14px 12px 12px;
	}
}
