/* カスタムテーブルブロック - フロントエンドスタイル */
.generic-custom-table-wrapper {
	width: 100%;
	margin: 40px auto;
	overflow-x: auto;
	overflow-y: hidden;
	border: 0.5px solid #e0e0e0;
	border-radius: 12px;
}

.generic-custom-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 100%;
	max-width: 100%;
	font-size: 14px !important;
	table-layout: fixed;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* 1列目（項目）の最低・最大横幅を確保 */
.generic-custom-table thead th:first-child,
.generic-custom-table tbody th {
	min-width: 120px;
	width: 30%;
	max-width: 35%;
}

/* 3列以上のときは横スクロール */
.generic-custom-table-wrapper:has(.generic-custom-table thead th:nth-child(3)) {
	max-width: 100%;
	box-sizing: border-box;
}
.generic-custom-table-wrapper:has(.generic-custom-table thead th:nth-child(3)) .generic-custom-table {
	table-layout: auto;
	min-width: 600px;
}
.generic-custom-table-wrapper:has(.generic-custom-table thead th:nth-child(3)) .generic-custom-table thead th:first-child,
.generic-custom-table-wrapper:has(.generic-custom-table thead th:nth-child(3)) .generic-custom-table tbody th {
	width: auto;
}

/* テーブル内のすべてのセルに共通スタイルを適用 */
.generic-custom-table th,
.generic-custom-table td {
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: break-word;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* ── ヘッダー行（グリーン） */
.generic-custom-table thead {
	background-color: var(--main-color, #0C7A5E);
}

.generic-custom-table thead th {
	padding: 12px 16px;
	text-align: left;
	color: #fff;
	font-weight: 500;
	font-size: 14px !important;
	border-right: 1px solid rgba(255,255,255,0.2);
	border-bottom: none;
}

.generic-custom-table thead th:last-child {
	border-right: none;
}

.generic-custom-table th img,
.generic-custom-table td img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

/* ── tbody 1列目（薄グリーン） */
.generic-custom-table tbody th {
	background-color: var(--main-color-pale, #ebf4ed);
	color: var(--main-color-dark, #0A5446);
	font-weight: 500;
	font-size: 14px !important;
	padding: 12px 16px;
	border-right: 0.5px solid var(--main-color-light, #9FE1CB);
	border-top: 0.5px solid var(--main-color-light, #9FE1CB);
}

/* ── tbody 行 */
.generic-custom-table tbody tr {
	border-top: 0.5px solid #e0e0e0;
}

.generic-custom-table tbody tr:first-child {
	border-top: none;
}

/* ── tbody セル */
.generic-custom-table td {
	padding: 12px 16px;
	color: #333;
	font-size: 14px !important;
	border-right: 0.5px solid #e0e0e0;
	background: #fff;
	line-height: 1.6;
}

.generic-custom-table td:last-child {
	border-right: none;
}

/* ── テーブル内リンク */
.generic-custom-table-wrapper .generic-custom-table th a:not(.generic-button):not(.wp-block-medical-service-button a),
.generic-custom-table-wrapper .generic-custom-table td a:not(.generic-button):not(.wp-block-medical-service-button a),
.generic-custom-table th a:not(.generic-button):not(.wp-block-medical-service-button a),
.generic-custom-table td a:not(.generic-button):not(.wp-block-medical-service-button a) {
	text-decoration: underline !important;
	text-decoration-line: underline !important;
	text-decoration-style: solid !important;
}

.generic-custom-table-wrapper .generic-custom-table th a:not(.generic-button):not(.wp-block-medical-service-button a):hover,
.generic-custom-table-wrapper .generic-custom-table td a:not(.generic-button):not(.wp-block-medical-service-button a):hover,
.generic-custom-table th a:not(.generic-button):not(.wp-block-medical-service-button a):hover,
.generic-custom-table td a:not(.generic-button):not(.wp-block-medical-service-button a):hover {
	text-decoration: underline !important;
	text-decoration-line: underline !important;
	text-decoration-style: solid !important;
}

/* ── ボタン保護 */
html body .generic-custom-table-wrapper .generic-custom-table th .wp-block-medical-service-button .generic-button,
html body .generic-custom-table-wrapper .generic-custom-table td .wp-block-medical-service-button .generic-button,
html body .generic-custom-table th .wp-block-medical-service-button .generic-button,
html body .generic-custom-table td .wp-block-medical-service-button .generic-button,
html body .generic-custom-table-wrapper .generic-custom-table th .generic-button,
html body .generic-custom-table-wrapper .generic-custom-table td .generic-button,
html body .generic-custom-table th .generic-button,
html body .generic-custom-table td .generic-button {
	text-decoration: none !important;
	text-decoration-line: none !important;
	text-decoration-style: none !important;
	text-decoration-color: transparent !important;
}

html body .generic-custom-table-wrapper .generic-custom-table th .wp-block-medical-service-button .generic-button:hover,
html body .generic-custom-table-wrapper .generic-custom-table td .wp-block-medical-service-button .generic-button:hover,
html body .generic-custom-table th .wp-block-medical-service-button .generic-button:hover,
html body .generic-custom-table td .wp-block-medical-service-button .generic-button:hover,
html body .generic-custom-table-wrapper .generic-custom-table th .generic-button:hover,
html body .generic-custom-table-wrapper .generic-custom-table td .generic-button:hover,
html body .generic-custom-table th .generic-button:hover,
html body .generic-custom-table td .generic-button:hover {
	text-decoration: none !important;
	text-decoration-line: none !important;
	text-decoration-style: none !important;
	text-decoration-color: transparent !important;
}

html body .generic-custom-table-wrapper .generic-custom-table th .generic-button .generic-button-text,
html body .generic-custom-table-wrapper .generic-custom-table td .generic-button .generic-button-text,
html body .generic-custom-table th .generic-button .generic-button-text,
html body .generic-custom-table td .generic-button .generic-button-text {
	color: inherit !important;
}

/* ── レスポンシブ */
@media (max-width: 768px) {
	.generic-custom-table-wrapper {
		margin: 20px 0;
		max-width: 100%;
	}

	.generic-custom-table {
		font-size: 14px !important;
	}

	.generic-custom-table thead th:first-child,
	.generic-custom-table tbody th {
		min-width: 100px;
		width: 35%;
		max-width: 140px;
	}

	.generic-custom-table th,
	.generic-custom-table td {
		padding: 8px 12px;
		font-size: 14px !important;
	}
}
