@charset "utf-8";

/* ----------------------------------------------------------------------
ブロックエディターのテーブルの横スクロール対応
---------------------------------------------------------------------- */
.post_content .table_scroll,
.post_content .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.post_content .table_scroll {
	margin-bottom: 24px;
}

.post_content .table_scroll table {
	margin-bottom: 0;
}

@media (max-width: 767px) {
	/* 3列以上のテーブルはセルが潰れて改行だらけになるため、セルの最低幅を確保して横スクロールさせる */
	.post_content .table_scroll table:has(tr > :nth-child(3)) :is(th, td),
	.post_content .wp-block-table table:has(tr > :nth-child(3)) :is(th, td) {
		box-sizing: content-box;
		min-width: 8em; /* 1行あたり全角8文字ぶん（余白は別） */
	}
}

/* 横スクロールヒント（js/table-scroll-hint.js が要素を追加する） */
.post_content .has_scroll_hint {
	position: relative;
}

.table_scroll_hint {
	position: absolute;
	top: min(50%, 150px);
	left: 50%;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 16px 12px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	line-height: 1.4;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.92);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.table_scroll_hint.is-active {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.table_scroll_hint__icon {
	display: block;
	width: 64px;
	height: 40px;
	overflow: visible;
}

.table_scroll_hint__text {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.table_scroll_hint.is-active .table_scroll_hint__hand {
	animation: table_scroll_hint_swipe 1.4s ease-in-out 0.3s 3;
}

.table_scroll_hint.is-active .table_scroll_hint__arrows {
	animation: table_scroll_hint_arrows 1.4s ease-in-out 0.3s 3;
}

/* 指を左へスワイプ → 元の位置へ戻す */
@keyframes table_scroll_hint_swipe {
	0%, 100% { transform: translate(12px, 3px); }
	20% { transform: translate(18px, 3px); }
	60% { transform: translate(4px, 3px); }
}

@keyframes table_scroll_hint_arrows {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
	.table_scroll_hint.is-active .table_scroll_hint__hand,
	.table_scroll_hint.is-active .table_scroll_hint__arrows {
		animation: none;
	}
}
