/* ============================================================
   16deza Table Cell Extras – Frontend & Editor 共通スタイル
   ============================================================ */

/* ---------- テキストサイズ（旧 3段階・後方互換） ---------- */
.tcx-text-sm { font-size: 0.85em; }
.tcx-text-md { font-size: 1em;    }
.tcx-text-lg { font-size: 1.25em; }

/* ---------- テキストサイズ（新・スライダー）----------
   font-size はインラインスタイルで動的付与            */
.tcx-text-size {
	/* display はデフォルト inline のまま */
}

/* ---------- インラインブロック ---------- */
.tcx-inline-block {
	display: inline-block;
}

/* ---------- テーブルセル内 HR ---------- */
.wp-block-table td span.tcx-hr,
.wp-block-table th span.tcx-hr {
	display: block;
	width: 100%;
	height: 0;
	border-top: 1px solid rgba(0,0,0,0.4);
	margin: 0.75em 0;
}

/* ---------- テーブルセル内 Spacer ---------- */
.wp-block-table td .tcx-spacer,
.wp-block-table th .tcx-spacer {
	display: block;
}

/* ---------- テーブルセル内 リスト（旧実装・未使用だが保持） ---------- */
.wp-block-table td ul.tcx-list,
.wp-block-table th ul.tcx-list {
	list-style-type: disc;
	padding-left: 1.4em;
	margin: 0.3em 0;
}
.wp-block-table td ol.tcx-list,
.wp-block-table th ol.tcx-list {
	list-style-type: decimal;
	padding-left: 1.4em;
	margin: 0.3em 0;
}
.wp-block-table td ul.tcx-list li,
.wp-block-table th ul.tcx-list li,
.wp-block-table td ol.tcx-list li,
.wp-block-table th ol.tcx-list li {
	margin: 0.15em 0;
}

/* ---------- 行間を空ける（上・下）----------
   margin はインラインスタイルで動的付与              */
.tcx-margin-top,
.tcx-margin-bottom {
	display: inline-block;
}
/* 旧来のネスト構造互換（margin 外側・pseudo-list 内側）:
   外側 inline-block に width:100% を与えて内側の width:100% が機能するようにする */
.tcx-margin-top:has(.tcx-pseudo-ul),
.tcx-margin-top:has(.tcx-pseudo-ol),
.tcx-margin-bottom:has(.tcx-pseudo-ul),
.tcx-margin-bottom:has(.tcx-pseudo-ol) {
	width: 100%;
}

/* ---------- 先頭列 th（scope="column"）---------- */
th[scope="column"] {
	font-weight: 500;
	text-align: left;
}

/* ── 疑似リスト（ul 箇条書き） ─────────────────────────── */
.tcx-pseudo-ul {
	display: inline-block;
	position: relative;
	padding-left: 1.2em;
	width: 100%;
	box-sizing: border-box;
}
/*
 * bullet を SVG（inline data URI）で描画。
 * フォントに依存しないため上下位置が常に中央に揃う。
 * SVG: viewBox="0 0 10 10" の正円（cx=5, cy=5, r=2）
 */
.tcx-pseudo-ul::before {
	content: "";
	position: absolute;
	left: 0.2em;
	top: calc(0.5lh - 0.225em); 
	width:  0.45em;
	height: 0.45em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='3.5' fill='currentColor'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}
/* ── 疑似リスト（ol 番号付き）────────────────────────────
   CSS カウンターで連番を実現。セル全体にカウンターリセット。 */
td, th {
	counter-reset: tcx-ol;
}
.tcx-pseudo-ol {
	display: inline-block;
	position: relative;
	padding-left: 1.8em;
	width: 100%;
	box-sizing: border-box;
	counter-increment: tcx-ol;
}
.tcx-pseudo-ol::before {
	content: counter(tcx-ol) ".";
	position: absolute;
	left: 0.2em;
}

/* ── エディター内でも同じスタイルを適用 ───────────────── */
/* 旧来のネスト構造互換（エディター） */
.editor-styles-wrapper .tcx-margin-top:has(.tcx-pseudo-ul),
.editor-styles-wrapper .tcx-margin-top:has(.tcx-pseudo-ol),
.editor-styles-wrapper .tcx-margin-bottom:has(.tcx-pseudo-ul),
.editor-styles-wrapper .tcx-margin-bottom:has(.tcx-pseudo-ol) {
	width: 100%;
}
.editor-styles-wrapper .tcx-pseudo-ul,
.editor-styles-wrapper .tcx-pseudo-ol {
	display: inline-block;
	position: relative;
	padding-left: 1.2em;
	width: 100%;
	box-sizing: border-box;
}
.editor-styles-wrapper .tcx-pseudo-ul::before {
	content: "";
	position: absolute;
	left: 0.2em;
	top: calc(0.5lh - 0.225em);
	width:  0.45em;
	height: 0.45em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='3.5' fill='currentColor'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}
.editor-styles-wrapper td,
.editor-styles-wrapper th {
	counter-reset: tcx-ol;
}
.editor-styles-wrapper .tcx-pseudo-ol {
	padding-left: 1.8em;
	counter-increment: tcx-ol;
}
.editor-styles-wrapper .tcx-pseudo-ol::before {
	content: counter(tcx-ol) ".";
	position: absolute;
	left: 0.2em;
}

/* 見出しブロック、段落ブロックなどにカーソルを合わせた際に起こるレイアウトシフトを補正 */
.editor-styles-wrapper .components-dropdown {
	display:inline;
}
/* リストブロックにカーソルを合わせた際の補正 */
.editor-styles-wrapper .wp-block-list-item.is-selected  > .components-dropdown + .block-editor-rich-text__editable {
	display:inline-block; width:100%; vertical-align:top;
}
