/* .wp-block-table */
.wp-block-table {
	&.is-style-regular {
		/* // 列数の判定 */
		/* // 2列の場合 */
		&:has(table tbody > tr:nth-of-type(1) > :nth-child(2):last-child) {
			@media (width <= 767px) {
				th,
				td {
					display: block;
				}
			}
		}

		/* // 3列と4列の場合 */
		&:has(table tbody > tr:nth-of-type(1) > :nth-child(3):last-child),
		&:has(table tbody > tr:nth-of-type(1) > :nth-child(4):last-child) {
			@media (width <= 767px) {
				&.js-scrollable {
					table {
						width: 1080px;
					}
				}
			}
		}

		table {
			width: 100%;
			background-color: var(--wp--preset--color--white);

			&:has(thead) {
				tbody {
					th {
						background-color: var(--wp--preset--color--alto-03);
					}
				}
			}

			&:not(:has(thead)) {
				tbody {
					th {
						color: var(--wp--preset--color--light-01);
						background-color: var(--wp--preset--color--primary);
					}
				}
			}

			th,
			td {
				padding: 1rem;
				vertical-align: middle;
				border: 1px solid var(--wp--preset--color--alto-10);
				@media (width <= 767px) {
					padding: 0.5rem;
				}
			}

			th {
				font-weight: 700;
				text-align: center;
			}

			thead {
				border: 1px solid var(--wp--preset--color--alto-10);

				th {
					color: var(--wp--preset--color--light-01);
					background-color: var(--wp--preset--color--primary);
				}
			}

			tbody {
				th {
					background-color: var(--wp--preset--color--alto-03);
				}
			}
		}

		figcaption {
			margin-block-start: 0.5rem;
			color: var(--wp--preset--color--dark-02);
			font-size: var(--wp--preset--font-size--small);
		}
	}
	&.is-style-time {
		table {
			border-radius: 1rem;
			overflow: hidden;
			background-color: #f3f3f3;
			border: 1px solid;
		}
		thead {
			border-block-end: 0;
		}
		tbody {
			tr {
				td, th {
					border-block-start: 1px solid #000;
				}
			}
		}
		th, td {
			border: 1px solid var(--wp--preset--color--white);
		}
		th {
			background-color: var(--wp--preset--color--primary);
			color: #fff;
		}
		span {
			font-size: var(--wp--preset--font-size--x-large);
			font-family: var(--wp--preset--font-family--roboto-condensed);
		}

		figcaption {
			margin-block-start: var(--wp--preset--spacing--20);
		}
	}
}
